diff options
Diffstat (limited to 'tools/perf/util/map.c')
-rw-r--r-- | tools/perf/util/map.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c index 41c5c4a20010..52bb4c6cf74d 100644 --- a/tools/perf/util/map.c +++ b/tools/perf/util/map.c | |||
@@ -20,9 +20,10 @@ static int strcommon(const char *pathname, char *cwd, int cwdlen) | |||
20 | return n; | 20 | return n; |
21 | } | 21 | } |
22 | 22 | ||
23 | void map__init(struct map *self, u64 start, u64 end, u64 pgoff, | 23 | void map__init(struct map *self, enum map_type type, |
24 | struct dso *dso) | 24 | u64 start, u64 end, u64 pgoff, struct dso *dso) |
25 | { | 25 | { |
26 | self->type = type; | ||
26 | self->start = start; | 27 | self->start = start; |
27 | self->end = end; | 28 | self->end = end; |
28 | self->pgoff = pgoff; | 29 | self->pgoff = pgoff; |
@@ -32,7 +33,8 @@ void map__init(struct map *self, u64 start, u64 end, u64 pgoff, | |||
32 | RB_CLEAR_NODE(&self->rb_node); | 33 | RB_CLEAR_NODE(&self->rb_node); |
33 | } | 34 | } |
34 | 35 | ||
35 | struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen) | 36 | struct map *map__new(struct mmap_event *event, enum map_type type, |
37 | char *cwd, int cwdlen) | ||
36 | { | 38 | { |
37 | struct map *self = malloc(sizeof(*self)); | 39 | struct map *self = malloc(sizeof(*self)); |
38 | 40 | ||
@@ -63,7 +65,7 @@ struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen) | |||
63 | if (dso == NULL) | 65 | if (dso == NULL) |
64 | goto out_delete; | 66 | goto out_delete; |
65 | 67 | ||
66 | map__init(self, event->start, event->start + event->len, | 68 | map__init(self, type, event->start, event->start + event->len, |
67 | event->pgoff, dso); | 69 | event->pgoff, dso); |
68 | 70 | ||
69 | if (self->dso == vdso || anon) | 71 | if (self->dso == vdso || anon) |
@@ -103,7 +105,7 @@ void map__fixup_end(struct map *self, struct rb_root *symbols) | |||
103 | struct symbol *map__find_function(struct map *self, u64 ip, | 105 | struct symbol *map__find_function(struct map *self, u64 ip, |
104 | symbol_filter_t filter) | 106 | symbol_filter_t filter) |
105 | { | 107 | { |
106 | if (!self->dso->loaded) { | 108 | if (!dso__loaded(self->dso, self->type)) { |
107 | int nr = dso__load(self->dso, self, filter); | 109 | int nr = dso__load(self->dso, self, filter); |
108 | 110 | ||
109 | if (nr < 0) { | 111 | if (nr < 0) { |