From: David Ahern <dsahern@gmail.com>
To: Robert Richter <robert.richter@amd.com>
Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org,
peterz@infradead.org, Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH 3/3] perf tool: give user better message if precise is not supported
Date: Tue, 11 Sep 2012 07:22:32 -0600 [thread overview]
Message-ID: <504F3B18.90403@gmail.com> (raw)
In-Reply-To: <20120911092026.GU8285@erda.amd.com>
On 9/11/12 3:20 AM, Robert Richter wrote:
> On 10.09.12 10:40:16, David Ahern wrote:
>> --- a/tools/perf/builtin-record.c
>> +++ b/tools/perf/builtin-record.c
>> @@ -294,6 +294,11 @@ try_again:
>> perf_evsel__name(pos));
>> rc = -err;
>> goto out;
>> + } else if ((err == ENOTSUP) && (attr->precise_ip)) {
>
> It is EOPNOTSUPP, did you test this?
I do not post patches without testing them. This particular patch was
verified in a Virtual Machine (no PEBS) and using :pG modifier.
'egrep -r ENOTSUP tools/perf' shows hits in 3 other files, so I am not
the only one using the shortcut. I'll change it in the follow up with
better commit messages to make it consistent with patch 2.
>
>> + ui__error("\'precise\' request not supported. "
>> + "Try removing 'p' modifier\n");
>
> I would better print "... request may not be supported.", since you
> don't know for sure if this is the real cause.
Sure I'll add the 'may not be'.
>
>> + rc = -err;
>> + goto out;
>> }
>>
>> printf("\n");
>> diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
>> index 0513aaa..0d3653b 100644
>> --- a/tools/perf/builtin-top.c
>> +++ b/tools/perf/builtin-top.c
>> @@ -975,6 +975,10 @@ try_again:
>> ui__error("Too many events are opened.\n"
>> "Try again after reducing the number of events\n");
>> goto out_err;
>> + } else if ((err == ENOTSUP) && (attr->precise_ip)) {
>> + ui__error("\'precise\' request not supported. "
>> + "Try removing 'p' modifier\n");
>
> Same here.
>
>> + goto out_err;
>
> To avoid adding more duplicate code, maybe we should start to unify
> the code by implementing this in a shared helper function.
Doing that requires additional modifications to not break perl and
python scripts. Adding it in both commands here is consistent with all
other open counter failures. Consolidation of those loops into a common
base is known to do item.
David
next prev parent reply other threads:[~2012-09-11 13:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 16:40 [PATCH 0/3] perf: precise mode and exclude_guest David Ahern
2012-09-10 16:40 ` [PATCH 1/3] perf tool: precise mode requires exclude_guest David Ahern
2012-09-10 17:23 ` Peter Zijlstra
2012-09-10 16:40 ` [PATCH 2/3] perf: require exclude_guest to use PEBS - kernel side enforcement David Ahern
2012-09-10 17:24 ` Peter Zijlstra
2012-09-10 16:40 ` [PATCH 3/3] perf tool: give user better message if precise is not supported David Ahern
2012-09-11 9:20 ` Robert Richter
2012-09-11 13:22 ` David Ahern [this message]
2012-09-11 14:01 ` Robert Richter
2012-09-11 14:32 ` David Ahern
2012-09-11 15:11 ` Robert Richter
2012-09-12 14:59 ` David Ahern
2012-09-10 16:57 ` [PATCH 0/3] perf: precise mode and exclude_guest Peter Zijlstra
2012-09-10 17:01 ` David Ahern
2012-09-10 17:13 ` Peter Zijlstra
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=504F3B18.90403@gmail.com \
--to=dsahern@gmail.com \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=robert.richter@amd.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).