mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, David Ahern <daahern@cisco.com>,
	Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
	a.p.zijlstra@chello.nl,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 2/6] perf stat: better error message for unsupported events
Date: Mon, 10 Jan 2011 22:28:08 -0200	[thread overview]
Message-ID: <1294705692-9537-3-git-send-email-acme@infradead.org> (raw)
In-Reply-To: <1294705692-9537-1-git-send-email-acme@infradead.org>

From: David Ahern <daahern@cisco.com>

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>
---
 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 2dfcb61..c385a63 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)
 				      "\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",
-- 
1.6.2.5


  parent reply	other threads:[~2011-01-11  0:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-11  0:28 [GIT PULL 0/6] perf/urgent fixes and improvements Arnaldo Carvalho de Melo
2011-01-11  0:28 ` [PATCH 1/6] perf sched: Fix allocation result check Arnaldo Carvalho de Melo
2011-01-11  0:28 ` Arnaldo Carvalho de Melo [this message]
2011-01-11  0:28 ` [PATCH 3/6] perf tools: Emit clearer message for sys_perf_event_open ENOENT return Arnaldo Carvalho de Melo
2011-01-11 18:40   ` David Ahern
2011-01-11 18:58     ` Arnaldo Carvalho de Melo
2011-01-11  0:28 ` [PATCH 4/6] perf sched: Use PTHREAD_STACK_MIN to avoid pthread_attr_setstacksize() fail Arnaldo Carvalho de Melo
2011-01-11  0:28 ` [PATCH 5/6] perf evsel: Support perf_evsel__open(cpus > 1 && threads > 1) Arnaldo Carvalho de Melo
2011-01-11  0:28 ` [PATCH 6/6] perf session: Fix infinite loop in __perf_session__process_events Arnaldo Carvalho de Melo
2011-01-11 10:57 ` [GIT PULL 0/6] perf/urgent fixes and improvements Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294705692-9537-3-git-send-email-acme@infradead.org \
    --to=acme@infradead.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=daahern@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®