From: David Ahern <daahern@cisco.com>
To: linux-kernel@vger.kernel.org
Cc: acme@redhat.com, fweisbec@gmail.com, mingo@elte.hu,
efault@gmx.de, paulus@samba.org, peterz@infradead.org,
eranian@google.com, tzanussi@gmail.com,
David Ahern <daahern@cisco.com>
Subject: [PATCH] perf tools: Emit clearer message for sys_perf_event_open ENOENT return
Date: Thu, 13 Jan 2011 11:16:16 -0700 [thread overview]
Message-ID: <1294942576-9203-1-git-send-email-daahern@cisco.com> (raw)
Improve sys_perf_event_open ENOENT return handling in top and record, just
like 5a3446b does for stat.
Retry of Arnaldo's patch using error instead of die which allows the fallback
from hardware cycles to software clock.
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Signed-off-by: David Ahern <daahern@cisco.com>
---
tools/perf/builtin-record.c | 2 ++
tools/perf/builtin-top.c | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 7bc0490..fe24c19 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -331,6 +331,8 @@ try_again:
else if (err == ENODEV && cpu_list) {
die("No such device - did you specify"
" an out-of-range profile CPU?\n");
+ } else if (err == ENOENT) {
+ error("%s event is not supported.", event_name(evsel));
} else if (err == EINVAL && sample_id_all_avail) {
/*
* Old kernel, no attr->sample_id_type_all field
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 1e67ab9..b144353 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1247,6 +1247,9 @@ try_again:
die("Permission error - are you root?\n"
"\t Consider tweaking"
" /proc/sys/kernel/perf_event_paranoid.\n");
+ else if (err == ENOENT)
+ error("%s event is not supported.", event_name(evsel));
+
/*
* If it's cycles then fall back to hrtimer
* based cpu-clock-tick sw counter, which
--
1.7.3.4
next reply other threads:[~2011-01-13 18:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 18:16 David Ahern [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-03-25 18:05 [PATCH] perf tools: Emit clearer message for sys_perf_event_open ENOENT return David Ahern
2011-03-25 18:08 ` Arnaldo Carvalho de Melo
2011-03-25 18:26 ` David Ahern
2011-03-25 18:37 ` Arnaldo Carvalho de Melo
2011-03-25 19:11 David Ahern
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=1294942576-9203-1-git-send-email-daahern@cisco.com \
--to=daahern@cisco.com \
--cc=acme@redhat.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tzanussi@gmail.com \
/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