mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-12 13:34:10 +08:00
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>
This commit is contained in:
parent
75d48c5670
commit
40b0c5fd24
@ -33,6 +33,7 @@
|
||||
#include "string2.h"
|
||||
#include "util/event.h"
|
||||
#include "arch/common.h"
|
||||
#include "namespaces.h"
|
||||
#include <regex.h>
|
||||
#include <pthread.h>
|
||||
#include <linux/bitops.h>
|
||||
@ -1696,6 +1697,15 @@ fallback:
|
||||
* DSO is the same as when 'perf record' ran.
|
||||
*/
|
||||
__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);
|
||||
|
Loading…
Reference in New Issue
Block a user