[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1291637998-sup-4601@au1.ibm.com>
Date: Mon, 06 Dec 2010 23:42:16 +1100
From: Ian Munsie <imunsie@....ibm.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Arnaldo Carvalho de Melo <acme@...stprotocols.net>,
Ingo Molnar <mingo@...e.hu>,
Frederic Weisbecker <fweisbec@...il.com>,
Mike Galbraith <efault@....de>,
Paul Mackerras <paulus@...ba.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH 3/3] perf record/report: Process events in order
Excerpts from Thomas Gleixner's message of Mon Dec 06 20:20:06 +1100 2010:
> See https://lkml.org/lkml/2010/12/5/45
>
> Slightly different, but the same idea :)
Yeah I noted that in my cover email. I meant to get my patches out
before the weekend, but hadn't quite finished cleaning them up to ensure
they didn't break perf when running on a kernel without sample_id_all.
> > + case PERF_RECORD_HEADER_ATTR:
> > + return ops->attr(event, s);
> > + case PERF_RECORD_HEADER_EVENT_TYPE:
> > + return ops->event_type(event, s);
> > + case PERF_RECORD_HEADER_TRACING_DATA:
> > + return ops->tracing_data(event, s);
> > + case PERF_RECORD_HEADER_BUILD_ID:
> > + return ops->build_id(event, s);
>
> These can be processed unordered.
I just moved them into this routine to keep all the dispatching in one
place, whether delayed or not. These particular events will still be
processed immediately when encountered in the file. Only >=
PERF_RECORD_MMAP && <= PERF_RECORD_SAMPLE will be delayed via the
perf_session__process_timed function.
> > + case PERF_RECORD_FINISHED_ROUND:
> > + return ops->finished_round(event, s, ops);
>
> You don't want to delay this unless you have unlimited memory. See my
> patch.
As above, this is not delayed.
> > {
> > + if (ops->ordered_samples && sample->time == -1ULL) {
> > + dump_printf("Event missing timestamp, switching to unordered processing\n");
> > + flush_sample_queue(s, ops);
> > + ops->ordered_samples = false;
>
> Why ? The events injected by perf record itself have no timestamps and
> do not need them. So why disabling ordered_samples ?
For instance, suppose we ran this on an old kernel without support for
timestamps on every event (so timestamps are only on sample events):
perf record -T
perf report
If perf report tried to process the events in order, all the events
without timestamps would be processed first -- including the
PERF_RECORD_EXIT event, which would cause every sample not to be
attributed. Falling back means we should get no worse than the old
behaviour, while an upgraded kernel will provide the timestamps and
should not fall back.
Cheers,
-Ian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists