linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>,
	David Ahern <dsahern@gmail.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Ingo Molnar <mingo@kernel.org>
Subject: [PATCH 8/9] perf tools: Add tracepoint support for parse_events_error
Date: Wed, 22 Apr 2015 21:10:23 +0200	[thread overview]
Message-ID: <1429729824-13932-9-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1429729824-13932-1-git-send-email-jolsa@kernel.org>

Allowing tracepoint events processing to report back error.

  $ perf record -e 'sched:krava' ls
  event syntax error: 'sched:krava'
                       \___ unknown tracepoint
  ...

Link: http://lkml.kernel.org/n/tip-xkbpn3j5of376ag7utcirt8w@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/util/parse-events.y | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 486247739a39..38a0f21fc433 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -388,7 +388,13 @@ PE_NAME ':' PE_NAME
 	struct list_head *list;
 
 	ALLOC_LIST(list);
-	ABORT_ON(parse_events_add_tracepoint(list, &data->idx, $1, $3));
+	if (parse_events_add_tracepoint(list, &data->idx, $1, $3)) {
+		struct parse_events_error *error = data->error;
+
+		error->idx = @1.first_column;
+		error->str = strdup("unknown tracepoint");
+		return -1;
+	}
 	$$ = list;
 }
 
-- 
1.9.3


  parent reply	other threads:[~2015-04-22 19:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 19:10 [PATCH 0/9] perf tools: Report event parsing errors Jiri Olsa
2015-04-22 19:10 ` [PATCH 1/9] perf tools: Add parse_events_error interface Jiri Olsa
2015-05-06  3:04   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-22 19:10 ` [PATCH 2/9] perf tools: Add flex support for parse_events_error Jiri Olsa
2015-05-06  3:04   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-22 19:10 ` [PATCH 3/9] perf tools: Always bail out when config_attr function fails Jiri Olsa
2015-05-06  3:04   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-22 19:10 ` [PATCH 4/9] perf tools: Change parse_events_add_pmu interface Jiri Olsa
2015-05-06  3:05   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-22 19:10 ` [PATCH 5/9] perf tools: Add location to pmu event terms Jiri Olsa
2015-05-06  3:05   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-22 19:10 ` [PATCH 6/9] perf tools: Add term support for parse_events_error Jiri Olsa
2015-05-06  3:05   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-22 19:10 ` [PATCH 7/9] perf tools: Add static terms " Jiri Olsa
2015-05-06  3:05   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-22 19:10 ` Jiri Olsa [this message]
2015-05-06  3:06   ` [tip:perf/core] perf tools: Add tracepoint " tip-bot for Jiri Olsa
2015-04-22 19:10 ` [PATCH 9/9] perf tools: Add symbolic events " Jiri Olsa
2015-05-06  3:06   ` [tip:perf/core] " tip-bot for Jiri Olsa
2015-04-23 14:44 ` [PATCH 0/9] perf tools: Report event parsing errors Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1429729824-13932-9-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).