提交 5a3446bc 编写于 作者: D David Ahern 提交者: Arnaldo Carvalho de Melo

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: NDavid Ahern <daahern@cisco.com>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 e462dc55
......@@ -316,6 +316,8 @@ static int run_perf_stat(int argc __used, const char **argv)
"\t Consider tweaking"
" /proc/sys/kernel/perf_event_paranoid or running as root.",
system_wide ? "system-wide " : "");
} else if (errno == ENOENT) {
error("%s event is not supported. ", event_name(counter));
} else {
error("open_counter returned with %d (%s). "
"/bin/dmesg may provide additional information.\n",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册