2024-04-10 18:51:28

by Namhyung Kim

[permalink] [raw]
Subject: [PATCH] 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"
...

Signed-off-by: Namhyung Kim <[email protected]>
---
tools/perf/util/disasm.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
index a1219eb930aa..92937809be85 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);
--
2.44.0.478.gd926399ef9-goog



2024-04-10 19:26:53

by Ian Rogers

[permalink] [raw]
Subject: Re: [PATCH] perf annotate: Skip DSOs not found

On Wed, Apr 10, 2024 at 11:51 AM Namhyung Kim <[email protected]> wrote:
>
> 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"
> ...
>
> Signed-off-by: Namhyung Kim <[email protected]>

Perhaps: Closes:
https://lore.kernel.org/linux-perf-users/[email protected]/

Reviewed-by: Ian Rogers <[email protected]>

Thanks,
Ian


> ---
> tools/perf/util/disasm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/util/disasm.c b/tools/perf/util/disasm.c
> index a1219eb930aa..92937809be85 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);
> --
> 2.44.0.478.gd926399ef9-goog
>

2024-04-11 11:05:08

by Arnaldo Carvalho de Melo

[permalink] [raw]
Subject: Re: [PATCH] perf annotate: Skip DSOs not found

On Wed, Apr 10, 2024 at 12:14:37PM -0700, Ian Rogers wrote:
> On Wed, Apr 10, 2024 at 11:51 AM Namhyung Kim <[email protected]> wrote:
> >
> > 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"
> > ...
> >
> > Signed-off-by: Namhyung Kim <[email protected]>
>
> Perhaps: Closes:
> https://lore.kernel.org/linux-perf-users/[email protected]/

I added:

Closes: https://lore.kernel.org/linux-perf-users/[email protected]/
Reported-by: Konstantin Kharlamov <[email protected]>
Reviewed-by: Ian Rogers <[email protected]>
Signed-off-by: Namhyung Kim <[email protected]>
Tested-by: Konstantin Kharlamov <[email protected]>

> Reviewed-by: Ian Rogers <[email protected]>

Thanks,

- Arnaldo