Linux Perf Users
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Rui Qi <qirui.001@bytedance.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	James Clark <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 0/2] perf: Add is_ignored_kernel_symbol() for kernel symbol filtering
Date: Mon, 25 May 2026 21:04:11 -0500	[thread overview]
Message-ID: <ahT_m5dG6rITpTNB@google.com> (raw)
In-Reply-To: <20260522082604.89447-1-qirui.001@bytedance.com>

Hello,

On Fri, May 22, 2026 at 04:26:02PM +0800, Rui Qi wrote:
> The perf tool currently has ad-hoc logic to filter out ELF mapping
> symbols scattered across multiple files. ARM, AArch64 and RISC-V each
> have their own inline checks in dso__load_sym_internal(), and kallsym
> processing has yet another check for ARM module symbols.
> 
> This patch series introduces a single is_ignored_kernel_symbol() inline
> helper in symbol.h and converts the kernel symbol handling paths to use it.
> The helper covers the existing "$" prefix used by ARM, AArch64 and RISC-V,
> and also adds the x86 local symbol prefixes so that perf stays consistent
> with the kernel's own is_mapping_symbol() logic.
> 
> Changes in v4:
>   - Rename the helper from is_mapping_symbol() to is_ignored_kernel_symbol()
>     to make its purpose clearer.
>   - Split the single patch into two logical patches:
>     - Patch 1 introduces the helper and applies it to kallsyms and ksymbol events.
>     - Patch 2 applies the helper to the ELF loading path for kernel DSOs.
> 
> Link (v3): https://lore.kernel.org/all/20260507071103.2772577-1-qirui.001@bytedance.com/
> 
> Changes in v3:
>   - Add is_mapping_symbol() check for kernel modules in dso__load_sym_internal()
>   - Add is_mapping_symbol() check in machine__process_ksymbol_unregister()
> 
> Link (v2): https://lore.kernel.org/all/20260506073820.2419087-1-qirui.001@bytedance.com/
> 
> Changes in v2:
>   - Only apply is_mapping_symbol() filtering to kernel symbols (kallsyms
>     and ksymbol events), not to user-space symbols from ELF files,
>     BFD libraries, or perf map files.  This avoids incorrectly
>     discarding valid user-space function names that start with '$',
>     which is a legal character in identifiers for many languages
>     (e.g., Java, Scala) and compilers (GCC).
>   - Move the mapping symbol check in machine__process_ksymbol_register()
>     to the beginning of the function, before any map/dso allocation
>     or insertion, to avoid leaving empty maps in the kernel map tree.
> 
> Link (v1): https://lore.kernel.org/all/20260504090609.1801880-1-qirui.001@bytedance.com/
> 
> Rui Qi (2):
>   perf: Extract is_ignored_kernel_symbol() for kernel mapping symbol
>     filtering
>   perf: Apply is_ignored_kernel_symbol() filter in ELF loading path for
>     kernel DSOs

Acked-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

> 
>  tools/perf/util/machine.c    | 18 +++++++++++++++++-
>  tools/perf/util/symbol-elf.c | 10 ++++++++--
>  tools/perf/util/symbol.c     |  4 ++--
>  tools/perf/util/symbol.h     | 15 +++++++++++++++
>  4 files changed, 42 insertions(+), 5 deletions(-)
> 
> -- 
> 2.20.1

  parent reply	other threads:[~2026-05-26  2:04 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06  7:38 [PATCH v2] perf: Extract is_mapping_symbol() helper for kernel mapping symbol filtering Rui Qi
2026-05-06 10:43 ` sashiko-bot
2026-05-07  6:27   ` Rui Qi
2026-05-07  7:11 ` [PATCH v3] perf: Add " Rui Qi
2026-05-07 15:23   ` Ian Rogers
2026-05-22  7:34     ` Rui Qi
2026-05-07 20:38   ` sashiko-bot
2026-05-22  8:26   ` [PATCH v4 0/2] perf: Add is_ignored_kernel_symbol() for kernel " Rui Qi
2026-05-22  8:26     ` [PATCH v4 1/2] perf: Extract is_ignored_kernel_symbol() for kernel mapping " Rui Qi
2026-05-22  8:26     ` [PATCH v4 2/2] perf: Apply is_ignored_kernel_symbol() filter in ELF loading path for kernel DSOs Rui Qi
2026-05-26  2:04     ` Namhyung Kim [this message]
2026-05-27 11:15       ` [PATCH v4 0/2] perf: Add is_ignored_kernel_symbol() for kernel symbol filtering 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=ahT_m5dG6rITpTNB@google.com \
    --to=namhyung@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=qirui.001@bytedance.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox