diff options
author | Jiri Olsa <jolsa@redhat.com> | 2012-03-15 15:09:18 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-03-16 13:30:13 -0400 |
commit | 5f537a26590e696466aae7f41e6b77e92c8486d1 (patch) | |
tree | 6946ba5b2a4cc1133ab11d8a81c37465f794e655 /tools/perf/util/parse-events.y | |
parent | cd82a32e9924d3a82bd27f830755d23e4ded25bc (diff) |
perf tools: Add support to specify pmu style event
Added new event rule to the event definition grammar:
event_def: event_pmu |
...
event_pmu: PE_NAME '/' event_config '/'
Using this rule, event could be now specified like:
cpu/config=1,config1=2,config2=3/u
where pmu name 'cpu' is looked up via following path:
${sysfs_mount}/bus/event_source/devices/${pmu}
and config options are bound to the pmu's format definiton:
${sysfs_mount}/bus/event_source/devices/${pmu}/format
The hardcoded config options still stays and have precedence
over any format field defined with same name.
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/n/tip-50d8nr94f8k4wkezutrxvthe@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-events.y')
-rw-r--r-- | tools/perf/util/parse-events.y | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index c88c08e4e79d..3a530193f5a8 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y | |||
@@ -61,13 +61,21 @@ event_def PE_MODIFIER_EVENT | |||
61 | | | 61 | | |
62 | event_def | 62 | event_def |
63 | 63 | ||
64 | event_def: event_legacy_symbol | | 64 | event_def: event_pmu | |
65 | event_legacy_symbol | | ||
65 | event_legacy_cache sep_dc | | 66 | event_legacy_cache sep_dc | |
66 | event_legacy_mem | | 67 | event_legacy_mem | |
67 | event_legacy_tracepoint sep_dc | | 68 | event_legacy_tracepoint sep_dc | |
68 | event_legacy_numeric sep_dc | | 69 | event_legacy_numeric sep_dc | |
69 | event_legacy_raw sep_dc | 70 | event_legacy_raw sep_dc |
70 | 71 | ||
72 | event_pmu: | ||
73 | PE_NAME '/' event_config '/' | ||
74 | { | ||
75 | ABORT_ON(parse_events_add_pmu(list, idx, $1, $3)); | ||
76 | parse_events__free_terms($3); | ||
77 | } | ||
78 | |||
71 | event_legacy_symbol: | 79 | event_legacy_symbol: |
72 | PE_VALUE_SYM '/' event_config '/' | 80 | PE_VALUE_SYM '/' event_config '/' |
73 | { | 81 | { |