perf tools: Add arbitary aliases and support names with -
authorAndi Kleen <ak@linux.intel.com>
Mon, 5 Nov 2012 13:50:52 +0000 (14:50 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 8 Nov 2012 19:12:03 +0000 (16:12 -0300)
- Add missing scanner symbol for arbitrary aliases inside the config
  region.

- looks nicer than _, so allow - in the event names. Used for various of
  the arch perfmon and Haswell events.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1352123463-7346-6-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/parse-events.l

index c87efc12579defb039c1782452f45ba556d23208..66959fab6634366032ac2f1d5fbbda5e234464dc 100644 (file)
@@ -81,6 +81,7 @@ num_dec               [0-9]+
 num_hex                0x[a-fA-F0-9]+
 num_raw_hex    [a-fA-F0-9]+
 name           [a-zA-Z_*?][a-zA-Z0-9_*?]*
+name_minus     [a-zA-Z_*?][a-zA-Z0-9\-_*?]*
 modifier_event [ukhpGH]{1,8}
 modifier_bp    [rwx]{1,3}
 
@@ -168,6 +169,7 @@ period                      { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD); }
 branch_type            { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_BRANCH_SAMPLE_TYPE); }
 ,                      { return ','; }
 "/"                    { BEGIN(INITIAL); return '/'; }
+{name_minus}           { return str(yyscanner, PE_NAME); }
 }
 
 mem:                   { BEGIN(mem); return PE_PREFIX_MEM; }