Skip to content

Commit

Permalink
perf report: Don't abbreviate file paths relative to the cwd
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
Dave Martin authored and acmel committed Jul 27, 2010
1 parent 0f0cbf7 commit 361d134
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion tools/perf/util/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
22 changes: 1 addition & 21 deletions tools/perf/util/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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));

Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/util/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 361d134

Please sign in to comment.