Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf annotate: Try chroot filename for objdump

Likewise, it should use a proper name in case the task runs under
chroot.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri 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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Namhyung Kim and committed by
Arnaldo Carvalho de Melo
40b0c5fd 75d48c56

+10
+10
tools/perf/util/annotate.c
··· 33 33 #include "string2.h" 34 34 #include "util/event.h" 35 35 #include "arch/common.h" 36 + #include "namespaces.h" 36 37 #include <regex.h> 37 38 #include <pthread.h> 38 39 #include <linux/bitops.h> ··· 1697 1696 * DSO is the same as when 'perf record' ran. 1698 1697 */ 1699 1698 __symbol__join_symfs(filename, filename_size, dso->long_name); 1699 + 1700 + if (access(filename, R_OK) && errno == ENOENT && dso->nsinfo) { 1701 + char *new_name = filename_with_chroot(dso->nsinfo->pid, 1702 + filename); 1703 + if (new_name) { 1704 + strlcpy(filename, new_name, filename_size); 1705 + free(new_name); 1706 + } 1707 + } 1700 1708 } 1701 1709 1702 1710 free(build_id_path);