Revert "perf record: Intercept all events"
Commit-ID: a8e6f734ce9a79d44ebb296f2a341f435227b34e Gitweb: http://git.kernel.org/tip/a8e6f734ce9a79d44ebb296f2a341f435227b34e Author: Hitoshi Mitake <[email protected]> AuthorDate: Sat, 30 Jan 2010 20:55:41 +0900 Committer: Ingo Molnar <[email protected]> CommitDate: Sun, 31 Jan 2010 08:27:52 +0100
Revert "perf record: Intercept all events"
This reverts commit f5a2c3dce03621b55f84496f58adc2d1a87ca16f.
This patch is required for making "perf lock rec" work. The commit f5a2c3dce0 changes write_event() of builtin-record.c . And changed write_event() sometimes doesn't stop with perf lock rec.
Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
LKML-Reference: <new-submission>
[ that commit also causes perf record to not be Ctrl-C-able,
and it's concetually wrong to parse the data at record time (unconditionally - even when not needed), as we eventually want to be able to do zero-copy recording, at least for non-archive recordings. ]
--- tools/perf/builtin-record.c | 28 ++++++++++------------------ 1 files changed, 10 insertions(+), 18 deletions(-)
tools/perf/builtin-record.c +10 -18
@@ -113,24 +113,16 @@ static void write_output(void *buf, size_t size)static void write_event (event_t *buf,size_t size) { -size_t processed_size = buf->header.size; -event_t *ev = buf; - -do { -/* -* Add it to the list of DSOs, so that when we finish this -* record session we can pick the available build-ids. -*/ -if (ev->header.type ==PERF_RECORD_MMAP ) { -struct list_head *head = &dsos__user; -if (ev->header.misc ==1 ) - head = &dsos__kernel; -__dsos__findnew (head, ev->mmap.filename); - } - - ev = ((void *)ev) + ev->header.size; - processed_size += ev->header.size; - }while (processed_size < size); +/* +* Add it to the list of DSOs, so that when we finish this +* record session we can pick the available build-ids. +*/ +if (buf->header.type ==PERF_RECORD_MMAP ) { +struct list_head *head = &dsos__user; +if (buf->mmap.header.misc ==1 ) + head = &dsos__kernel; +__dsos__findnew (head, buf->mmap.filename); + }write_output (buf, size); }