All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org,
	hpa@zytor.com, peterz@infradead.org, namhyung@kernel.org,
	acme@redhat.com, mingo@kernel.org, jolsa@kernel.org,
	tglx@linutronix.de, dsahern@gmail.com
Subject: [tip:perf/urgent] perf pmu: Fix pmu events parsing rule
Date: Wed, 25 Apr 2018 22:54:06 -0700	[thread overview]
Message-ID: <tip-9a4a931ce847f4aaa12edf11b2e050e18bf45910@git.kernel.org> (raw)
In-Reply-To: <20180423090823.32309-5-jolsa@kernel.org>

Commit-ID:  9a4a931ce847f4aaa12edf11b2e050e18bf45910
Gitweb:     https://git.kernel.org/tip/9a4a931ce847f4aaa12edf11b2e050e18bf45910
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 23 Apr 2018 11:08:18 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 23 Apr 2018 11:17:27 -0300

perf pmu: Fix pmu events parsing rule

Currently all the event parsing fails end up in the event_pmu rule, and
display misleading help like:

  $ perf stat -e inst kill
  event syntax error: 'inst'
                       \___ Cannot find PMU `inst'. Missing kernel support?
  ...

The reason is that the event_pmu is too strong and match also single
string. Changing it to force the '/' separators to be part of the rule,
and getting the proper error now:

  $ perf stat -e inst kill
  event syntax error: 'inst'
                       \___ parser error
  Run 'perf list' for a list of valid events
  ...

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Reported-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180423090823.32309-5-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-events.y | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 7afeb80cc39e..d14464c42714 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -224,15 +224,15 @@ event_def: event_pmu |
 	   event_bpf_file
 
 event_pmu:
-PE_NAME opt_event_config
+PE_NAME '/' event_config '/'
 {
 	struct list_head *list, *orig_terms, *terms;
 
-	if (parse_events_copy_term_list($2, &orig_terms))
+	if (parse_events_copy_term_list($3, &orig_terms))
 		YYABORT;
 
 	ALLOC_LIST(list);
-	if (parse_events_add_pmu(_parse_state, list, $1, $2, false)) {
+	if (parse_events_add_pmu(_parse_state, list, $1, $3, false)) {
 		struct perf_pmu *pmu = NULL;
 		int ok = 0;
 		char *pattern;
@@ -262,7 +262,7 @@ PE_NAME opt_event_config
 		if (!ok)
 			YYABORT;
 	}
-	parse_events_terms__delete($2);
+	parse_events_terms__delete($3);
 	parse_events_terms__delete(orig_terms);
 	$$ = list;
 }

  parent reply	other threads:[~2018-04-26  5:54 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-23  9:08 [PATCH 0/9] perf tools: Assorted fixes Jiri Olsa
2018-04-23  9:08 ` [PATCH 1/9] perf check-headers.sh: Simplify arguments passing Jiri Olsa
2018-05-02 17:40   ` [tip:perf/core] " tip-bot for Jiri Olsa
2018-04-23  9:08 ` [PATCH 2/9] perf check-headers.sh: Add support to check 2 independent files Jiri Olsa
2018-04-23 14:28   ` Arnaldo Carvalho de Melo
2018-05-02 17:41   ` [tip:perf/core] " tip-bot for Jiri Olsa
2018-04-23  9:08 ` [PATCH 3/9] perf stat: Keep the / modifier separator in fallback Jiri Olsa
2018-04-23 14:16   ` Arnaldo Carvalho de Melo
2018-04-26  5:53   ` [tip:perf/urgent] " tip-bot for Jiri Olsa
2018-04-23  9:08 ` [PATCH 4/9] perf tools: Fix pmu events parsing rule Jiri Olsa
2018-04-23 14:20   ` Arnaldo Carvalho de Melo
2018-04-23 14:25     ` Jiri Olsa
2018-04-26  5:54   ` tip-bot for Jiri Olsa [this message]
2018-04-23  9:08 ` [PATCH 5/9] perf tools: Disable write_backward for leader sampling group events Jiri Olsa
2018-04-23 14:23   ` Arnaldo Carvalho de Melo
2018-04-26  5:54   ` [tip:perf/urgent] perf evsel: " tip-bot for Jiri Olsa
2018-04-23  9:08 ` [PATCH 6/9] perf stat: Display time in precision based on std deviation Jiri Olsa
2018-04-23 14:40   ` Arnaldo Carvalho de Melo
2018-05-02 17:41   ` [tip:perf/core] " tip-bot for Jiri Olsa
2018-04-23  9:08 ` [PATCH 7/9] perf stat: Add --table option to display time of each run Jiri Olsa
2018-04-23 14:41   ` Arnaldo Carvalho de Melo
2018-04-23 15:29     ` Jiri Olsa
2018-05-02 17:42   ` [tip:perf/core] " tip-bot for Jiri Olsa
2018-04-23  9:08 ` [PATCH 8/9] perf stat: Display length strings of each run for --table option Jiri Olsa
2018-05-02 17:42   ` [tip:perf/core] " tip-bot for Jiri Olsa
2018-04-23  9:08 ` [PATCH 9/9] perf stat: Display user and system time Jiri Olsa
2018-04-23 14:51   ` Arnaldo Carvalho de Melo
2018-04-23 15:30     ` Jiri Olsa
2018-04-23 18:48 ` [PATCH 0/9] perf tools: Assorted fixes 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=tip-9a4a931ce847f4aaa12edf11b2e050e18bf45910@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dsahern@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.