All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Tanushree Shah" <tshah@linux.ibm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] perf dso: Fix kallsyms DSO detection with fallback logic
Date: Fri, 10 Apr 2026 08:17:22 +0000	[thread overview]
Message-ID: <20260410081724.69B1EC19421@smtp.kernel.org> (raw)
In-Reply-To: <20260410071225.708005-2-tshah@linux.ibm.com>

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?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260410071225.708005-2-tshah@linux.ibm.com?part=1

  reply	other threads:[~2026-04-10  8:17 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 [this message]
2026-04-15  6:56   ` tshah

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=20260410081724.69B1EC19421@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko@lists.linux.dev \
    --cc=tshah@linux.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.