selftests/bpf: Add test for recursion counts of perf event link tracepoint
authorJiri Olsa <jolsa@kernel.org>
Wed, 20 Sep 2023 21:31:45 +0000 (23:31 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Mon, 25 Sep 2023 23:37:45 +0000 (16:37 -0700)
commit85981e0f9e9fc882578f0ad7488d6c59193dd187
treec693b65caa5a8a700c04677fcce5e8db95a7a706
parent59e83c0187c5eed648c28aea637a5cf3e246921b
selftests/bpf: Add test for recursion counts of perf event link tracepoint

Adding selftest that puts kprobe on bpf_fentry_test1 that calls bpf_printk
and invokes bpf_trace_printk tracepoint. The bpf_trace_printk tracepoint
has test[234] programs attached to it.

Because kprobe execution goes through bpf_prog_active check, programs
attached to the tracepoint will fail the recursion check and increment the
recursion_misses stats.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Tested-by: Song Liu <song@kernel.org>
Reviewed-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/bpf/20230920213145.1941596-10-jolsa@kernel.org
tools/testing/selftests/bpf/prog_tests/missed.c
tools/testing/selftests/bpf/progs/missed_tp_recursion.c [new file with mode: 0644]