aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2010-07-27 11:40:02 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-07-27 10:39:04 -0400
commit361d13462585474267a0c41e956f1a1c19a93f17 (patch)
tree75321c401c73da41ff4023547dbf17cede7ab294 /tools
parent0f0cbf7aa3d3460a3eb201a772326739a0c0210a (diff)
perf report: Don't abbreviate file paths relative to the cwd
This avoids around some problems where the full path is executables and DSOs it needed for finding debug symbols on platforms with separated debug symbol files such as Ubuntu. This is simpler than tracking an extra name for each image. The only impact should be that paths in verbose output from the perf tools become absolute, instead of relative to . LKML-Reference: <new-submission> Signed-off-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/event.c2
-rw-r--r--tools/perf/util/map.c22
-rw-r--r--tools/perf/util/map.h2
3 files changed, 3 insertions, 23 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c
index 121339f4360d..5b81bb29a07a 100644
--- a/tools/perf/util/event.c
+++ b/tools/perf/util/event.c
@@ -517,7 +517,7 @@ int event__process_mmap(event_t *self, struct perf_session *session)
517 map = map__new(&machine->user_dsos, self->mmap.start, 517 map = map__new(&machine->user_dsos, self->mmap.start,
518 self->mmap.len, self->mmap.pgoff, 518 self->mmap.len, self->mmap.pgoff,
519 self->mmap.pid, self->mmap.filename, 519 self->mmap.pid, self->mmap.filename,
520 MAP__FUNCTION, session->cwd, session->cwdlen); 520 MAP__FUNCTION);
521 521
522 if (thread == NULL || map == NULL) 522 if (thread == NULL || map == NULL)
523 goto out_problem; 523 goto out_problem;
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index e672f2fef65b..37cab9038538 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -17,16 +17,6 @@ static inline int is_anon_memory(const char *filename)
17 return strcmp(filename, "//anon") == 0; 17 return strcmp(filename, "//anon") == 0;
18} 18}
19 19
20static int strcommon(const char *pathname, char *cwd, int cwdlen)
21{
22 int n = 0;
23
24 while (n < cwdlen && pathname[n] == cwd[n])
25 ++n;
26
27 return n;
28}
29
30void map__init(struct map *self, enum map_type type, 20void map__init(struct map *self, enum map_type type,
31 u64 start, u64 end, u64 pgoff, struct dso *dso) 21 u64 start, u64 end, u64 pgoff, struct dso *dso)
32{ 22{
@@ -43,7 +33,7 @@ void map__init(struct map *self, enum map_type type,
43 33
44struct map *map__new(struct list_head *dsos__list, u64 start, u64 len, 34struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
45 u64 pgoff, u32 pid, char *filename, 35 u64 pgoff, u32 pid, char *filename,
46 enum map_type type, char *cwd, int cwdlen) 36 enum map_type type)
47{ 37{
48 struct map *self = malloc(sizeof(*self)); 38 struct map *self = malloc(sizeof(*self));
49 39
@@ -52,16 +42,6 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
52 struct dso *dso; 42 struct dso *dso;
53 int anon; 43 int anon;
54 44
55 if (cwd) {
56 int n = strcommon(filename, cwd, cwdlen);
57
58 if (n == cwdlen) {
59 snprintf(newfilename, sizeof(newfilename),
60 ".%s", filename + n);
61 filename = newfilename;
62 }
63 }
64
65 anon = is_anon_memory(filename); 45 anon = is_anon_memory(filename);
66 46
67 if (anon) { 47 if (anon) {
diff --git a/tools/perf/util/map.h b/tools/perf/util/map.h
index f39134512829..3b2f706c0ba2 100644
--- a/tools/perf/util/map.h
+++ b/tools/perf/util/map.h
@@ -106,7 +106,7 @@ void map__init(struct map *self, enum map_type type,
106 u64 start, u64 end, u64 pgoff, struct dso *dso); 106 u64 start, u64 end, u64 pgoff, struct dso *dso);
107struct map *map__new(struct list_head *dsos__list, u64 start, u64 len, 107struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
108 u64 pgoff, u32 pid, char *filename, 108 u64 pgoff, u32 pid, char *filename,
109 enum map_type type, char *cwd, int cwdlen); 109 enum map_type type);
110void map__delete(struct map *self); 110void map__delete(struct map *self);
111struct map *map__clone(struct map *self); 111struct map *map__clone(struct map *self);
112int map__overlap(struct map *l, struct map *r); 112int map__overlap(struct map *l, struct map *r);