From: Anton Blanchard <anton@samba.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: paulus@samba.org, a.p.zijlstra@chello.nl,
linux-kernel@vger.kernel.org, fweisbec@gmail.com,
acme@redhat.com
Subject: Re: [PATCH] perf record: Enable PERF_SAMPLE_ID when sampling multiple events
Date: Thu, 22 Oct 2009 16:00:44 +1100 [thread overview]
Message-ID: <20091022050044.GX4808@kryten> (raw)
In-Reply-To: <20091021115935.GH16586@elte.hu>
Hi Ingo,
> > If we are sampling multiple events we need the id in each sample so we
> > can differentiate between them in a perf data file.
>
> Wondering, what are you (or will you be) using this for?
I put together a simple python library for parsing perf.data files:
http://ozlabs.org/~anton/junkcode/perf_event.py
An example of using it is here:
http://ozlabs.org/~anton/junkcode/perf_event_example.py
Only tested on powerpc so far, but it should work on x86. It's still
missing bits but it has been useful for finding some corner cases in
perf_event. It should also make it easy to post process complex profiles with
multiple events in them.
One problem this has just found though, is with PERF_EVENT_SAMPLE:
# FIXME: If sampling multiple events we have an issue
# here. Since the SAMPLE_ID is not the first optional field
# it might be impossible to differentiate between
# events since the SAMPLE_ID field would be at different
# offsets. For now we assume all events use the same
# set of optional fields.
eventnr = 0
self.event = sample_event(eventbuf,
self.header.attrs[eventnr].sample_type)
It seems like the API allows us to specify different sample options for
different events, but since the ID isnt the first option it could end up
in different places in different events, making it difficult (if not
impossible in some cases) to tag events correctly.
Anton
next prev parent reply other threads:[~2009-10-22 5:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-21 6:19 [PATCH] perf record: Enable PERF_SAMPLE_ID when sampling multiple events Anton Blanchard
2009-10-21 11:59 ` Ingo Molnar
2009-10-22 5:00 ` Anton Blanchard [this message]
2009-10-23 6:18 ` 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=20091022050044.GX4808@kryten \
--to=anton@samba.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--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