kernel-ark/tools
David Ahern 0479b8b9cf perf evlist: Make event_copy local to mmaps
I am getting segfaults *after* the time sorting of perf samples where
the event type is off the charts:

(gdb) bt
\#0  0x0807b1b2 in hists__inc_nr_events (hists=0x80a99c4, type=1163281902) at util/hist.c:1225
\#1  0x08070795 in perf_session_deliver_event (session=0x80a9b90, event=0xf7a6aff8, sample=0xffffc318, tool=0xffffc520,
    file_offset=0) at util/session.c:884
\#2  0x0806f9b9 in flush_sample_queue (s=0x80a9b90, tool=0xffffc520) at util/session.c:555
\#3  0x0806fc53 in process_finished_round (tool=0xffffc520, event=0x0, session=0x80a9b90) at util/session.c:645

This is bizarre because the event has already been processed once --
before it was added to the samples queue -- and the event was found to
be sane at that time.

There seem to be 2 causes:

1. perf_evlist__mmap_read updates the read location even though there
are outstanding references to events sitting in the mmap buffers via the
ordered samples queue.

2. There is a single evlist->event_copy for all evlist entries.
event_copy is used to handle an event wrapping at the mmap buffer
boundary.

This patch addresses the second problem - making event_copy local to
each perf_mmap. With this change my highly repeatable use case no longer
fails.

The first problem is much more complicated and will be the subject of a
future patch.

Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1360098762-61827-1-git-send-email-dsahern@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2013-02-06 18:09:26 -03:00
..
firewire tools/firewire: nosy-dump: check for allocation failure 2012-12-02 20:10:18 +01:00
hv tools/hv: Fix string types 2012-11-15 15:39:59 -08:00
include/tools tools/include: Add byteshift headers for endian access 2012-02-28 10:22:51 -08:00
lguest lguest: fix block request handling in example launcher. 2012-10-22 18:20:01 +10:30
lib/traceevent tools lib traceevent: Handle dynamic array's element size properly 2013-01-25 12:49:28 -03:00
nfsd NFSD: Added fault injection script 2011-11-07 21:10:47 -05:00
perf perf evlist: Make event_copy local to mmaps 2013-02-06 18:09:26 -03:00
power Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux 2012-12-18 12:34:29 -08:00
scripts tools: Pass the target in descend 2012-11-19 22:10:36 +00:00
testing selftests: IPC message queue copy feature test 2013-01-04 16:11:45 -08:00
usb tools/usb: remove last USBFS user 2012-09-10 11:10:37 -07:00
virtio Some nice cleanups, and even a patch my wife did as a "live" demo for 2012-12-20 08:37:05 -08:00
vm UAPI: fix tools/vm/page-types.c 2012-10-25 14:37:53 -07:00
Makefile tools: Correct typo in tools Makefile 2013-01-30 10:35:14 -03:00