From: David Ahern <daahern@cisco.com>
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>,
Tom Zanussi <tzanussi@gmail.com>
Subject: Re: [PATCH 3/6] perf tools: Emit clearer message for sys_perf_event_open ENOENT return
Date: Tue, 11 Jan 2011 11:40:23 -0700 [thread overview]
Message-ID: <4D2CA417.7030407@cisco.com> (raw)
In-Reply-To: <1294705692-9537-4-git-send-email-acme@infradead.org>
On 01/10/11 17:28, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> Improve sys_perf_event_open ENOENT return handling in top and record, just
> like 5a3446b does for stat.
>
> Cc: David Ahern <daahern@cisco.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>
> LKML-Reference: <new-submission>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> ---
> tools/perf/builtin-record.c | 3 +++
> tools/perf/builtin-top.c | 2 ++
> 2 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
> index 7bc0490..7069bd3 100644
> --- a/tools/perf/builtin-record.c
> +++ b/tools/perf/builtin-record.c
> @@ -331,6 +331,9 @@ 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) {
> + die("%s event is not supported. ",
> + event_name(evsel));
I think this interferes with the fallback from hardware profiling to
software profiling. .e.g., in a VM with no PMU.
David
> } 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..6ce4042 100644
> --- a/tools/perf/builtin-top.c
> +++ b/tools/perf/builtin-top.c
> @@ -1247,6 +1247,8 @@ try_again:
> die("Permission error - are you root?\n"
> "\t Consider tweaking"
> " /proc/sys/kernel/perf_event_paranoid.\n");
> + if (err == ENOENT)
> + die("%s event is not supported. ", event_name(evsel));
> /*
> * If it's cycles then fall back to hrtimer
> * based cpu-clock-tick sw counter, which
next prev parent reply other threads:[~2011-01-11 18:40 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 ` [PATCH 2/6] perf stat: better error message for unsupported events Arnaldo Carvalho de Melo
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 [this message]
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=4D2CA417.7030407@cisco.com \
--to=daahern@cisco.com \
--cc=acme@infradead.org \
--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;
as well as URLs for NNTP newsgroup(s).