From: Namhyung Kim <namhyung.kim@lge.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
Namhyung Kim <namhyung@gmail.com>,
Pekka Enberg <penberg@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH/RFC] perf tools: Handle old kernels when opening perf event
Date: Fri, 09 Mar 2012 11:38:02 +0900 [thread overview]
Message-ID: <4F596D0A.9050009@lge.com> (raw)
In-Reply-To: <20120308145024.GA1764@infradead.org>
Hi,
2012-03-08 11:50 PM, Arnaldo Carvalho de Melo wrote:
> Em Thu, Mar 08, 2012 at 04:28:51 PM +0900, Namhyung Kim escreveu:
>> Changing default value of perf_guest back to false caused problems on old
>> kernels and its fix bc76efe64533 ("perf tools: Handle kernels that don't
>> support attr.exclude_{guest,host}") worked well for perf record/top.
>>
>> But I've just realized that using specific events on perf stat makes same
>> kind of troubles too. It's because the parse_events calls event_attr_init
>> for all events so that it would have exclude_guest set.
>>
>> Instead of fixing perf stat, I thought that changing perf_evsel__open()
>> is more appropriate. Please take a look and give comments - especially
>> on ->time_not_needed handling in builtin-record.c (I guess the original
>> code had a bug) and checking ->sample_id_all_missing inside of
>> perf_evsel__config (I believe checking it before perf_evsel__open is
>> meaningless since it will always have the same value - so I dropped it).
>
> One problem here is to have all those pr_debug calls down in the
> perf_evlist class, they need to be better conveyed to the user, and that
> depends on the kind of interface being used (stdio, TUI, GTK).
>
> One approach tried till the GTK patch was proposed was to just check the
> value of perf_browser or some UI fops table to do it at that level.
>
> But Pekka argued that we should allow tool writers to have more freedom
> than that, i.e. handle things as flexibly as possible.
>
Agreed.
> The way to do that, that I discussed with David Ahern some time ago, was
> to have per class errno enums, and then a per class strerror (really an
> strerror_r) that would map the integer error number to an string.
>
> Doing that we would also avoid having to bloat the python binding (or
> libperf at some point) with the pr_debug, etc machinery.
>
I remember that discussion. Yes, it'll show more verbose and helpful messages
when user got in trouble. But I don't have an idea how it helps in this
particular case - we anyway want to show user some message and keep going on.
Could you explain your idea in little more detail?
> For instance, with your patch applied, try running
> tools/perf/python/twatch.py :-)
>
Oops, I didn't noticed, sorry. I'll check twatch.py next time I touch python
binding codes.
BTW, how about simply adding its own eprintf implementation?
> Other than that, yeah, I think perf_attr_conf is needed and the rest of
> the patch looks ok, will look again after you address the above
> comments,
>
> Thanks!
>
> - Arnaldo
>
Thanks for your review,
Namhyung
prev parent reply other threads:[~2012-03-09 2:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-08 7:28 [PATCH/RFC] perf tools: Handle old kernels when opening perf event Namhyung Kim
2012-03-08 14:50 ` Arnaldo Carvalho de Melo
2012-03-09 2:38 ` Namhyung Kim [this message]
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=4F596D0A.9050009@lge.com \
--to=namhyung.kim@lge.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=namhyung@gmail.com \
--cc=paulus@samba.org \
--cc=penberg@kernel.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