Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v1 1/2] perf libdw: Pass dso_name explicitly to properly anchor split-debug builds
Date: Mon, 24 Aug 2026 06:37:13 +0000	[thread overview]
Message-ID: <20260824063714.685B31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260824062841.1529489-2-irogers@google.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] State caching bug in dso__libdw_dwfl ignores dso_name and breaks split-debug resolution.
- [Low] Missing __maybe_unused attribute on the dso_name parameter in the libdw__addr2line() fallback stub.
--

--- Patch [1]: [PATCH v1 1/2] perf libdw: Pass dso_name explicitly to properly anchor split-debug builds ---
commit d6c05f5d9fb09508b13daaab6b752a240e96edf3
Author: Ian Rogers <irogers@google.com>

perf libdw: Pass dso_name explicitly to properly anchor split-debug builds

This commit modifies libdw__addr2line and dso__libdw_dwfl to accept an explicit
dso_name parameter. It aims to accurately anchor libdw to the dynamically
discovered split-debug file instead of the stripped executable.

> diff --git a/tools/perf/util/libdw.c b/tools/perf/util/libdw.c
> index 4ca7e7e4fbe93..f53caee980b0b 100644
> --- a/tools/perf/util/libdw.c
> +++ b/tools/perf/util/libdw.c
> @@ -25,17 +25,17 @@ void dso__free_libdw(struct dso *dso)
>  	}
>  }
>  
> -struct Dwfl *dso__libdw_dwfl(struct dso *dso)
> +struct Dwfl *dso__libdw_dwfl(struct dso *dso, const char *dso_name)
>  {
>  	Dwfl *dwfl = dso__libdw(dso);
> -	const char *dso_name;
>  	Dwfl_Module *mod;
>  	int fd;
>  
>  	if (dwfl)
>  		return dwfl;

[Severity: Medium]
Does this early return prevent the newly passed dso_name from being used if a
Dwfl object is already cached?

For example, in tools/perf/arch/powerpc/util/skip-callchain-idx.c,
check_return_addr() calls:

    dwfl = dso__libdw_dwfl(dso, NULL);

This early call passes NULL for dso_name, which caches the stripped executable's
Dwfl. When get_srcline() later calls libdw__addr2line() with the newly
discovered split-debug file, won't this early return just provide the already
cached stripped executable's Dwfl and ignore the passed split-debug dso_name?

[ ... ]
> diff --git a/tools/perf/util/libdw.h b/tools/perf/util/libdw.h
> index b120947374159..4bdd28d44e25e 100644
> --- a/tools/perf/util/libdw.h
> +++ b/tools/perf/util/libdw.h
[ ... ]
> @@ -40,7 +40,8 @@ void dso__free_libdw(struct dso *dso);
>  
>  #else /* HAVE_LIBDW_SUPPORT */
>  
> -static inline int libdw__addr2line(u64 addr __maybe_unused, char **file __maybe_unused,
> +static inline int libdw__addr2line(const char *dso_name, u64 addr __maybe_unused,
> +				   char **file __maybe_unused,

[Severity: Low]
Will this cause a build failure when compiling with HAVE_LIBDW_SUPPORT disabled
(e.g., NO_LIBDW=1)? The fallback stub introduces the dso_name parameter but
doesn't use it, and lacks the __maybe_unused attribute present on the other
unused parameters in the same signature.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260824062841.1529489-1-irogers@google.com?part=1

  reply	other threads:[~2026-08-24  6:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24  6:28 [PATCH v1 0/2] perf libdw: Improve split-debug handling and error fallback Ian Rogers
2026-08-24  6:28 ` [PATCH v1 1/2] perf libdw: Pass dso_name explicitly to properly anchor split-debug builds Ian Rogers
2026-08-24  6:37   ` sashiko-bot [this message]
2026-08-24  6:28 ` [PATCH v1 2/2] perf libdw: Optimize fallback logic for missing DWARF Ian Rogers
2026-08-24  6:40   ` sashiko-bot

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=20260824063714.685B31F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=irogers@google.com \
    --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