diff options
author | David Ahern <daahern@cisco.com> | 2011-01-09 13:21:12 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2011-01-10 08:34:53 -0500 |
commit | 5a3446bc648d86a99a895e93d28d7df00bbbfb3c (patch) | |
tree | bc292838c295c6ce6918e485a0454d9a0f1f51f2 /tools | |
parent | e462dc553ea5e09d4713e7c35a11ed331dc6f369 (diff) |
perf stat: better error message for unsupported events
For unsupported events (e.g., H/W events when running in a VM)
perf stat currently fails with the error message:
Error: open_counter returned with 2 (No such file or directory).
/bin/dmesg may provide additional information.
Fatal: Not all events could be opened.
dmesg is of no help and it is not clear as to why it fails to
open the counter. This patch changes the error message to
Error: cache-misses event is not supported.
Fatal: Not all events could be opened.
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: a.p.zijlstra@chello.nl
LPU-Reference: <1294597272-17335-1-git-send-email-daahern@cisco.com>
Signed-off-by: David Ahern <daahern@cisco.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-stat.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 2dfcb613e66b..c385a63ebfd1 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
@@ -316,6 +316,8 @@ static int run_perf_stat(int argc __used, const char **argv) | |||
316 | "\t Consider tweaking" | 316 | "\t Consider tweaking" |
317 | " /proc/sys/kernel/perf_event_paranoid or running as root.", | 317 | " /proc/sys/kernel/perf_event_paranoid or running as root.", |
318 | system_wide ? "system-wide " : ""); | 318 | system_wide ? "system-wide " : ""); |
319 | } else if (errno == ENOENT) { | ||
320 | error("%s event is not supported. ", event_name(counter)); | ||
319 | } else { | 321 | } else { |
320 | error("open_counter returned with %d (%s). " | 322 | error("open_counter returned with %d (%s). " |
321 | "/bin/dmesg may provide additional information.\n", | 323 | "/bin/dmesg may provide additional information.\n", |