aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-05-09 18:57:08 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-05-09 20:14:52 -0400
commit1f626bc36847ac8dd192f055aed0f9678a781313 (patch)
treed96b43c56217fb1ec7adaf4a9e12e11a61d0ce44 /tools/perf/util/event.c
parent4cc4945844fe2cf493f1783b6ce938ba1617d5c2 (diff)
perf session: Embed the host machine data on perf_session
We have just one host on a given session, and that is the most common setup right now, so embed a ->host_machine struct machine instance directly in the perf_session class, check if we're looking for it before going to the rb_tree. This also fixes a problem found when we try to process old perf.data files where we didn't have MMAP events for the kernel and modules and thus don't create the kernel maps, do it in event__preprocess_sample if it wasn't already. Reported-by: Ingo Molnar <mingo@elte.hu> Cc: Frédéric Weisbecker <fweisbec@gmail.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Tom Zanussi <tzanussi@gmail.com> Cc: Zhang, Yanmin <yanmin_zhang@linux.intel.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/event.c')
-rw-r--r--tools/perf/util/event.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index dfc8bf64d70f..d2ea9dd9fdf1 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -656,6 +656,16 @@ int event__preprocess_sample(const event_t *self, struct perf_session *session,
656 goto out_filtered; 656 goto out_filtered;
657 657
658 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid); 658 dump_printf(" ... thread: %s:%d\n", thread->comm, thread->pid);
659 /*
660 * Have we already created the kernel maps for the host machine?
661 *
662 * This should have happened earlier, when we processed the kernel MMAP
663 * events, but for older perf.data files there was no such thing, so do
664 * it now.
665 */
666 if (cpumode == PERF_RECORD_MISC_KERNEL &&
667 session->host_machine.vmlinux_maps[MAP__FUNCTION] == NULL)
668 machine__create_kernel_maps(&session->host_machine);
659 669
660 thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION, 670 thread__find_addr_map(thread, session, cpumode, MAP__FUNCTION,
661 self->ip.pid, self->ip.ip, al); 671 self->ip.pid, self->ip.ip, al);