From: David Ahern <dsahern@gmail.com>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
linux-kernel@vger.kernel.org,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
Namhyung Kim <namhyung@gmail.com>,
Paul Mackerras <paulus@samba.org>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH] perf kvm: fix sample_type manipulation
Date: Fri, 06 Sep 2013 07:59:22 -0600 [thread overview]
Message-ID: <5229DFBA.5090909@gmail.com> (raw)
In-Reply-To: <20130906125304.GA29064@ghostprotocols.net>
On 9/6/13 6:53 AM, Arnaldo Carvalho de Melo wrote:
> Em Fri, Sep 06, 2013 at 09:48:54AM +0300, Adrian Hunter escreveu:
>> Manipulating the sample_type of an evsel requires
>> the use of:
>> perf_evsel__set_sample_bit()
>> and perf_evsel__reset_sample_bit()
>
> Fine, but...
hmmm... this is a relatively new API (7be5ebe8). The kvm-live command
and my scheduling daemon pre-date its introduction.
>
>> Manipulating the sample type of an evlist requires
>> the id position to be recalculated.
And this is hot of the presses ... 75562573.
>
> ... can't we hide this detail? I.e. we could do it like we do with the
> alloc_{mmap,poll}() evlist methods in perf_evlist__mmap(), checking if it was
> already done, etc.
>
> This we reduce the contact surface for tools using evlists and evsels.
>
> I.e., this sequence:
>
>
> + perf_evlist__set_id_pos(evlist);
> +
> err = perf_evlist__open(evlist);
>
> Could remain just:
>
> err = perf_evlist__open(evlist);
perf code has been around a while now and I know there are a number of
local analysis commands built around it. API changes like this --
required ones at that -- need to be simple and some error checking built
in where possible.
... and documentation for the API on what commands should be doing and
in what order.
David
next prev parent reply other threads:[~2013-09-06 13:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 6:48 [PATCH] perf kvm: fix sample_type manipulation Adrian Hunter
2013-09-06 12:53 ` Arnaldo Carvalho de Melo
2013-09-06 13:59 ` David Ahern [this message]
2013-09-06 17:39 ` 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=5229DFBA.5090909@gmail.com \
--to=dsahern@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=adrian.hunter@intel.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=namhyung@gmail.com \
--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