diff options
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 6febcc168a8c..db6adecf46f1 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -275,11 +275,10 @@ try_again: | |||
275 | !no_inherit) < 0) { | 275 | !no_inherit) < 0) { |
276 | int err = errno; | 276 | int err = errno; |
277 | 277 | ||
278 | if (err == EPERM || err == EACCES) | 278 | if (err == EPERM || err == EACCES) { |
279 | die("Permission error - are you root?\n" | 279 | ui__warning_paranoid(); |
280 | "\t Consider tweaking" | 280 | exit(EXIT_FAILURE); |
281 | " /proc/sys/kernel/perf_event_paranoid.\n"); | 281 | } else if (err == ENODEV && cpu_list) { |
282 | else if (err == ENODEV && cpu_list) { | ||
283 | die("No such device - did you specify" | 282 | die("No such device - did you specify" |
284 | " an out-of-range profile CPU?\n"); | 283 | " an out-of-range profile CPU?\n"); |
285 | } else if (err == EINVAL && sample_id_all_avail) { | 284 | } else if (err == EINVAL && sample_id_all_avail) { |
@@ -302,11 +301,19 @@ try_again: | |||
302 | && attr->config == PERF_COUNT_HW_CPU_CYCLES) { | 301 | && attr->config == PERF_COUNT_HW_CPU_CYCLES) { |
303 | 302 | ||
304 | if (verbose) | 303 | if (verbose) |
305 | 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"); | ||
306 | attr->type = PERF_TYPE_SOFTWARE; | 306 | attr->type = PERF_TYPE_SOFTWARE; |
307 | attr->config = PERF_COUNT_SW_CPU_CLOCK; | 307 | attr->config = PERF_COUNT_SW_CPU_CLOCK; |
308 | goto try_again; | 308 | goto try_again; |
309 | } | 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 | |||
310 | printf("\n"); | 317 | printf("\n"); |
311 | 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", |
312 | err, strerror(err)); | 319 | err, strerror(err)); |