Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Add kprobe session recursion check test

Adding kprobe.session probe to bpf_kfunc_common_test that misses bpf
program execution due to recursion check and making sure it increases
the program missed count properly.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20250106175048.1443905-2-jolsa@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Jiri Olsa and committed by
Alexei Starovoitov
bfaac2a0 2ebadb60

+7
+1
tools/testing/selftests/bpf/prog_tests/missed.c
··· 85 85 ASSERT_GE(get_missed_count(bpf_program__fd(skel->progs.test3)), 1, "test3_recursion_misses"); 86 86 ASSERT_GE(get_missed_count(bpf_program__fd(skel->progs.test4)), 1, "test4_recursion_misses"); 87 87 ASSERT_GE(get_missed_count(bpf_program__fd(skel->progs.test5)), 1, "test5_recursion_misses"); 88 + ASSERT_EQ(get_missed_count(bpf_program__fd(skel->progs.test6)), 1, "test6_recursion_misses"); 88 89 89 90 cleanup: 90 91 missed_kprobe_recursion__destroy(skel);
+6
tools/testing/selftests/bpf/progs/missed_kprobe_recursion.c
··· 46 46 { 47 47 return 0; 48 48 } 49 + 50 + SEC("kprobe.session/bpf_kfunc_common_test") 51 + int test6(struct pt_regs *ctx) 52 + { 53 + return 0; 54 + }