Skip to content

Commit a820e33

Browse files
Andi Kleenacmel
authored andcommitted
perf pmu: Special case uncore_ prefix
Special case uncore_ prefix in PMU match, to allow for shorter event uncore specifications. Before: perf stat -a -e uncore_cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1 After perf stat -a -e cbox/event=0x35,umask=0x1,filter_opc=0x19C/ sleep 1 Committer tests: # perf list uncore List of pre-defined events (to be used in -e): uncore_cbox_0/clockticks/ [Kernel PMU event] uncore_cbox_1/clockticks/ [Kernel PMU event] uncore_imc/data_reads/ [Kernel PMU event] uncore_imc/data_writes/ [Kernel PMU event] # perf stat -a -e cbox_0/clockticks/ sleep 1 Performance counter stats for 'system wide': 281,474,976,653,084 cbox_0/clockticks/ 1.000870129 seconds time elapsed # Signed-off-by: Andi Kleen <[email protected]> Acked-by: Jiri Olsa <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 8255718 commit a820e33

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/perf/util/parse-events.y

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ PE_NAME opt_event_config
239239
while ((pmu = perf_pmu__scan(pmu)) != NULL) {
240240
char *name = pmu->name;
241241

242+
if (!strncmp(name, "uncore_", 7) &&
243+
strncmp($1, "uncore_", 7))
244+
name += 7;
242245
if (!strncmp($1, name, strlen($1))) {
243246
if (parse_events_copy_term_list(orig_terms, &terms))
244247
YYABORT;

0 commit comments

Comments
 (0)