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.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 6febcc168a8c..623695e18254 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -275,11 +275,10 @@ try_again:
!no_inherit) < 0) {
int err = errno;
- if (err == EPERM || err == EACCES)
- die("Permission error - are you root?\n"
- "\t Consider tweaking"
- " /proc/sys/kernel/perf_event_paranoid.\n");
- else if (err == ENODEV && cpu_list) {
+ if (err == EPERM || err == EACCES) {
+ ui__warning_paranoid();
+ exit(EXIT_FAILURE);
+ } else if (err == ENODEV && cpu_list) {
die("No such device - did you specify"
" an out-of-range profile CPU?\n");
} else if (err == EINVAL && sample_id_all_avail) {