cbdb1461dc
-Dbpf_prog_load_deprecated=bpf_prog_test_load trick is both ugly and breaks when deprecation goes into effect due to macro magic. Convert all the uses to explicit bpf_prog_test_load() calls which avoid deprecation errors and makes everything less magical. Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Dave Marchevsky <davemarchevsky@fb.com> Link: https://lore.kernel.org/bpf/20211103220845.2676888-12-andrii@kernel.org
18 lines
372 B
C
18 lines
372 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <test_progs.h>
|
|
|
|
void test_tcp_estats(void)
|
|
{
|
|
const char *file = "./test_tcp_estats.o";
|
|
int err, prog_fd;
|
|
struct bpf_object *obj;
|
|
__u32 duration = 0;
|
|
|
|
err = bpf_prog_test_load(file, BPF_PROG_TYPE_TRACEPOINT, &obj, &prog_fd);
|
|
CHECK(err, "", "err %d errno %d\n", err, errno);
|
|
if (err)
|
|
return;
|
|
|
|
bpf_object__close(obj);
|
|
}
|