hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/samples/bpf/tcp_bpf.readme
....@@ -8,14 +8,16 @@
88 bash
99 echo $$ >> /tmp/cgroupv2/foo/cgroup.procs
1010
11
-Anything that runs under this shell belongs to the foo cgroupv2 To load
11
+Anything that runs under this shell belongs to the foo cgroupv2. To load
1212 (attach) one of the tcp_*_kern.o programs:
1313
14
- ./load_sock_ops -l /tmp/cgroupv2/foo tcp_basertt_kern.o
14
+ bpftool prog load tcp_basertt_kern.o /sys/fs/bpf/tcp_prog
15
+ bpftool cgroup attach /tmp/cgroupv2/foo sock_ops pinned /sys/fs/bpf/tcp_prog
16
+ bpftool prog tracelog
1517
16
-If the "-l" flag is used, the load_sock_ops program will continue to run
17
-printing the BPF log buffer. The tcp_*_kern.o programs use special print
18
-functions to print logging information (if enabled by the ifdef).
18
+"bpftool prog tracelog" will continue to run printing the BPF log buffer.
19
+The tcp_*_kern.o programs use special print functions to print logging
20
+information (if enabled by the ifdef).
1921
2022 If using netperf/netserver to create traffic, you need to run them under the
2123 cgroupv2 to which the BPF programs are attached (i.e. under bash shell
....@@ -23,4 +25,4 @@
2325
2426 To remove (unattach) a socket_ops BPF program from a cgroupv2:
2527
26
- ./load_sock_ops -r /tmp/cgroupv2/foo
28
+ bpftool cgroup detach /tmp/cgroupv2/foo sock_ops pinned /sys/fs/bpf/tcp_prog