]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/bpf: Switch fexit_bpf2bpf selftest to set_attach_target() API
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 16 Sep 2021 01:58:34 +0000 (18:58 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 17 Sep 2021 16:05:41 +0000 (09:05 -0700)
commitee3a9b5139c6602bd0a32cf9735ad37d876fde3d
tree6920a9f255245e636e0909a518e08c7df0d1ac19
parent0a7960c7671df02fab02d383c00c76721dbba7e7
selftests/bpf: Switch fexit_bpf2bpf selftest to set_attach_target() API

Switch fexit_bpf2bpf selftest to bpf_program__set_attach_target()
instead of using bpf_object_open_opts.attach_prog_fd, which is going to
be deprecated. These changes also demonstrate the new mode of
set_attach_target() in which it allows NULL when the target is BPF
program (attach_prog_fd != 0).

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20210916015836.1248906-6-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/fexit_bpf2bpf.c