aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/bpf/progs/timer_mim.c
diff options
context:
space:
mode:
authorMartin KaFai Lau <martin.lau@kernel.org>2024-05-03 17:50:45 -0700
committerAndrii Nakryiko <andrii@kernel.org>2024-05-06 13:40:24 -0700
commit8e6d9ae2e09f1f6ba65614a5e5c5a2a2e335dcba (patch)
tree811617fea13f0eb366fc71068a5e0ca0b1a56e6b /tools/testing/selftests/bpf/progs/timer_mim.c
parentlibbpf: Avoid casts from pointers to enums in bpf_tracing.h (diff)
downloadwireguard-linux-8e6d9ae2e09f1f6ba65614a5e5c5a2a2e335dcba.tar.xz
wireguard-linux-8e6d9ae2e09f1f6ba65614a5e5c5a2a2e335dcba.zip
selftests/bpf: Use bpf_tracing.h instead of bpf_tcp_helpers.h
The bpf programs that this patch changes require the BPF_PROG macro. The BPF_PROG macro is defined in the libbpf's bpf_tracing.h. Some tests include bpf_tcp_helpers.h which includes bpf_tracing.h. They don't need other things from bpf_tcp_helpers.h other than bpf_tracing.h. This patch simplifies it by directly including the bpf_tracing.h. The motivation of this unnecessary code churn is to retire the bpf_tcp_helpers.h by directly using vmlinux.h. Right now, the main usage of the bpf_tcp_helpers.h is the partial kernel socket definitions (e.g. socket, sock, tcp_sock). While the test cases continue to grow, fields are kept adding to those partial socket definitions (e.g. the recent bpf_cc_cubic.c test which tried to extend bpf_tcp_helpers.c but eventually used the vmlinux.h instead). The idea is to retire bpf_tcp_helpers.c and consistently use vmlinux.h for the tests that require the kernel sockets. This patch tackles the obvious tests that can directly use bpf_tracing.h instead of bpf_tcp_helpers.h. Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20240504005045.848376-1-martin.lau@linux.dev
Diffstat (limited to 'tools/testing/selftests/bpf/progs/timer_mim.c')
-rw-r--r--tools/testing/selftests/bpf/progs/timer_mim.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/bpf/progs/timer_mim.c b/tools/testing/selftests/bpf/progs/timer_mim.c
index 2fee7ab105ef..50ebc3f68522 100644
--- a/tools/testing/selftests/bpf/progs/timer_mim.c
+++ b/tools/testing/selftests/bpf/progs/timer_mim.c
@@ -4,7 +4,7 @@
#include <time.h>
#include <errno.h>
#include <bpf/bpf_helpers.h>
-#include "bpf_tcp_helpers.h"
+#include <bpf/bpf_tracing.h>
char _license[] SEC("license") = "GPL";
struct hmap_elem {