From: tshah <tshah@linux.ibm.com>
To: sashiko@lists.linux.dev
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf dso: Fix kallsyms DSO detection with fallback logic
Date: Wed, 15 Apr 2026 12:26:40 +0530 [thread overview]
Message-ID: <157c4ffb-0d81-4394-bea5-12a9b8f08307@linux.ibm.com> (raw)
In-Reply-To: <20260410081724.69B1EC19421@smtp.kernel.org>
Thanks for the suggestion. The missing closing bracket is intentional. I
Will rename it to DSO__PREFIX_GUEST_KALLSYMS to make this intent
explicit and avoid confusion with complete name macros like
DSO__NAME_KALLSYMS
On 10/04/26 13:47, sashiko-bot@kernel.org wrote:
> Sashiko AI review found 1 potential issue(s):
> - [Low] The macro `DSO__NAME_GUEST_KALLSYMS` is defined with an unbalanced bracket, which is deceptive and prone to misuse.
> --
>
> commit bff739892129d9369935f2dfb42b44d83b2f857d
> Author: Tanushree Shah <tshah@linux.ibm.com>
>
> perf dso: Fix kallsyms DSO detection with fallback logic
>
> This commit fixes kallsyms DSO detection during build-id injection when
> the binary type is not yet explicitly set. It implements a fallback that
> matches the long_name against known kallsyms strings to correctly identify
> the kernel DSO.
>
>> diff --git a/tools/perf/util/dso.h b/tools/perf/util/dso.h
>> index ede691e9a2495..e44071998c499 100644
>> --- a/tools/perf/util/dso.h
>> +++ b/tools/perf/util/dso.h
> [ ... ]
>> @@ -20,6 +21,7 @@ struct perf_env;
>>
>> #define DSO__NAME_KALLSYMS "[kernel.kallsyms]"
>> #define DSO__NAME_KCORE "[kernel.kcore]"
>> +#define DSO__NAME_GUEST_KALLSYMS "[guest.kernel.kallsyms"
>
> This isn't a bug, but there is a missing closing bracket in this macro
> definition.
>
> While it looks like this was done intentionally to allow prefix matching
> against dynamic guest kallsyms names (which append a PID) using strncmp
> later in the patch, naming it DSO__NAME_GUEST_KALLSYMS implies it represents
> a complete, well-formed identifier like DSO__NAME_KALLSYMS.
>
> Could this macro be renamed to something like DSO__PREFIX_GUEST_KALLSYMS
> to make its intended use as a prefix clear, preventing it from being
> accidentally used in contexts expecting a full name?
>
prev parent reply other threads:[~2026-04-15 6:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 7:12 [PATCH] perf dso: Fix kallsyms DSO detection with fallback logic Tanushree Shah
2026-04-10 8:17 ` sashiko-bot
2026-04-15 6:56 ` tshah [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=157c4ffb-0d81-4394-bea5-12a9b8f08307@linux.ibm.com \
--to=tshah@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=sashiko@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