selftests/bpf: Test re-attachment fix for bpf_tracing_prog_attach
authorDmitrii Dolgov <9erthalion6@gmail.com>
Wed, 3 Jan 2024 19:05:47 +0000 (20:05 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 5 Jan 2024 04:40:49 +0000 (20:40 -0800)
commite02feb3f1f47509ec1e07b604bfbeff8c3b4e639
tree0597b83407e92f101be92851c0b2e0eb5181b045
parent715d82ba636cb3629a6e18a33bb9dbe53f9936ee
selftests/bpf: Test re-attachment fix for bpf_tracing_prog_attach

Add a test case to verify the fix for "prog->aux->dst_trampoline and
tgt_prog is NULL" branch in bpf_tracing_prog_attach. The sequence of
events:

1. load rawtp program
2. load fentry program with rawtp as target_fd
3. create tracing link for fentry program with target_fd = 0
4. repeat 3

Acked-by: Jiri Olsa <olsajiri@gmail.com>
Acked-by: Song Liu <song@kernel.org>
Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com>
Link: https://lore.kernel.org/r/20240103190559.14750-5-9erthalion6@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/testing/selftests/bpf/prog_tests/recursive_attach.c
tools/testing/selftests/bpf/progs/fentry_recursive_target.c