From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: sashiko-reviews@lists.linux.dev, linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2 3/8] perf tools: Check system path when check debuginfo
Date: Tue, 29 Sep 2026 20:48:18 +0200 [thread overview]
Message-ID: <arwH8oIlQNxsK2fO@x2> (raw)
In-Reply-To: <arwA36u1stwk0rkg@google.com>
On Tue, Sep 29, 2026 at 11:18:07AM -0700, Namhyung Kim wrote:
> On Tue, Sep 29, 2026 at 01:23:02AM +0000, sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [High] perf: skipping libdw fallback on stripped binaries breaks debuginfod
> > --
> >
> > commit b8cad86bb3e8eff20f4bbb18f568843350d829d9
> > Author: Namhyung Kim <namhyung@kernel.org>
> >
> > perf tools: Check system path when check debuginfo
> >
> > This commit refactors debuginfo__new() to check the system path via
> > dso__find_dbginfo_type() rather than using an explicit fallback. The new
> > approach adds DSO_BINARY_TYPE__SYSTEM_PATH_DSO to the debuginfo types list
> > and removes the fallback code in debuginfo__new().
> >
> > > diff --git a/tools/perf/util/debuginfo.c b/tools/perf/util/debuginfo.c
> > > index d6bd0fcc22648..2669d5f5ee612 100644
> > > --- a/tools/perf/util/debuginfo.c
> > > +++ b/tools/perf/util/debuginfo.c
> > [ ... ]
> > > @@ -114,18 +114,12 @@ struct debuginfo *debuginfo__new(const char *path)
> > > dso__find_dbginfo_type(dso);
> > > if (dso__read_binary_type_filename(dso, dso__dbginfo_type(dso), &nil,
> > > buf, PATH_MAX) < 0)
> > > - goto out;
> > > + return NULL;
> >
> > [Severity: High]
> > Does this skip the libdw fallback entirely for stripped binaries, which
> > could break remote debuginfo resolution via debuginfod?
> >
> > When running a tool like perf annotate on a stripped binary that lacks local
> > debuginfo files, dso__find_dbginfo_type() checks for debug sections:
> >
> > tools/perf/util/dso.c:dso__find_dbginfo_type() {
> > ...
> > if (filename__has_section(buf, ".debug_info") ||
> > filename__has_section(buf, ".zdebug_info"))
> > break;
> > ...
> > }
> >
> > Because stripped binaries fail this section check, their type is marked as
> > DSO_BINARY_TYPE__NOT_FOUND even when DSO_BINARY_TYPE__SYSTEM_PATH_DSO is
> > evaluated.
> >
> > This causes the dso__read_binary_type_filename() check in debuginfo__new()
> > to fail and return NULL early. By bypassing __debuginfo__new(), this
> > prevents libdw from invoking dwfl_standard_find_debuginfo() to remotely
> > resolve the debuginfo.
>
> I think this is what Arnaldo wanted to add. As we already have
s/wanted/wants/ :-)
> debuginfod support, I think it's better to check it explicitly with
> introducing DSO_BINARY_TYPE__DEBUGINFOD or so.
Unsure, I'll try to rebase my branch on top of what is being merged,
proably after LPC, we'll see.
If this is the only issue Sashiko found, I'll merge it.
- Arnaldo
> By checking sections, it would be independent from libdw support which
> may be useful for minimal systems that only uses external tools like
> addr2line.
next prev parent reply other threads:[~2026-09-29 18:48 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 1:11 [PATCH v2 0/8] perf tools: Cleanup dso debug info access Namhyung Kim
2026-09-29 1:11 ` [PATCH v2 1/8] perf tools: Add dso->dbginfo_type field Namhyung Kim
2026-09-29 1:18 ` sashiko-bot
2026-09-29 1:11 ` [PATCH v2 2/8] perf tools: Factor out dso__find_dbginfo_type() Namhyung Kim
2026-09-29 1:19 ` sashiko-bot
2026-09-29 1:11 ` [PATCH v2 3/8] perf tools: Check system path when check debuginfo Namhyung Kim
2026-09-29 1:23 ` sashiko-bot
2026-09-29 18:18 ` Namhyung Kim
2026-09-29 18:48 ` Arnaldo Carvalho de Melo [this message]
2026-09-29 1:11 ` [PATCH v2 4/8] perf tools: Export dso__get_filename() with type argument Namhyung Kim
2026-09-29 1:21 ` sashiko-bot
2026-09-29 1:11 ` [PATCH v2 5/8] perf tools: Add dso__put_filename() Namhyung Kim
2026-09-29 1:18 ` sashiko-bot
2026-09-29 1:11 ` [PATCH v2 6/8] perf tools: Avoid repeated failing search for debuginfo Namhyung Kim
2026-09-29 1:25 ` sashiko-bot
2026-09-29 1:11 ` [PATCH v2 7/8] perf tools: Looks symbol file first when check debuginfo Namhyung Kim
2026-09-29 1:27 ` sashiko-bot
2026-09-29 1:11 ` [PATCH v2 8/8] perf tools: Update debuginfo__new() to take DSO Namhyung Kim
2026-09-29 1:18 ` sashiko-bot
2026-09-29 23:58 ` Masami Hiramatsu
2026-09-29 18:58 ` [PATCH v2 0/8] perf tools: Cleanup dso debug info access Arnaldo Carvalho de Melo
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=arwH8oIlQNxsK2fO@x2 \
--to=acme@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=namhyung@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