Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 199151
b: refs/heads/master
c: 44bf460
h: refs/heads/master
i:
  199149: 9004a8a
  199147: 384db87
  199143: 99c4cd2
  199135: b944a85
v: v3
  • Loading branch information
Arnaldo Carvalho de Melo committed May 24, 2010
1 parent 0a6f435 commit 78ee529
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c392c4c6dccf7c64c113b473c7eceedf25eddd51
refs/heads/master: 44bf460649a9b91f291176097e9d7e846e8c001e
13 changes: 11 additions & 2 deletions trunk/tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,7 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head)
struct map *map = self->ms.map;
struct dso *dso = map->dso;
char *filename = dso__build_id_filename(dso, NULL, 0);
bool free_filename = true;
char command[PATH_MAX * 2];
FILE *file;
int err = 0;
Expand All @@ -1001,11 +1002,19 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head)
sym->name);
return -ENOMEM;
}
goto fallback;
} else if (readlink(filename, command, sizeof(command)) < 0 ||
strstr(command, "[kernel.kallsyms]") ||
access(filename, R_OK)) {
free(filename);
fallback:
/*
* If we don't have build-ids, well, lets hope that this
* If we don't have build-ids or the build-id file isn't in the
* cache, or is just a kallsyms file, well, lets hope that this
* DSO is the same as when 'perf record' ran.
*/
filename = dso->long_name;
free_filename = false;
}

if (dso->origin == DSO__ORIG_KERNEL) {
Expand Down Expand Up @@ -1045,7 +1054,7 @@ int hist_entry__annotate(struct hist_entry *self, struct list_head *head)

pclose(file);
out_free_filename:
if (dso->has_build_id)
if (free_filename)
free(filename);
return err;
}
Expand Down

0 comments on commit 78ee529

Please sign in to comment.