Commit 40b0c5fd authored by Namhyung Kim's avatar Namhyung Kim Committed by Arnaldo Carvalho de Melo

perf annotate: Try chroot filename for objdump

Likewise, it should use a proper name in case the task runs under
chroot.
Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20220202070828.143303-5-namhyung@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 75d48c56
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "string2.h" #include "string2.h"
#include "util/event.h" #include "util/event.h"
#include "arch/common.h" #include "arch/common.h"
#include "namespaces.h"
#include <regex.h> #include <regex.h>
#include <pthread.h> #include <pthread.h>
#include <linux/bitops.h> #include <linux/bitops.h>
...@@ -1696,6 +1697,15 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil ...@@ -1696,6 +1697,15 @@ static int dso__disassemble_filename(struct dso *dso, char *filename, size_t fil
* DSO is the same as when 'perf record' ran. * DSO is the same as when 'perf record' ran.
*/ */
__symbol__join_symfs(filename, filename_size, dso->long_name); __symbol__join_symfs(filename, filename_size, dso->long_name);
if (access(filename, R_OK) && errno == ENOENT && dso->nsinfo) {
char *new_name = filename_with_chroot(dso->nsinfo->pid,
filename);
if (new_name) {
strlcpy(filename, new_name, filename_size);
free(new_name);
}
}
} }
free(build_id_path); free(build_id_path);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment