perf session: Sort all events if ordered_samples=true
authorThomas Gleixner <tglx@linutronix.de>
Sun, 5 Dec 2010 13:32:55 +0000 (14:32 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 6 Dec 2010 17:43:00 +0000 (15:43 -0200)
commitcbf41645f35224798cb61641766e6a16e141ffe4
treeff7572097138f20921e52a4cce5b693e0314df9d
parente4e18d568b0e833c75c1f7833e1690cdde8f4d76
perf session: Sort all events if ordered_samples=true

Now that we have timestamps on FORK, EXIT, COMM, MMAP events we can
sort everything in time order. This fixes the following observed
problem:

mmap(file1) -> pagefault() -> munmap(file1)
mmap(file2) -> pagefault() -> munmap(file2)

Resulted in decoding both pagefaults in file2 because the file1 map
was already replaced by the file2 map when the map address was
identical.

With all events sorted we decode both pagefaults correctly.

Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ian Munsie <imunsie@au1.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
LKML-Reference: <alpine.LFD.2.00.1012051220450.2653@localhost6.localdomain6>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/session.c