aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r--tools/perf/util/map.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 76bdca640a9b..c4d55a0da2ea 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -104,11 +104,16 @@ void map__fixup_end(struct map *self)
104 104
105#define DSO__DELETED "(deleted)" 105#define DSO__DELETED "(deleted)"
106 106
107static int map__load(struct map *self, symbol_filter_t filter) 107int 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;
111 112
113 if (dso__loaded(self->dso, self->type))
114 return 0;
115
116 nr = dso__load(self->dso, self, session, filter);
112 if (nr < 0) { 117 if (nr < 0) {
113 if (self->dso->has_build_id) { 118 if (self->dso->has_build_id) {
114 char sbuild_id[BUILD_ID_SIZE * 2 + 1]; 119 char sbuild_id[BUILD_ID_SIZE * 2 + 1];
@@ -143,19 +148,20 @@ static int map__load(struct map *self, symbol_filter_t filter)
143 return 0; 148 return 0;
144} 149}
145 150
146struct symbol *map__find_symbol(struct map *self, u64 addr, 151struct symbol *map__find_symbol(struct map *self, struct perf_session *session,
147 symbol_filter_t filter) 152 u64 addr, symbol_filter_t filter)
148{ 153{
149 if (!dso__loaded(self->dso, self->type) && map__load(self, filter) < 0) 154 if (map__load(self, session, filter) < 0)
150 return NULL; 155 return NULL;
151 156
152 return dso__find_symbol(self->dso, self->type, addr); 157 return dso__find_symbol(self->dso, self->type, addr);
153} 158}
154 159
155struct symbol *map__find_symbol_by_name(struct map *self, const char *name, 160struct symbol *map__find_symbol_by_name(struct map *self, const char *name,
161 struct perf_session *session,
156 symbol_filter_t filter) 162 symbol_filter_t filter)
157{ 163{
158 if (!dso__loaded(self->dso, self->type) && map__load(self, filter) < 0) 164 if (map__load(self, session, filter) < 0)
159 return NULL; 165 return NULL;
160 166
161 if (!dso__sorted_by_name(self->dso, self->type)) 167 if (!dso__sorted_by_name(self->dso, self->type))