* [PATCH 4/4] perf report: Fix return value when loading PE DSO
@ 2021-02-10 19:18 Nicholas Fraser
2021-02-12 12:34 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Fraser @ 2021-02-10 19:18 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
Ian Rogers, Frank Ch. Eigler, Song Liu, Adrian Hunter,
Kim Phillips, Tommi Rantala, Remi Bernon, linux-kernel
Cc: Ulrich Czekalla, Huw Davies
The first time dso__load() was called on a PE file it always returned -1
error. This caused the first call to map__find_symbol() to always fail
on a PE file so the first sample from each PE file always had symbol
<unknown>. Subsequent samples succeed however because the DSO is already
loaded.
This fixes dso__load() to return 0 when successfully loading a DSO with
libbfd.
Signed-off-by: Nicholas Fraser <nfraser@codeweavers.com>
---
tools/perf/util/symbol.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index aa9ae875b995..492c873713cc 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1861,8 +1861,10 @@ int dso__load(struct dso *dso, struct map *map)
if (nsexit)
nsinfo__mountns_enter(dso->nsinfo, &nsc);
- if (bfdrc == 0)
+ if (bfdrc == 0) {
+ ret = 0;
break;
+ }
if (!is_reg || sirc < 0)
continue;
--
2.30.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 4/4] perf report: Fix return value when loading PE DSO
2021-02-10 19:18 [PATCH 4/4] perf report: Fix return value when loading PE DSO Nicholas Fraser
@ 2021-02-12 12:34 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 2+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-02-12 12:34 UTC (permalink / raw)
To: Nicholas Fraser
Cc: Peter Zijlstra, Ingo Molnar, Mark Rutland, Alexander Shishkin,
Jiri Olsa, Namhyung Kim, Ian Rogers, Frank Ch. Eigler, Song Liu,
Adrian Hunter, Kim Phillips, Tommi Rantala, Remi Bernon,
linux-kernel, Ulrich Czekalla, Huw Davies
Em Wed, Feb 10, 2021 at 02:18:02PM -0500, Nicholas Fraser escreveu:
> The first time dso__load() was called on a PE file it always returned -1
> error. This caused the first call to map__find_symbol() to always fail
> on a PE file so the first sample from each PE file always had symbol
> <unknown>. Subsequent samples succeed however because the DSO is already
> loaded.
>
> This fixes dso__load() to return 0 when successfully loading a DSO with
> libbfd.
You forgot to add this:
Fixes: eac9a4342e5447ca ("perf symbols: Try reading the symbol table with libbfd")
This helps, for instance, the stable@kernel.org guys, since their
scripts will scrape this and find that it should also go to whatever
stable releases are based on:
$ git tag --contains eac9a4342e5447ca | grep ^v[45].* | grep -v -- -rc
v5.10
$
Applied and added the Fixes tag,
- Arnaldo
> Signed-off-by: Nicholas Fraser <nfraser@codeweavers.com>
> ---
> tools/perf/util/symbol.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
> index aa9ae875b995..492c873713cc 100644
> --- a/tools/perf/util/symbol.c
> +++ b/tools/perf/util/symbol.c
> @@ -1861,8 +1861,10 @@ int dso__load(struct dso *dso, struct map *map)
> if (nsexit)
> nsinfo__mountns_enter(dso->nsinfo, &nsc);
>
> - if (bfdrc == 0)
> + if (bfdrc == 0) {
> + ret = 0;
> break;
> + }
>
> if (!is_reg || sirc < 0)
> continue;
> --
> 2.30.0
>
--
- Arnaldo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-12 12:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10 19:18 [PATCH 4/4] perf report: Fix return value when loading PE DSO Nicholas Fraser
2021-02-12 12:34 ` Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox