aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-record.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-01-15 15:08:26 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-16 04:58:50 -0500
commitf5a2c3dce03621b55f84496f58adc2d1a87ca16f (patch)
tree6ff6fa2a20372b8b64b6fb14db15fffe37814585 /tools/perf/builtin-record.c
parent2c5851747bcf751908c02e253cb7582d342b4612 (diff)
perf record: Intercept all events
The event interception we need to do in 'perf record' to create a list of all DSOs in PERF_RECORD_MMAP events wasn't seeing all events, make sure that happens by checking size agains event_t->header.size. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> LKML-Reference: <1263586107-1756-1-git-send-email-acme@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r--tools/perf/builtin-record.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 614fa9a4c67..7bb9ca1b30f 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -113,16 +113,24 @@ static void write_output(void *buf, size_t size)
113 113
114static void write_event(event_t *buf, size_t size) 114static void write_event(event_t *buf, size_t size)
115{ 115{
116 /* 116 size_t processed_size = buf->header.size;
117 * Add it to the list of DSOs, so that when we finish this 117 event_t *ev = buf;
118 * record session we can pick the available build-ids. 118
119 */ 119 do {
120 if (buf->header.type == PERF_RECORD_MMAP) { 120 /*
121 struct list_head *head = &dsos__user; 121 * Add it to the list of DSOs, so that when we finish this
122 if (buf->mmap.header.misc == 1) 122 * record session we can pick the available build-ids.
123 head = &dsos__kernel; 123 */
124 __dsos__findnew(head, buf->mmap.filename); 124 if (ev->header.type == PERF_RECORD_MMAP) {
125 } 125 struct list_head *head = &dsos__user;
126 if (ev->header.misc == 1)
127 head = &dsos__kernel;
128 __dsos__findnew(head, ev->mmap.filename);
129 }
130
131 ev = ((void *)ev) + ev->header.size;
132 processed_size += ev->header.size;
133 } while (processed_size < size);
126 134
127 write_output(buf, size); 135 write_output(buf, size);
128} 136}