summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/prog_tests/syscall.c
diff options
context:
space:
mode:
authorDelyan Kratunov <delyank@fb.com>2022-02-02 15:54:21 -0800
committerAndrii Nakryiko <andrii@kernel.org>2022-02-02 22:31:18 -0800
commit3931618378451f7ae884b14e4120e07560875cab (patch)
treefac0cb8e372432a36a23d931b0ccb4646c899db7 /tools/testing/selftests/bpf/prog_tests/syscall.c
parent04fcb5f9a104f24278ad849c642cbdf0c8f48453 (diff)
downloadlinux-3931618378451f7ae884b14e4120e07560875cab.tar.bz2
selftests/bpf: Migrate from bpf_prog_test_run_xattr
bpf_prog_test_run_xattr is being deprecated in favor of the OPTS-based bpf_prog_test_run_opts. We end up unable to use CHECK_ATTR so replace usages with ASSERT_* calls. Also, prog_run_xattr is now prog_run_opts. Signed-off-by: Delyan Kratunov <delyank@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20220202235423.1097270-3-delyank@fb.com
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/syscall.c')
-rw-r--r--tools/testing/selftests/bpf/prog_tests/syscall.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/prog_tests/syscall.c b/tools/testing/selftests/bpf/prog_tests/syscall.c
index 81e997a69f7a..f4d40001155a 100644
--- a/tools/testing/selftests/bpf/prog_tests/syscall.c
+++ b/tools/testing/selftests/bpf/prog_tests/syscall.c
@@ -20,20 +20,20 @@ void test_syscall(void)
.log_buf = (uintptr_t) verifier_log,
.log_size = sizeof(verifier_log),
};
- struct bpf_prog_test_run_attr tattr = {
+ LIBBPF_OPTS(bpf_test_run_opts, tattr,
.ctx_in = &ctx,
.ctx_size_in = sizeof(ctx),
- };
+ );
struct syscall *skel = NULL;
__u64 key = 12, value = 0;
- int err;
+ int err, prog_fd;
skel = syscall__open_and_load();
if (!ASSERT_OK_PTR(skel, "skel_load"))
goto cleanup;
- tattr.prog_fd = bpf_program__fd(skel->progs.bpf_prog);
- err = bpf_prog_test_run_xattr(&tattr);
+ prog_fd = bpf_program__fd(skel->progs.bpf_prog);
+ err = bpf_prog_test_run_opts(prog_fd, &tattr);
ASSERT_EQ(err, 0, "err");
ASSERT_EQ(tattr.retval, 1, "retval");
ASSERT_GT(ctx.map_fd, 0, "ctx.map_fd");