Re: [PATCH perf-tools-next v4 4/4] perf tests: Add shell test for kernel symbol beautifier
Aaron Tomlin <[email protected]>
| Newsgroups | org.kernel.vger.linux-perf-users,dev.linux.lists.sashiko-reviews |
|---|---|
| Message-ID | <7rw7wkivh5dqm6npbvvokvypqd6ueer7vqscpvx3dktujg7eh4@hfz7vgbrygkp> |
On Fri, Aug 21, 2026 at 09:01:55PM +0000, [email protected] wrote: > --- Patch [4]: [PATCH perf-tools-next v4 4/4] perf tests: Add shell test for kernel symbol beautifier --- > commit c9c4a1b0dcd918dc4702b41032200c74d4363a15 > Author: Aaron Tomlin <[email protected]> > > perf tests: Add shell test for kernel symbol beautifier > > This commit adds a dedicated shell test script to verify that perf trace > properly 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..c030b03e2b662 > > --- /dev/null > > +++ b/tools/perf/tests/shell/trace_ksym_beautifier.sh > > @@ -0,0 +1,43 @@ > [ ... ] > > +test_ksym_kallsyms() { > > + echo "Testing perf trace kernel symbol beautifier (default kallsyms)" > > + output="$(perf trace -e kmem:kmalloc --max-events=1 2>&1)" > > [Severity: Medium] > Could this wait indefinitely on a completely quiescent system? > > Because it waits system-wide for the kmem:kmalloc event without a timeout > or a deterministic workload to trigger it, it might stall the test suite > if the event takes too long to fire. Fair. I will propose: 'perf trace -e kmem:kmalloc --max-events=1 -- true 2>&1'. > > +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 csd:csd_function_entry --force-btf --max-events=1 2>&1)" > > [Severity: Medium] > Will this test fail erroneously on uniprocessor (UP) kernels? > > The csd:csd_function_entry tracepoint is defined in kernel/smp.c, which is > only available when CONFIG_SMP is enabled. On a UP kernel, perf trace will > fail with an unknown tracepoint error, which the script would parse as a > symbolization failure. > > [Severity: Medium] > Additionally, can this cause an indefinite hang on idle SMP systems? > > The csd:csd_function_entry event relies on SMP cross-calls (IPIs). On an > idle or isolated test VM, this event might not occur organically for > extended periods, potentially causing perf trace to block forever without > a timeout or a triggering workload. Acknowledged. Instead: 'perf trace -e timer:hrtimer_start --force-btf --max-events=1 -- sleep 0.01 2>&1' Kind regards, -- Aaron Tomlin