summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/timer_mim.c
diff options
context:
space:
mode:
authorDelyan Kratunov <delyank@fb.com>2022-02-02 15:54:20 -0800
committerAndrii Nakryiko <andrii@kernel.org>2022-02-02 22:31:18 -0800
commit04fcb5f9a104f24278ad849c642cbdf0c8f48453 (patch)
treee0347c7a158827786282e8b815870ccc0e0384fa /tools/testing/selftests/bpf/prog_tests/timer_mim.c
parentdd5152ab338c8705093a64d706a35074b3b365aa (diff)
selftests/bpf: Migrate from bpf_prog_test_run
bpf_prog_test_run is being deprecated in favor of the OPTS-based bpf_prog_test_run_opts. We end up unable to use CHECK in most cases, so replace usages with ASSERT_* calls. Signed-off-by: Delyan Kratunov <delyank@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220202235423.1097270-2-delyank@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/timer_mim.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/timer_mim.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/timer_mim.c b/tools/testing/selftests/bpf/prog_tests/timer_mim.c
index 949a0617869d..2ee5f5ae11d4 100644
--- a/tools/testing/selftests/bpf/prog_tests/timer_mim.c
+++ b/tools/testing/selftests/bpf/prog_tests/timer_mim.c
@@ -6,19 +6,18 @@
static int timer_mim(struct timer_mim *timer_skel)
{
- __u32 duration = 0, retval;
__u64 cnt1, cnt2;
int err, prog_fd, key1 = 1;
+ LIBBPF_OPTS(bpf_test_run_opts, topts);
err = timer_mim__attach(timer_skel);
if (!ASSERT_OK(err, "timer_attach"))
return err;
prog_fd = bpf_program__fd(timer_skel->progs.test1);
- err = bpf_prog_test_run(prog_fd, 1, NULL, 0,
- NULL, NULL, &retval, &duration);
+ err = bpf_prog_test_run_opts(prog_fd, &topts);
ASSERT_OK(err, "test_run");
- ASSERT_EQ(retval, 0, "test_run");
+ ASSERT_EQ(topts.retval, 0, "test_run");
timer_mim__detach(timer_skel);
/* check that timer_cb[12] are incrementing 'cnt' */