diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-13 16:50:28 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-14 10:57:16 -0500 |
commit | b3165f414416a717f72a376720564012af5a2e01 (patch) | |
tree | b066e4ae00b7d4bdb7386f4054e6e3ace0b976c3 /tools/perf/util/event.c | |
parent | ec913369733923dbfd6bdff5953a918107059701 (diff) |
perf session: Move the global threads list to perf_session
So that we can process two perf.data files.
We still need to add a O_MMAP mode for perf_session so that we
can do all the mmap stuff in it.
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: <1260741029-4430-5-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r-- | tools/perf/util/event.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 40d8d842a21f..2d09c29b3a6c 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -189,9 +189,9 @@ void event__synthesize_threads(int (*process)(event_t *event, | |||
189 | 189 | ||
190 | struct events_stats event__stats; | 190 | struct events_stats event__stats; |
191 | 191 | ||
192 | int event__process_comm(event_t *self, struct perf_session *session __used) | 192 | int event__process_comm(event_t *self, struct perf_session *session) |
193 | { | 193 | { |
194 | struct thread *thread = threads__findnew(self->comm.pid); | 194 | struct thread *thread = perf_session__findnew(session, self->comm.pid); |
195 | 195 | ||
196 | dump_printf(": %s:%d\n", self->comm.comm, self->comm.pid); | 196 | dump_printf(": %s:%d\n", self->comm.comm, self->comm.pid); |
197 | 197 | ||
@@ -212,7 +212,7 @@ int event__process_lost(event_t *self, struct perf_session *session __used) | |||
212 | 212 | ||
213 | int event__process_mmap(event_t *self, struct perf_session *session) | 213 | int event__process_mmap(event_t *self, struct perf_session *session) |
214 | { | 214 | { |
215 | struct thread *thread = threads__findnew(self->mmap.pid); | 215 | struct thread *thread = perf_session__findnew(session, self->mmap.pid); |
216 | struct map *map = map__new(&self->mmap, MAP__FUNCTION, | 216 | struct map *map = map__new(&self->mmap, MAP__FUNCTION, |
217 | session->cwd, session->cwdlen); | 217 | session->cwd, session->cwdlen); |
218 | 218 | ||
@@ -231,10 +231,10 @@ int event__process_mmap(event_t *self, struct perf_session *session) | |||
231 | return 0; | 231 | return 0; |
232 | } | 232 | } |
233 | 233 | ||
234 | int event__process_task(event_t *self, struct perf_session *session __used) | 234 | int event__process_task(event_t *self, struct perf_session *session) |
235 | { | 235 | { |
236 | struct thread *thread = threads__findnew(self->fork.pid); | 236 | struct thread *thread = perf_session__findnew(session, self->fork.pid); |
237 | struct thread *parent = threads__findnew(self->fork.ppid); | 237 | struct thread *parent = perf_session__findnew(session, self->fork.ppid); |
238 | 238 | ||
239 | dump_printf("(%d:%d):(%d:%d)\n", self->fork.pid, self->fork.tid, | 239 | dump_printf("(%d:%d):(%d:%d)\n", self->fork.pid, self->fork.tid, |
240 | self->fork.ppid, self->fork.ptid); | 240 | self->fork.ppid, self->fork.ptid); |
@@ -300,11 +300,11 @@ try_again: | |||
300 | } | 300 | } |
301 | } | 301 | } |
302 | 302 | ||
303 | int event__preprocess_sample(const event_t *self, struct addr_location *al, | 303 | int event__preprocess_sample(const event_t *self, struct perf_session *session, |
304 | symbol_filter_t filter) | 304 | struct addr_location *al, symbol_filter_t filter) |
305 | { | 305 | { |
306 | u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; | 306 | u8 cpumode = self->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; |
307 | struct thread *thread = threads__findnew(self->ip.pid); | 307 | struct thread *thread = perf_session__findnew(session, self->ip.pid); |
308 | 308 | ||
309 | if (thread == NULL) | 309 | if (thread == NULL) |
310 | return -1; | 310 | return -1; |