Skip to content

Commit

Permalink
selftests/bpf: Add kprobe session recursion check test
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
olsajiri authored and Kernel Patches Daemon committed Jan 8, 2025
1 parent 1fbca56 commit 5df6c35
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/bpf/prog_tests/missed.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static void test_missed_kprobe_recursion(void)
ASSERT_GE(get_missed_count(bpf_program__fd(skel->progs.test3)), 1, "test3_recursion_misses");
ASSERT_GE(get_missed_count(bpf_program__fd(skel->progs.test4)), 1, "test4_recursion_misses");
ASSERT_GE(get_missed_count(bpf_program__fd(skel->progs.test5)), 1, "test5_recursion_misses");
ASSERT_EQ(get_missed_count(bpf_program__fd(skel->progs.test6)), 1, "test6_recursion_misses");

cleanup:
missed_kprobe_recursion__destroy(skel);
Expand Down
6 changes: 6 additions & 0 deletions tools/testing/selftests/bpf/progs/missed_kprobe_recursion.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ int test5(struct pt_regs *ctx)
{
return 0;
}

SEC("kprobe.session/bpf_kfunc_common_test")
int test6(struct pt_regs *ctx)
{
return 0;
}

0 comments on commit 5df6c35

Please sign in to comment.