Re: [PATCH v2] selftests/bpf: move trampoline_count to dedicated bpf_testmod target
From: Paul Chaignon
Date: Thu Mar 19 2026 - 07:05:40 EST
On Thu, Mar 19, 2026 at 12:03:37PM +0800, Sun Jian wrote:
> trampoline_count fills all trampoline attachment slots for a single
> target function and verifies that one extra attach fails with -E2BIG.
>
> It currently targets bpf_modify_return_test, which is also used by
> other selftests such as modify_return, get_func_ip_test, and
> get_func_args_test. When such tests run in parallel, they can contend
> for the same per-function trampoline quota and cause unexpected attach
> failures. This issue is currently masked by harness serialization.
>
> Move trampoline_count to a dedicated bpf_testmod target and register it
> for fmod_ret attachment. This keeps the test semantics unchanged while
> isolating it from other selftests, so it no longer needs to run in
> serial mode. Remove the TODO comment as well.
>
> Tested:
> ./test_progs -t trampoline_count -vv
> ./test_progs -t modify_return -vv
> ./test_progs -t get_func_ip_test -vv
> ./test_progs -t get_func_args_test -vv
> ./test_progs -j$(nproc) -t trampoline_count -vv
> ./test_progs -j$(nproc) -t
> trampoline_count,modify_return,get_func_ip_test,get_func_args_test,\
> kprobe_multi_test -vv
> 20 runs of:
> ./test_progs -j$(nproc) -t
> trampoline_count,modify_return,get_func_ip_test,get_func_args_test,\
> kprobe_multi_test
>
> Signed-off-by: Sun Jian <sun.jian.kdev@xxxxxxxxx>
> ---
>
> v2:
> - rewrite the subject to describe the change
> - resend with the correct patch content
Please increment the version number when making these changes. Otherwise
it can be quite confusing to everyone. I believe this is the third
variant of your v2 on the mailing list.
> - resend as a reply to v1
That can also be a bit confusing as it will fold the email into existing
conversations. You can instead link to the previous version from the
changelogs.
[...]
Paul