public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* perf: Timestamp COMM and MMAP events for correct attribution
@ 2010-11-23  5:35 Ian Munsie
  2010-11-23  5:35 ` [PATCH 1/6] perf: Display unknown rather than IP for unidentified DSO Ian Munsie
                   ` (6 more replies)
  0 siblings, 7 replies; 16+ messages in thread
From: Ian Munsie @ 2010-11-23  5:35 UTC (permalink / raw)
  To: linux-kernel

This patch series fixes a bug introduced with the per-task-per-cpu event
support in perf where PERF_RECORD_COMM and PERF_RECORD_MMAP events would arrive
and be recorded via one CPUs buffer much later than samples corresponding to
them arriving on another CPUs buffer, and would cause perf to mis-attribute
those events.

This has been observed on multiple systems, but is more common the more CPUs
present - on 64 CPU systems it is extremely common (one system tested occurred
~50% of the time, while another was >99%), while on my quad Intel i7 it is much
rarer (but I have observed it several times). Examining the data file with perf
report -D shows the COMM and MMAP events a long way through the file (80% or
more), well after many previous events.

This series introduces an ABI change to perf to add the timestamps to the MMAP
and COMM events so that they can be correlated with the samples corresponding
to them. The timestamps are requested from the kernel by setting the all_timed
bit in the attributes when opening the events and is placed just after the
event header of the events in question.

While not necessary to fix this bug (or any other AFAIK), I have also included
changes to the PERF_RECORD_READ and PERF_RECORD_LOST events to add the
timestamp in the same manner. This could be useful to support and if we did
eventually want to add it it would be easier to change all the events in
question at once. Those changes are in separate patches from the COMM and MMAP
changes so they can easily be dropped when merging this upstream if they are
unwanted.


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-11-30 14:02 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-23  5:35 perf: Timestamp COMM and MMAP events for correct attribution Ian Munsie
2010-11-23  5:35 ` [PATCH 1/6] perf: Display unknown rather than IP for unidentified DSO Ian Munsie
2010-11-23  5:35 ` [PATCH 2/6] perf: Move all output for perf report -D into trace_event Ian Munsie
2010-11-23  5:35 ` [PATCH 3/6] perf: Add timestamp to COMM and MMAP events Ian Munsie
2010-11-23 11:08   ` Peter Zijlstra
2010-11-23 12:41     ` Arnaldo Carvalho de Melo
2010-11-25 15:47       ` Arnaldo Carvalho de Melo
2010-11-26 21:54         ` Arnaldo Carvalho de Melo
2010-11-29  6:06         ` Ian Munsie
2010-11-29 11:54           ` Peter Zijlstra
2010-11-29 23:45             ` Ian Munsie
2010-11-30 14:02               ` Arnaldo Carvalho de Melo
2010-11-23  5:35 ` [PATCH 4/6] perf: Add timestamp to READ and LOST events Ian Munsie
2010-11-23  5:35 ` [PATCH 5/6] perf tool: Process COMM and MMAP events in order Ian Munsie
2010-11-23  5:35 ` [PATCH 6/6] perf tool: Process READ and LOST " Ian Munsie
2010-11-23  6:37 ` perf: Timestamp COMM and MMAP events for correct attribution Ian Munsie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox