aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/builtin-record.c10
-rw-r--r--tools/perf/builtin-top.c6
2 files changed, 15 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:
301 && attr->config == PERF_COUNT_HW_CPU_CYCLES) { 301 && attr->config == PERF_COUNT_HW_CPU_CYCLES) {
302 302
303 if (verbose) 303 if (verbose)
304 warning(" ... trying to fall back to cpu-clock-ticks\n"); 304 ui__warning("The cycles event is not supported, "
305 "trying to fall back to cpu-clock-ticks\n");
305 attr->type = PERF_TYPE_SOFTWARE; 306 attr->type = PERF_TYPE_SOFTWARE;
306 attr->config = PERF_COUNT_SW_CPU_CLOCK; 307 attr->config = PERF_COUNT_SW_CPU_CLOCK;
307 goto try_again; 308 goto try_again;
308 } 309 }
310
311 if (err == ENOENT) {
312 ui__warning("The %s event is not supported.\n",
313 event_name(pos));
314 exit(EXIT_FAILURE);
315 }
316
309 printf("\n"); 317 printf("\n");
310 error("sys_perf_event_open() syscall returned with %d (%s). /bin/dmesg may provide additional information.\n", 318 error("sys_perf_event_open() syscall returned with %d (%s). /bin/dmesg may provide additional information.\n",
311 err, strerror(err)); 319 err, strerror(err));
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 935fc4fd878e..fc1273e976c5 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -870,6 +870,12 @@ try_again:
870 goto try_again; 870 goto try_again;
871 } 871 }
872 872
873 if (err == ENOENT) {
874 ui__warning("The %s event is not supported.\n",
875 event_name(counter));
876 goto out_err;
877 }
878
873 ui__warning("The sys_perf_event_open() syscall " 879 ui__warning("The sys_perf_event_open() syscall "
874 "returned with %d (%s). /bin/dmesg " 880 "returned with %d (%s). /bin/dmesg "
875 "may provide additional information.\n" 881 "may provide additional information.\n"