Re: [PATCH v3 next 06/13] kallsyms: Improve selftest test_perf_kallsyms_lookup_name() output
From: David Laight
Date: Sun Nov 15 2026 - 07:55:23 EST
On Wed, 11 Nov 2026 23:17:06 +0000 (UTC)
bot+bpf-ci@xxxxxxxxxx wrote:
> > kallsyms: Improve selftest test_perf_kallsyms_lookup_name() output
>
> TL;DR: Commit message only: it says 4 functions get noinline_for_stack but the
> patch marks 5, and it omits the compression-ratio output format fix; maybe
> split that into a separate patch.
>
> > kallsyms: Improve selftest test_perf_kallsyms_lookup_name() output
> >
> > - Improve the test stability/reproducability by taking the faster of
> > two calls to kallsyms_lookup_name().
> > - Check that kallsyms_lookup_name() returns the expected address
> > unless the symbol is duplicated.
> > - Report the names of the min/max symbols.
> > - Output an 8 line 64 entry histogram of the times taken.
> > - This shows there is a reasonably normal distribution with a small
> > number of much slower outliers that don't really affect the average.
> >
> > Additionally:
> > - Add a very long symbol to check the handling of two byte lengths.
> > - Do the test_perf_kallsyms_lookup_name() last because it can take long
> > enough that the CPU frequency changes and the times reported by the
> > other tests can change.
> > - Mark the 4 test functions noinline_for_stack since they all have a
> > quite large on-stack structure.
> >
> > Example output (after all these patches)
> > kallsyms_on_each_symbol() traverse all: 7742950 ns
> > kallsyms_on_each_match_symbol() traverse all: 951 ns
> > kallsyms_lookup_name() looked up 123312 symbols, average 200 ns
> > fastest 60 ns (_rs.0)
> > slowest 662 ns (The_time_has_come_the_Walrus_said_To_talk_of_many_things_Of_sho)
> > Distribution, 20ns per column, 2916 counts per *:
> > | **
> > | ****
> > | ****
> > | ****
> > | ******
> > | *******
> > | *********
> > | ****************** ** * * *
> >
> > Signed-off-by: David Laight <david.laight.linux@xxxxxxxxx>
> >
>
> The changelog says 4 test functions are marked noinline_for_stack "since they
> all have a quite large on-stack structure", but the patch marks five:
> test_kallsyms_compression_ratio(), test_perf_kallsyms_lookup_name(),
> test_perf_kallsyms_on_each_symbol(), test_perf_kallsyms_on_each_match_symbol()
> and test_kallsyms_basic_function().
>
> test_kallsyms_compression_ratio() has only seven u32 locals and no large
> on-stack structure, so the stated reason does not cover it.
The large stack frame is hidden, it is inside kallsyms_on_each_symbol().
So the commit message should probably just say 'all'.
>
> The same function also changes its output format from "%2d.%-2d" to
> "%2d.%02d", which fixes how the fractional part is printed (12.05 used to show
> as "12.5 "). The changelog does not mention this.
I mentioned in it the changes for v3 lower down.
David
> Could the changelog give the right count and mention the format fix, or should
> the compression-ratio changes go in a separate patch?
>
>
> ---
> AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
> See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
>
> CI run summary: https://github.com/kernel-patches/bpf/actions/runs/43116767394