aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.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/session.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/session.c')
-rw-r--r--tools/perf/util/session.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 5d353e70fe26..71bc608e0ec6 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -100,6 +100,7 @@ struct perf_session *perf_session__new(const char *filename, int mode, bool forc
100 self->repipe = repipe; 100 self->repipe = repipe;
101 self->ordered_samples.flush_limit = ULLONG_MAX; 101 self->ordered_samples.flush_limit = ULLONG_MAX;
102 INIT_LIST_HEAD(&self->ordered_samples.samples_head); 102 INIT_LIST_HEAD(&self->ordered_samples.samples_head);
103 machine__init(&self->host_machine, "", HOST_KERNEL_ID);
103 104
104 if (mode == O_RDONLY) { 105 if (mode == O_RDONLY) {
105 if (perf_session__open(self, force) < 0) 106 if (perf_session__open(self, force) < 0)
@@ -870,3 +871,10 @@ int perf_session__set_kallsyms_ref_reloc_sym(struct map **maps,
870 871
871 return 0; 872 return 0;
872} 873}
874
875size_t perf_session__fprintf_dsos(struct perf_session *self, FILE *fp)
876{
877 return __dsos__fprintf(&self->host_machine.kernel_dsos, fp) +
878 __dsos__fprintf(&self->host_machine.user_dsos, fp) +
879 machines__fprintf_dsos(&self->machines, fp);
880}