aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2012-09-13 16:59:15 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-10-24 12:20:11 -0400
commit2305c82fb35dd2c8c9533303bb1693f1636c66e4 (patch)
tree5a85edf5c7b1df1d65cfef7302279002edcd77bc
parent03f2f93ae00762eb881424df1c688d034fd341ee (diff)
perf tools: Give user better message if precise is not supported
Platforms (e.g., VM's) without support for precise mode get a confusing error message. e.g., $ perf record -e cycles:p -a -- sleep 1 Error: sys_perf_event_open() syscall returned with 95 (Operation not supported). /bin/dmesg may provide additional information. No hardware sampling interrupt available. No APIC? If so then you can boot the kernel with the "lapic" boot parameter to force-enable it. sleep: Terminated which is not clear that precise mode might be the root problem. With this patch: $ perf record -e cycles:p -fo /tmp/perf.data -- sleep 1 Error: 'precise' request may not be supported. Try removing 'p' modifier sleep: Terminated v2: softened message to 'may not be' supported per Robert's suggestion Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Robert Richter <robert.richter@amd.com> Link: http://lkml.kernel.org/r/1347569955-54626-4-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/builtin-record.c5
-rw-r--r--tools/perf/builtin-top.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 73b5d7f91194..53c9892e96dd 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -317,6 +317,11 @@ try_again:
317 perf_evsel__name(pos)); 317 perf_evsel__name(pos));
318 rc = -err; 318 rc = -err;
319 goto out; 319 goto out;
320 } else if ((err == EOPNOTSUPP) && (attr->precise_ip)) {
321 ui__error("\'precise\' request may not be supported. "
322 "Try removing 'p' modifier\n");
323 rc = -err;
324 goto out;
320 } 325 }
321 326
322 printf("\n"); 327 printf("\n");
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index fb9da71eba1f..f2ecd498c72d 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -977,6 +977,10 @@ try_again:
977 ui__error("Too many events are opened.\n" 977 ui__error("Too many events are opened.\n"
978 "Try again after reducing the number of events\n"); 978 "Try again after reducing the number of events\n");
979 goto out_err; 979 goto out_err;
980 } else if ((err == EOPNOTSUPP) && (attr->precise_ip)) {
981 ui__error("\'precise\' request may not be supported. "
982 "Try removing 'p' modifier\n");
983 goto out_err;
980 } 984 }
981 985
982 ui__error("The sys_perf_event_open() syscall " 986 ui__error("The sys_perf_event_open() syscall "