From: Namhyung Kim Date: Wed, 10 Apr 2024 18:51:17 +0000 (-0700) Subject: perf annotate: Skip DSOs not found X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=873a83731f1cc85c8427fdc7a9e24fb270faca44;p=linux.git perf annotate: Skip DSOs not found In some data file, I see the following messages repeated. It seems it doesn't have DSOs in the system and the dso->binary_type is set to DSO_BINARY_TYPE__NOT_FOUND. Let's skip them to avoid the followings. No output from objdump --start-address=0x0000000000000000 --stop-address=0x00000000000000d4 -d --no-show-raw-insn -C "$1" Error running objdump --start-address=0x0000000000000000 --stop-address=0x0000000000000631 -d --no-show-raw-insn -C "$1" ... Closes: https://lore.kernel.org/linux-perf-users/15e1a2847b8cebab4de57fc68e033086aa6980ce.camel@yandex.ru/ Reported-by: Konstantin Kharlamov Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Tested-by: Konstantin Kharlamov Cc: Adrian Hunter Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20240410185117.1987239-1-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c index a1219eb930aae..92937809be85a 100644 --- a/tools/perf/util/disasm.c +++ b/tools/perf/util/disasm.c @@ -1669,6 +1669,8 @@ int symbol__disassemble(struct symbol *sym, struct annotate_args *args) return symbol__disassemble_bpf(sym, args); } else if (dso->binary_type == DSO_BINARY_TYPE__BPF_IMAGE) { return symbol__disassemble_bpf_image(sym, args); + } else if (dso->binary_type == DSO_BINARY_TYPE__NOT_FOUND) { + return -1; } else if (dso__is_kcore(dso)) { kce.kcore_filename = symfs_filename; kce.addr = map__rip_2objdump(map, sym->start);