It was assuming that the cache was always available and also wasn't
checking if the file found in the build id cache was just a kallsyms
file, that is not supported by objdump for disassembly.
Reported-by: Ingo Molnar <mingo@elte.hu>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
struct map *map = self->ms.map;
struct dso *dso = map->dso;
char *filename = dso__build_id_filename(dso, NULL, 0);
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;
char command[PATH_MAX * 2];
FILE *file;
int err = 0;
sym->name);
return -ENOMEM;
}
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;
* DSO is the same as when 'perf record' ran.
*/
filename = dso->long_name;
}
if (dso->origin == DSO__ORIG_KERNEL) {
}
if (dso->origin == DSO__ORIG_KERNEL) {
pclose(file);
out_free_filename:
pclose(file);
out_free_filename:
free(filename);
return err;
}
free(filename);
return err;
}