From: sashiko-bot@kernel.org
To: "Aaron Tomlin" <atomlin@atomlin.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH perf-tools-next v3 4/4] perf tests: Add shell test for kernel symbol beautifier
Date: Thu, 20 Aug 2026 21:27:33 +0000 [thread overview]
Message-ID: <20260820212733.EDEE11F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260820211100.649142-5-atomlin@atomlin.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The BTF type routing test does not actually test BTF symbolization, as it silently falls back to the default kallsyms beautifier.
--
--- Patch [4]: [PATCH perf-tools-next v3 4/4] perf tests: Add shell test for kernel symbol beautifier ---
commit c8c43ea37c4e0f26131dd9e871af4241cd478b77
Author: Aaron Tomlin <atomlin@atomlin.com>
perf tests: Add shell test for kernel symbol beautifier
This commit adds a shell test script, trace_ksym_beautifier.sh, to verify
that perf trace symbolises kernel virtual addresses and function pointers
using both the default kallsyms beautifier and BTF type routing.
> diff --git a/tools/perf/tests/shell/trace_ksym_beautifier.sh b/tools/perf/tests/shell/trace_ksym_beautifier.sh
> new file mode 100755
> index 0000000000000..30a8429669dd5
> --- /dev/null
> +++ b/tools/perf/tests/shell/trace_ksym_beautifier.sh
[ ... ]
> +test_ksym_btf() {
> + echo "Testing perf trace kernel symbol beautifier (BTF)"
> + if [ ! -f /sys/kernel/btf/vmlinux ]; then
> + echo "Skipping BTF test due to missing vmlinux BTF"
> + return
> + fi
> +
> + output="$(perf trace -e kmem:kmalloc --force-btf --max-events=1 2>&1)"
[Severity: Medium]
Does this actually test the BTF type routing as intended?
Looking at the kmem:kmalloc tracepoint, the call_site field is defined as an
unsigned long, rather than a function pointer. When trace__btf_scnprintf()
evaluates this, it determines it is an integer rather than a function
pointer, and returns 0.
This causes perf to silently fall back to the default SCA_KSYM beautifier.
Consequently, the test passes via the fallback path rather than truly
exercising the BTF routing.
Would it be better to use a tracepoint with a field explicitly typed as a
function pointer for the --force-btf test?
> + if ! echo "$output" | grep -q -E "call_site: [a-zA-Z_][a-zA-Z0-9_]*" || echo "$output" | grep -q -E "call_site: 0x[0-9a-fA-F]+"
> + then
> + printf "BTF function symbolization failed, output:\n%s\n" "$output"
> + err=1
> + fi
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260820211100.649142-1-atomlin@atomlin.com?part=4
prev parent reply other threads:[~2026-08-20 21:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 21:10 [PATCH perf-tools-next v3 0/4] perf trace: Symbolise kernel virtual addresses and function pointers Aaron Tomlin
2026-08-20 21:10 ` [PATCH perf-tools-next v3 1/4] perf trace: Introduce kernel symbol beautifier for virtual addresses Aaron Tomlin
2026-08-20 21:19 ` sashiko-bot
2026-08-20 21:10 ` [PATCH perf-tools-next v3 2/4] perf trace: Auto-assign kernel symbol beautifier to function pointer fields Aaron Tomlin
2026-08-20 21:26 ` sashiko-bot
2026-08-21 0:29 ` Aaron Tomlin
2026-08-20 21:10 ` [PATCH perf-tools-next v3 3/4] perf trace: Enhance BTF type formatting to symbolise kernel function pointers Aaron Tomlin
2026-08-20 21:25 ` sashiko-bot
2026-08-20 21:11 ` [PATCH perf-tools-next v3 4/4] perf tests: Add shell test for kernel symbol beautifier Aaron Tomlin
2026-08-20 21:27 ` sashiko-bot [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=20260820212733.EDEE11F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=atomlin@atomlin.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