selftests/bpf: Switch fexit_stress to bpf_link_create() API
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 21 Apr 2022 03:39:45 +0000 (20:39 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 22 Apr 2022 22:37:02 +0000 (00:37 +0200)
Use bpf_link_create() API in fexit_stress test to attach FEXIT programs.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Kui-Feng Lee <kuifeng@fb.com>
Link: https://lore.kernel.org/bpf/20220421033945.3602803-4-andrii@kernel.org
tools/testing/selftests/bpf/prog_tests/fexit_stress.c

index 3ee2107bbf7a73650046b8421906f67f72e144b7..fe1f0f26ea14889d911e4a9b3a194dc4a229ab13 100644 (file)
@@ -53,7 +53,7 @@ void test_fexit_stress(void)
                                            &trace_opts);
                if (!ASSERT_GE(fexit_fd[i], 0, "fexit load"))
                        goto out;
-               link_fd[i] = bpf_raw_tracepoint_open(NULL, fexit_fd[i]);
+               link_fd[i] = bpf_link_create(fexit_fd[i], 0, BPF_TRACE_FEXIT, NULL);
                if (!ASSERT_GE(link_fd[i], 0, "fexit attach"))
                        goto out;
        }