From: Peter Zijlstra <peterz@infradead.org>
To: Stephane Eranian <eranian@google.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
mingo@elte.hu, Paul Mackerras <paulus@samba.org>,
Robert Richter <robert.richter@amd.com>,
Andi Kleen <andi@firstfloor.org>
Subject: Re: [BUG] perf_event: sampling buffer format cannot handle multi-event sampling
Date: Tue, 19 Apr 2011 21:22:15 +0200 [thread overview]
Message-ID: <1303240935.8345.7.camel@twins> (raw)
In-Reply-To: <BANLkTi=g6iPgdctAmuZ=bb8J6FqNJA-vZQ@mail.gmail.com>
On Tue, 2011-04-19 at 19:10 +0000, Stephane Eranian wrote:
> Hi,
>
> I was looking at the sampling buffer format and I think there is an
> issue in case
> one samples on more than one event at a time and each event as a different
> sample_type value (i.e., what it wants to record in each sample).
>
> The sample_type is exported per-event by the API. In order to decode a sample
> (PERF_RECORD_SAMPLE) one has to know which event caused it. To identify
> the event, one has to include PERF_SAMPLE_ID in the sample_type. Each such
> id uniquely identifies an event. Assuming the tool keeps a mapping of event to
> ID, we can then reconstruct. This is what perf does.
>
> The problem is that to extract the event ID, one has to already parse the sample
> itself. That means, you need sample_type to extract the event ID.
>
> Thus, we have a catch 22 situation.
>
> Looking at the perf tool, it sort of works today simply because the
> same sample_type
> is applied to all events.
>
> To solve this, we could either:
> - add the event ID to the header for PERF_RECORD_SAMPLE
> - enforce event ID is systematically saved at the beginning on
> PERF_RECORD_SAMPLE
>
> None of those options is transparent, I am afraid, unless we introduce
> new record types.
Or simply don't mix different sample_types in the same buffer?
next prev parent reply other threads:[~2011-04-19 19:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-19 19:10 [BUG] perf_event: sampling buffer format cannot handle multi-event sampling Stephane Eranian
2011-04-19 19:22 ` Peter Zijlstra [this message]
2011-04-19 21:16 ` Stephane Eranian
2011-04-19 21:20 ` Peter Zijlstra
2011-04-19 21:19 ` Stephane Eranian
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=1303240935.8345.7.camel@twins \
--to=peterz@infradead.org \
--cc=acme@redhat.com \
--cc=andi@firstfloor.org \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.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