diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-25 08:56:21 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-02-25 08:56:21 -0500 |
commit | bb109acc4adeae425147ca87b84d312ea40f24f1 (patch) | |
tree | 16704f37cdeaacf55c7234d4492ecfecedaa35dd /tools | |
parent | 7e9551bc72201838ebaf388224ff43ddf2b0d853 (diff) |
perf tools: Fix parsing of pmu events with empty list of modifiers
In 1d55e8ef340d ("perf tools: Introduce opt_event_config nonterminal") I
removed the unconditional "'/' '/'" for pmu events such as
"intel_pt//" but forgot to use opt_event_config where it expected some
event_config, oops. Fix it.
Noticed when trying to use:
# perf record -e intel_pt// -a sleep 1
event syntax error: 'intel_pt//'
\___ parser error
Run 'perf list' for a list of valid events
Usage: perf record [<options>] [<command>]
or: perf record [<options>] -- <command> [<options>]
-e, --event <event> event selector. use 'perf list' to list available events
#
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Fixes: 1d55e8ef340d ("perf tools: Introduce opt_event_config nonterminal")
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/parse-events.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index d1fbcabbe70d..85c44ba79cad 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y | |||
@@ -217,14 +217,14 @@ event_def: event_pmu | | |||
217 | event_bpf_file | 217 | event_bpf_file |
218 | 218 | ||
219 | event_pmu: | 219 | event_pmu: |
220 | PE_NAME '/' event_config '/' | 220 | PE_NAME opt_event_config |
221 | { | 221 | { |
222 | struct parse_events_evlist *data = _data; | 222 | struct parse_events_evlist *data = _data; |
223 | struct list_head *list; | 223 | struct list_head *list; |
224 | 224 | ||
225 | ALLOC_LIST(list); | 225 | ALLOC_LIST(list); |
226 | ABORT_ON(parse_events_add_pmu(data, list, $1, $3)); | 226 | ABORT_ON(parse_events_add_pmu(data, list, $1, $2)); |
227 | parse_events_terms__delete($3); | 227 | parse_events_terms__delete($2); |
228 | $$ = list; | 228 | $$ = list; |
229 | } | 229 | } |
230 | | | 230 | | |