selftests/bpf: Fix test_run logic in fexit_stress.c
authorYuntao Wang <ytcoode@gmail.com>
Sat, 21 May 2022 15:13:29 +0000 (23:13 +0800)
committerAndrii Nakryiko <andrii@kernel.org>
Thu, 2 Jun 2022 23:26:40 +0000 (16:26 -0700)
commiteb7b36ce47f830a01ad9405e673b563cc3638d5d
tree81dd32f5fd12abb962d0a883ff7174739be2102d
parentf7abbecdab2191f1ba1f0876af67b715c541f9b1
selftests/bpf: Fix test_run logic in fexit_stress.c

In the commit da00d2f117a0 ("bpf: Add test ops for BPF_PROG_TYPE_TRACING"),
the bpf_fentry_test1 function was moved into bpf_prog_test_run_tracing(),
which is the test_run function of the tracing BPF programs.

Thus calling 'bpf_prog_test_run_opts(filter_fd, &topts)' will not trigger
bpf_fentry_test1 function as filter_fd is a sk_filter BPF program.

Fix it by replacing filter_fd with fexit_fd in the bpf_prog_test_run_opts()
function.

Fixes: da00d2f117a0 ("bpf: Add test ops for BPF_PROG_TYPE_TRACING")
Signed-off-by: Yuntao Wang <ytcoode@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20220521151329.648013-1-ytcoode@gmail.com
tools/testing/selftests/bpf/prog_tests/fexit_stress.c