Skip to contentSkip to conversation

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

PATCH Superseded Kim Phillips 1 participant 1 message Oct 27, 2017 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 perf tool: 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 provide an alternative 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'
---
 tools/perf/util/evsel.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
tools/perf/util/evsel.c +3 -2
index f894893c203d..a0f298726324 100644
@@ -2739,8 +2739,9 @@ int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target,
 		break;
 	case EOPNOTSUPP:
 		if (evsel->attr.sample_period != 0)
-			return scnprintf(msg, size, "%s",
-	"PMU Hardware doesn't support sampling/overflow-interrupts.");
+			return scnprintf(msg, size,
+	"%s: PMU Hardware doesn't support sampling/overflow-interrupts. Try 'perf stat'",
+					 perf_evsel__name(evsel));
 		if (evsel->attr.precise_ip)
 			return scnprintf(msg, size, "%s",
 	"\'precise\' request may not be supported. Try removing 'p' modifier.");
Signature · 1 line
2.14.2