diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2009-12-13 16:50:29 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-12-14 10:57:17 -0500 |
commit | 4aa65636411ccb12f006a6ad593930655c445ff6 (patch) | |
tree | 0f494705a2a7631070a5372bb53f873684b001c2 /tools/perf/util/map.c | |
parent | b3165f414416a717f72a376720564012af5a2e01 (diff) |
perf session: Move kmaps to perf_session
There is still some more work to do to disentangle map creation
from DSO loading, but this happens only for the kernel, and for
the early adopters of perf diff, where this disentanglement
matters most, we'll be testing different kernels, so no problem
here.
Further clarification: right now we create the kernel maps for
the various modules and discontiguous kernel text maps when
loading the DSO, we should do it as a two step process, first
creating the maps, for multiple mappings with the same DSO
store, then doing the dso load just once, for the first hit on
one of the maps sharing this DSO backing store.
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-6-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r-- | tools/perf/util/map.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 76bdca640a9b..8b3dd467adb5 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -104,10 +104,11 @@ void map__fixup_end(struct map *self) | |||
104 | 104 | ||
105 | #define DSO__DELETED "(deleted)" | 105 | #define DSO__DELETED "(deleted)" |
106 | 106 | ||
107 | static int map__load(struct map *self, symbol_filter_t filter) | 107 | static int map__load(struct map *self, struct perf_session *session, |
108 | symbol_filter_t filter) | ||
108 | { | 109 | { |
109 | const char *name = self->dso->long_name; | 110 | const char *name = self->dso->long_name; |
110 | int nr = dso__load(self->dso, self, filter); | 111 | int nr = dso__load(self->dso, self, session, filter); |
111 | 112 | ||
112 | if (nr < 0) { | 113 | if (nr < 0) { |
113 | if (self->dso->has_build_id) { | 114 | if (self->dso->has_build_id) { |
@@ -143,19 +144,20 @@ static int map__load(struct map *self, symbol_filter_t filter) | |||
143 | return 0; | 144 | return 0; |
144 | } | 145 | } |
145 | 146 | ||
146 | struct symbol *map__find_symbol(struct map *self, u64 addr, | 147 | struct symbol *map__find_symbol(struct map *self, struct perf_session *session, |
147 | symbol_filter_t filter) | 148 | u64 addr, symbol_filter_t filter) |
148 | { | 149 | { |
149 | if (!dso__loaded(self->dso, self->type) && map__load(self, filter) < 0) | 150 | if (!dso__loaded(self->dso, self->type) && map__load(self, session, filter) < 0) |
150 | return NULL; | 151 | return NULL; |
151 | 152 | ||
152 | return dso__find_symbol(self->dso, self->type, addr); | 153 | return dso__find_symbol(self->dso, self->type, addr); |
153 | } | 154 | } |
154 | 155 | ||
155 | struct symbol *map__find_symbol_by_name(struct map *self, const char *name, | 156 | struct symbol *map__find_symbol_by_name(struct map *self, const char *name, |
157 | struct perf_session *session, | ||
156 | symbol_filter_t filter) | 158 | symbol_filter_t filter) |
157 | { | 159 | { |
158 | if (!dso__loaded(self->dso, self->type) && map__load(self, filter) < 0) | 160 | if (!dso__loaded(self->dso, self->type) && map__load(self, session, filter) < 0) |
159 | return NULL; | 161 | return NULL; |
160 | 162 | ||
161 | if (!dso__sorted_by_name(self->dso, self->type)) | 163 | if (!dso__sorted_by_name(self->dso, self->type)) |