From: Arnaldo Carvalho de Melo <acme@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: Stephane Eranian <eranian@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
LKML <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
mingo@kernel.org, acme@kernel.org
Subject: Re: [BUG] perf report: ordered events and flushing bug
Date: Thu, 12 Mar 2015 17:16:16 -0300 [thread overview]
Message-ID: <20150312201616.GB2301@redhat.com> (raw)
In-Reply-To: <5501EEB9.8000705@gmail.com>
Em Thu, Mar 12, 2015 at 01:53:29PM -0600, David Ahern escreveu:
> On 3/12/15 1:39 PM, Stephane Eranian wrote:
> >What the point of having all the ordered event logic if you are saying events
> >must be saved in order. I don't think there is a way to make that guarantee
> >when monitoring multiple CPUs at the same time.
>
> The record command does not analyze the events, it just copies from
> mmap to file in lumps per mmap. e.g., on a given round the perf data
> file has events like this:
>
> 111112223344444444555566666F111111111
> |<------- round --------->|^
> |
> finished round event -|
>
> where 11111 are events read from mmap1, 2222 are events from mmap2,
> etc. F is the finished round event which a pass over all mmaps has
> been done.
>
> So for mmap1 all of the 11111 events are in time order, then jumping
> to mmap2 events the 2222 times are time sorted relative to mmap2 but
> not relative to mmap1 events.
>
> The ordered events code sorts the clumps into a time based stream:
> 123141641445124564234645656...
And it does that because it merges all the mmap buffers into just one
file...
OK, for inserting MMAP events (or any other), I think one could either
use perf inject and merge two perf.data files, both in order, or add a
'perf data merge' subcommand to 'perf data', perhaps the later will be
useful in more cases.
But there is something else here, we should take advantage of the fact
that events in each perf mmap are ordered and keep that in the output of
perf record, i.e. we should start one thread per CPU that will just
write into a .perf.data/cpu-N file
Then, when reading, we will do what I'll do for 'trace' and 'top', i.e.
order the N cpus and go on processing in order, if you need that
(tracing, perf top perhaps).
Or do a first pass, get the lifetime events, aka the PERF_RECORD_
metadata, stash in the struct machine rbtrees, as usual, but keeping a
reference to all threadas, even the dead ones, which I guess is what
Namhyung does in some way in his patchkit, then go wild processing the
samples in parallel.
So, I think for Stephane, right now, the easiest path to follow is to
hack 'perf inject' to insert the MMAP events where he needs, right?
Agreed?
- Arnaldo
next prev parent reply other threads:[~2015-03-12 20:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-12 3:32 [BUG] perf report: ordered events and flushing bug Stephane Eranian
2015-03-12 7:57 ` Namhyung Kim
2015-03-12 9:02 ` Adrian Hunter
2015-03-12 19:05 ` Stephane Eranian
2015-03-12 19:13 ` David Ahern
2015-03-12 19:23 ` Stephane Eranian
2015-03-12 19:34 ` David Ahern
2015-03-12 19:39 ` Stephane Eranian
2015-03-12 19:53 ` David Ahern
2015-03-12 20:06 ` Stephane Eranian
2015-03-12 20:50 ` Arnaldo Carvalho de Melo
2015-03-16 1:11 ` Namhyung Kim
2015-03-12 20:16 ` Arnaldo Carvalho de Melo [this message]
2015-03-12 20:24 ` Stephane Eranian
2015-03-12 20:27 ` Adrian Hunter
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=20150312201616.GB2301@redhat.com \
--to=acme@redhat.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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