aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/map.c13
-rw-r--r--tools/perf/util/map.h1
-rw-r--r--tools/perf/util/session.c1
3 files changed, 15 insertions, 0 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 8668569d4b2a..16d783d322b6 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -729,3 +729,16 @@ char *machine__mmap_name(struct machine *self, char *bf, size_t size)
729 729
730 return bf; 730 return bf;
731} 731}
732
733void machines__set_id_hdr_size(struct rb_root *machines, u16 id_hdr_size)
734{
735 struct rb_node *node;
736 struct machine *machine;
737
738 for (node = rb_first(machines); node; node = rb_next(node)) {
739 machine = rb_entry(node, struct machine, rb_node);
740 machine->id_hdr_size = id_hdr_size;
741 }
742
743 return;
744}
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index c14c665d9a25..03a1e9b08b21 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -151,6 +151,7 @@ struct machine *machines__add(struct rb_root *self, pid_t pid,
151struct machine *machines__find_host(struct rb_root *self); 151struct machine *machines__find_host(struct rb_root *self);
152struct machine *machines__find(struct rb_root *self, pid_t pid); 152struct machine *machines__find(struct rb_root *self, pid_t pid);
153struct machine *machines__findnew(struct rb_root *self, pid_t pid); 153struct machine *machines__findnew(struct rb_root *self, pid_t pid);
154void machines__set_id_hdr_size(struct rb_root *self, u16 id_hdr_size);
154char *machine__mmap_name(struct machine *self, char *bf, size_t size); 155char *machine__mmap_name(struct machine *self, char *bf, size_t size);
155int machine__init(struct machine *self, const char *root_dir, pid_t pid); 156int machine__init(struct machine *self, const char *root_dir, pid_t pid);
156void machine__exit(struct machine *self); 157void machine__exit(struct machine *self);
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 90ee39dd8ab2..8e4f0755d2aa 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -87,6 +87,7 @@ void perf_session__update_sample_type(struct perf_session *self)
87 self->sample_id_all = perf_evlist__sample_id_all(self->evlist); 87 self->sample_id_all = perf_evlist__sample_id_all(self->evlist);
88 self->id_hdr_size = perf_evlist__id_hdr_size(self->evlist); 88 self->id_hdr_size = perf_evlist__id_hdr_size(self->evlist);
89 self->host_machine.id_hdr_size = self->id_hdr_size; 89 self->host_machine.id_hdr_size = self->id_hdr_size;
90 machines__set_id_hdr_size(&self->machines, self->id_hdr_size);
90} 91}
91 92
92int perf_session__create_kernel_maps(struct perf_session *self) 93int perf_session__create_kernel_maps(struct perf_session *self)