]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
perf report: Don't abbreviate file paths relative to the cwd
authorDave Martin <dave.martin@linaro.org>
Tue, 27 Jul 2010 15:40:02 +0000 (16:40 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 27 Jul 2010 14:39:04 +0000 (11:39 -0300)
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>
tools/perf/util/event.c
tools/perf/util/map.c
tools/perf/util/map.h

index 121339f4360dd6655af0a37f441e2885fda68ce1..5b81bb29a07a8fadbe68c882cf876fe3eee0be92 100644 (file)
@@ -517,7 +517,7 @@ int event__process_mmap(event_t *self, struct perf_session *session)
        map = map__new(&machine->user_dsos, self->mmap.start,
                        self->mmap.len, self->mmap.pgoff,
                        self->mmap.pid, self->mmap.filename,
-                       MAP__FUNCTION, session->cwd, session->cwdlen);
+                       MAP__FUNCTION);
 
        if (thread == NULL || map == NULL)
                goto out_problem;
index e672f2fef65baaf62dd20d869bca33e027c1cfe6..37cab9038538fdf252ae33800d37d2941fc8fcf5 100644 (file)
@@ -17,16 +17,6 @@ static inline int is_anon_memory(const char *filename)
        return strcmp(filename, "//anon") == 0;
 }
 
-static int strcommon(const char *pathname, char *cwd, int cwdlen)
-{
-       int n = 0;
-
-       while (n < cwdlen && pathname[n] == cwd[n])
-               ++n;
-
-       return n;
-}
-
 void map__init(struct map *self, enum map_type type,
               u64 start, u64 end, u64 pgoff, struct dso *dso)
 {
@@ -43,7 +33,7 @@ void map__init(struct map *self, enum map_type type,
 
 struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
                     u64 pgoff, u32 pid, char *filename,
-                    enum map_type type, char *cwd, int cwdlen)
+                    enum map_type type)
 {
        struct map *self = malloc(sizeof(*self));
 
@@ -52,16 +42,6 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
                struct dso *dso;
                int anon;
 
-               if (cwd) {
-                       int n = strcommon(filename, cwd, cwdlen);
-
-                       if (n == cwdlen) {
-                               snprintf(newfilename, sizeof(newfilename),
-                                        ".%s", filename + n);
-                               filename = newfilename;
-                       }
-               }
-
                anon = is_anon_memory(filename);
 
                if (anon) {
index f39134512829c89c48662996d6a1a75f5d41deed..3b2f706c0ba2f14353ccca780cc915882e9a2c82 100644 (file)
@@ -106,7 +106,7 @@ void map__init(struct map *self, enum map_type type,
               u64 start, u64 end, u64 pgoff, struct dso *dso);
 struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
                     u64 pgoff, u32 pid, char *filename,
-                    enum map_type type, char *cwd, int cwdlen);
+                    enum map_type type);
 void map__delete(struct map *self);
 struct map *map__clone(struct map *self);
 int map__overlap(struct map *l, struct map *r);