Linux Perf Users
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: sashiko-reviews@lists.linux.dev
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 1/3] perf symbol: Fix symbol loading from libbfd
Date: Sat, 10 Oct 2026 12:00:01 -0700	[thread overview]
Message-ID: <asqLMeHEdlOHOfp9@z2> (raw)
In-Reply-To: <sashiko-outbox-166827@kernel.org>

On Sat, Oct 10, 2026 at 06:36:17PM +0000, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] perf test: pe-file-parsing breaks due to dso__load_bfd_symbols() return value change
> --
> 
> commit 5ad4f779ca47fdb7586a43ebe4942962c3038922
> Author: Namhyung Kim <namhyung@kernel.org>
> 
> perf symbol: Fix symbol loading from libbfd
> 
> This commit modifies dso__load_bfd_symbols() to return a positive number
> representing the number of loaded symbols instead of 0 on success. The caller
> in dso__load() is also updated to check for this positive return value.
> 
> Closes: https://lore.kernel.org/r/sashiko-outbox-162540@kernel.org
> Fixes: eac9a4342e5447cad ("perf symbols: Try reading the symbol table with libbfd")
> 
> > diff --git a/tools/perf/util/libbfd.c b/tools/perf/util/libbfd.c
> > index 33dc6158b2b1f..c2462b54b0e56 100644
> > --- a/tools/perf/util/libbfd.c
> > +++ b/tools/perf/util/libbfd.c
> > @@ -411,7 +411,7 @@ int dso__load_bfd_symbols(struct dso *dso, const char *debugfile)
> >  	symbols__fixup_duplicate(dso__symbols(dso));
> >  	dso__set_adjust_symbols(dso, true);
> >  
> > -	err = 0;
> > +	err = dso__has_symbols(dso);
> 
> [Severity: Medium]
> Does this change break the pe-file-parsing perf test?
> 
> Looking at the pe-file-parsing test in tools/perf/tests/pe-file-parsing.c
> inside run_dir(), it still expects the old 0 return value for success:
> 
>     ret = dso__load_bfd_symbols(dso, debugfile);
>     TEST_ASSERT_VAL("Failed to load symbols", ret == 0);
> 
> Since dso__has_symbols() evaluates to a positive number when symbols exist,
> won't this cause the test suite to unconditionally fail when analyzing valid
> PE files?

Oops, completely missed that.  Will update.

Thanks,
Namhyung

      reply	other threads:[~2026-10-10 19:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 18:24 [PATCH v2 1/3] perf symbol: Fix symbol loading from libbfd Namhyung Kim
2026-10-10 18:24 ` [PATCH v2 2/3] perf symbol: Add missing symsrc__destroy() for libbfd Namhyung Kim
2026-10-10 18:34   ` sashiko-bot
2026-10-10 19:01     ` Namhyung Kim
2026-10-10 18:24 ` [PATCH v2 3/3] perf symbol: Set dso symtab type " Namhyung Kim
2026-10-10 18:34   ` sashiko-bot
2026-10-10 19:02     ` Namhyung Kim
2026-10-10 18:36 ` [PATCH v2 1/3] perf symbol: Fix symbol loading from libbfd sashiko-bot
2026-10-10 19:00   ` Namhyung Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=asqLMeHEdlOHOfp9@z2 \
    --to=namhyung@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox