aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 623695e18254..db6adecf46f1 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -301,11 +301,19 @@ try_again:
&& attr->config == PERF_COUNT_HW_CPU_CYCLES) {
if (verbose)
- warning(" ... trying to fall back to cpu-clock-ticks\n");
+ ui__warning("The cycles event is not supported, "
+ "trying to fall back to cpu-clock-ticks\n");
attr->type = PERF_TYPE_SOFTWARE;
attr->config = PERF_COUNT_SW_CPU_CLOCK;
goto try_again;
}
+
+ if (err == ENOENT) {
+ ui__warning("The %s event is not supported.\n",
+ event_name(pos));
+ exit(EXIT_FAILURE);
+ }
+
printf("\n");
error("sys_perf_event_open() syscall returned with %d (%s). /bin/dmesg may provide additional information.\n",
err, strerror(err));