Skip to content

Commit bfaac2a

Browse files
olsajiriAlexei Starovoitov
authored andcommitted
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>
1 parent 2ebadb6 commit bfaac2a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tools/testing/selftests/bpf/prog_tests/missed.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ static void test_missed_kprobe_recursion(void)
8585
ASSERT_GE(get_missed_count(bpf_program__fd(skel->progs.test3)), 1, "test3_recursion_misses");
8686
ASSERT_GE(get_missed_count(bpf_program__fd(skel->progs.test4)), 1, "test4_recursion_misses");
8787
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");
8889

8990
cleanup:
9091
missed_kprobe_recursion__destroy(skel);

tools/testing/selftests/bpf/progs/missed_kprobe_recursion.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ int test5(struct pt_regs *ctx)
4646
{
4747
return 0;
4848
}
49+
50+
SEC("kprobe.session/bpf_kfunc_common_test")
51+
int test6(struct pt_regs *ctx)
52+
{
53+
return 0;
54+
}

0 commit comments

Comments
 (0)