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.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 804e02382739..c1c556825343 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -3,6 +3,7 @@
3#include <stdlib.h> 3#include <stdlib.h>
4#include <string.h> 4#include <string.h>
5#include <stdio.h> 5#include <stdio.h>
6#include "debug.h"
6 7
7static inline int is_anon_memory(const char *filename) 8static inline int is_anon_memory(const char *filename)
8{ 9{
@@ -19,7 +20,8 @@ static int strcommon(const char *pathname, char *cwd, int cwdlen)
19 return n; 20 return n;
20} 21}
21 22
22 struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen) 23struct map *map__new(struct mmap_event *event, char *cwd, int cwdlen,
24 unsigned int sym_priv_size, symbol_filter_t filter)
23{ 25{
24 struct map *self = malloc(sizeof(*self)); 26 struct map *self = malloc(sizeof(*self));
25 27
@@ -27,6 +29,7 @@ static int strcommon(const char *pathname, char *cwd, int cwdlen)
27 const char *filename = event->filename; 29 const char *filename = event->filename;
28 char newfilename[PATH_MAX]; 30 char newfilename[PATH_MAX];
29 int anon; 31 int anon;
32 bool new_dso;
30 33
31 if (cwd) { 34 if (cwd) {
32 int n = strcommon(filename, cwd, cwdlen); 35 int n = strcommon(filename, cwd, cwdlen);
@@ -49,14 +52,29 @@ static int strcommon(const char *pathname, char *cwd, int cwdlen)
49 self->end = event->start + event->len; 52 self->end = event->start + event->len;
50 self->pgoff = event->pgoff; 53 self->pgoff = event->pgoff;
51 54
52 self->dso = dsos__findnew(filename); 55 self->dso = dsos__findnew(filename, sym_priv_size, &new_dso);
53 if (self->dso == NULL) 56 if (self->dso == NULL)
54 goto out_delete; 57 goto out_delete;
55 58
59 if (new_dso) {
60 int nr = dso__load(self->dso, self, filter);
61
62 if (nr < 0)
63 pr_warning("Failed to open %s, continuing "
64 "without symbols\n",
65 self->dso->long_name);
66 else if (nr == 0)
67 pr_warning("No symbols found in %s, maybe "
68 "install a debug package?\n",
69 self->dso->long_name);
70 }
71
56 if (self->dso == vdso || anon) 72 if (self->dso == vdso || anon)
57 self->map_ip = vdso__map_ip; 73 self->map_ip = self->unmap_ip = identity__map_ip;
58 else 74 else {
59 self->map_ip = map__map_ip; 75 self->map_ip = map__map_ip;
76 self->unmap_ip = map__unmap_ip;
77 }
60 } 78 }
61 return self; 79 return self;
62out_delete: 80out_delete: