hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/samples/bpf/tcp_bufs_kern.c
....@@ -9,7 +9,7 @@
99 * doing appropriate checks that indicate the hosts are far enough
1010 * away (i.e. large RTT).
1111 *
12
- * Use load_sock_ops to load this BPF program.
12
+ * Use "bpftool cgroup attach $cg sock_ops $prog" to load this BPF program.
1313 */
1414
1515 #include <uapi/linux/bpf.h>
....@@ -17,17 +17,10 @@
1717 #include <uapi/linux/if_packet.h>
1818 #include <uapi/linux/ip.h>
1919 #include <linux/socket.h>
20
-#include "bpf_helpers.h"
21
-#include "bpf_endian.h"
20
+#include <bpf/bpf_helpers.h>
21
+#include <bpf/bpf_endian.h>
2222
2323 #define DEBUG 1
24
-
25
-#define bpf_printk(fmt, ...) \
26
-({ \
27
- char ____fmt[] = fmt; \
28
- bpf_trace_printk(____fmt, sizeof(____fmt), \
29
- ##__VA_ARGS__); \
30
-})
3124
3225 SEC("sockops")
3326 int bpf_bufs(struct bpf_sock_ops *skops)