Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf evsel: Say which PMU Hardware event doesn't support sampling/overflow-interrupts

Help identify to the user the event with the unsupported sampling error.
Also suggest a corrective action.

BEFORE:

$ sudo ./oldperf record -e armv8_pmuv3/mem_access/,ccn/cycles/,armv8_pmuv3/l2d_cache/ true
Error:
PMU Hardware doesn't support sampling/overflow-interrupts.

AFTER:

$ sudo ./newperf record -e armv8_pmuv3/mem_access/,ccn/cycles/,armv8_pmuv3/l2d_cache/ true
Error:
ccn/cycles/: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'

Signed-off-by: Kim Phillips <kim.phillips@arm.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20171114150452.e846f2e23684c7d7d8ee706f@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Kim Phillips and committed by
Arnaldo Carvalho de Melo
114bc191 239fb4fe

+3 -2
+3 -2
tools/perf/util/evsel.c
··· 2745 2745 break; 2746 2746 case EOPNOTSUPP: 2747 2747 if (evsel->attr.sample_period != 0) 2748 - return scnprintf(msg, size, "%s", 2749 - "PMU Hardware doesn't support sampling/overflow-interrupts."); 2748 + return scnprintf(msg, size, 2749 + "%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'", 2750 + perf_evsel__name(evsel)); 2750 2751 if (evsel->attr.precise_ip) 2751 2752 return scnprintf(msg, size, "%s", 2752 2753 "\'precise\' request may not be supported. Try removing 'p' modifier.");