diff options
author | Robert Richter <robert.richter@amd.com> | 2012-08-16 23:10:21 +0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-08-22 20:40:49 +0400 |
commit | ac2ba9f36bb400755e411309f3e76dbf308a10e7 (patch) | |
tree | 126e4ce25d51de626056c2d6bc1b2afd7098558f /tools/perf/util/parse-events.y | |
parent | 9bfbbc6d1e6b4d055860231e232b807911bf8325 (diff) | |
download | linux-ac2ba9f36bb400755e411309f3e76dbf308a10e7.tar.xz |
perf tools: Catch event names from command line
Use command line string provided by the -e option to name events. This
way we get unique events names that also support pmu event syntax
(<pmu_name>/<config>/<modifier>). No need to reconstruct the name
anymore from its attributes. We use the event_desc of the header to
store the name in the perf.data header. Thus it is also available for
perf report.
Implemented by putting the parser in different states to parse events or
configs.
And since event names are now generated from the command line
specification. Update event names in test cases accordingly.
Signed-off-by: Robert Richter <robert.richter@amd.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1345144224-27280-6-git-send-email-robert.richter@amd.com
[ committer note: Folded patch fixing 'perf test' failure reported by Jiri Olsa ]
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 | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index 66850f820df9..42d9a17b83b1 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y @@ -27,6 +27,7 @@ do { \ %token PE_START_EVENTS PE_START_TERMS %token PE_VALUE PE_VALUE_SYM_HW PE_VALUE_SYM_SW PE_RAW PE_TERM +%token PE_EVENT_NAME %token PE_NAME %token PE_MODIFIER_EVENT PE_MODIFIER_BP %token PE_NAME_CACHE_TYPE PE_NAME_CACHE_OP_RESULT @@ -42,6 +43,7 @@ do { \ %type <str> PE_NAME_CACHE_OP_RESULT %type <str> PE_MODIFIER_EVENT %type <str> PE_MODIFIER_BP +%type <str> PE_EVENT_NAME %type <num> value_sym %type <head> event_config %type <term> event_term @@ -53,6 +55,8 @@ do { \ %type <head> event_legacy_numeric %type <head> event_legacy_raw %type <head> event_def +%type <head> event_mod +%type <head> event_name %type <head> event %type <head> events %type <head> group_def @@ -143,8 +147,10 @@ events ',' event | event -event: -event_def PE_MODIFIER_EVENT +event: event_mod + +event_mod: +event_name PE_MODIFIER_EVENT { struct list_head *list = $1; @@ -157,6 +163,16 @@ event_def PE_MODIFIER_EVENT $$ = list; } | +event_name + +event_name: +PE_EVENT_NAME event_def +{ + ABORT_ON(parse_events_name($2, $1)); + free($1); + $$ = $2; +} +| event_def event_def: event_pmu | |