Skip to content

Commit 361d134

Browse files
Dave Martinacmel
authored andcommitted
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>
1 parent 0f0cbf7 commit 361d134

3 files changed

Lines changed: 3 additions & 23 deletions

File tree

‎tools/perf/util/event.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ int event__process_mmap(event_t *self, struct perf_session *session)
517517
map = map__new(&machine->user_dsos, self->mmap.start,
518518
self->mmap.len, self->mmap.pgoff,
519519
self->mmap.pid, self->mmap.filename,
520-
MAP__FUNCTION, session->cwd, session->cwdlen);
520+
MAP__FUNCTION);
521521

522522
if (thread == NULL || map == NULL)
523523
goto out_problem;

‎tools/perf/util/map.c‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ static inline int is_anon_memory(const char *filename)
1717
return strcmp(filename, "//anon") == 0;
1818
}
1919

20-
static 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-
3020
void map__init(struct map *self, enum map_type type,
3121
u64 start, u64 end, u64 pgoff, struct dso *dso)
3222
{
@@ -43,7 +33,7 @@ void map__init(struct map *self, enum map_type type,
4333

4434
struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
4535
u64 pgoff, u32 pid, char *filename,
46-
enum map_type type, char *cwd, int cwdlen)
36+
enum map_type type)
4737
{
4838
struct map *self = malloc(sizeof(*self));
4939

@@ -52,16 +42,6 @@ struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
5242
struct dso *dso;
5343
int anon;
5444

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-
6545
anon = is_anon_memory(filename);
6646

6747
if (anon) {

‎tools/perf/util/map.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void map__init(struct map *self, enum map_type type,
106106
u64 start, u64 end, u64 pgoff, struct dso *dso);
107107
struct map *map__new(struct list_head *dsos__list, u64 start, u64 len,
108108
u64 pgoff, u32 pid, char *filename,
109-
enum map_type type, char *cwd, int cwdlen);
109+
enum map_type type);
110110
void map__delete(struct map *self);
111111
struct map *map__clone(struct map *self);
112112
int map__overlap(struct map *l, struct map *r);

0 commit comments

Comments
 (0)