summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/map.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2009-11-27 19:29:16 +0100
committerIngo Molnar <mingo@elte.hu>2009-11-27 20:21:59 +0100
commit3610583c29563e23dd038d2870f59c88438bf7a3 (patch)
treecb8d20387bcc8e37b0db2432f339387a4fd52150 /tools/perf/util/map.c
parentperf symbols: Unexport kernel_map__functions (diff)
downloadlinux-3610583c29563e23dd038d2870f59c88438bf7a3.tar.xz
linux-3610583c29563e23dd038d2870f59c88438bf7a3.zip
perf symbols: Add a 'type' field to struct map
That way we will be able to check if the right symtab is loaded in the underlying DSO. 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: <1259346563-12568-5-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.c12
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)
return n;
}
-void map__init(struct map *self, u64 start, u64 end, u64 pgoff,
- struct dso *dso)
+void map__init(struct map *self, enum map_type type,
+ u64 start, u64 end, u64 pgoff, struct dso *dso)
{
+ self->type = type;
self->start = start;
self->end = end;
self->pgoff = pgoff;
@@ -32,7 +33,8 @@ void map__init(struct map *self, u64 start, u64 end, u64 pgoff,
RB_CLEAR_NODE(&self->rb_node);
}
-struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen)
+struct map *map__new(struct mmap_event *event, enum map_type type,
+ char *cwd, int cwdlen)
{
struct map *self = malloc(sizeof(*self));
@@ -63,7 +65,7 @@ struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen)
if (dso == NULL)
goto out_delete;
- map__init(self, event->start, event->start + event->len,
+ map__init(self, type, event->start, event->start + event->len,
event->pgoff, dso);
if (self->dso == vdso || anon)
@@ -103,7 +105,7 @@ void map__fixup_end(struct map *self, struct rb_root *symbols)
struct symbol *map__find_function(struct map *self, u64 ip,
symbol_filter_t filter)
{
- if (!self->dso->loaded) {
+ if (!dso__loaded(self->dso, self->type)) {
int nr = dso__load(self->dso, self, filter);
if (nr < 0) {