tcp_bpf.readme 1010 B

123456789101112131415161718192021222324252627
  1. This file describes how to run the tcp_*_kern.o tcp_bpf (or socket_ops)
  2. programs. These programs attach to a cgroupv2. The following commands create
  3. a cgroupv2 and attach a bash shell to the group.
  4. mkdir -p /tmp/cgroupv2
  5. mount -t cgroup2 none /tmp/cgroupv2
  6. mkdir -p /tmp/cgroupv2/foo
  7. bash
  8. echo $$ >> /tmp/cgroupv2/foo/cgroup.procs
  9. Anything that runs under this shell belongs to the foo cgroupv2 To load
  10. (attach) one of the tcp_*_kern.o programs:
  11. ./load_sock_ops -l /tmp/cgroupv2/foo tcp_basertt_kern.o
  12. If the "-l" flag is used, the load_sock_ops program will continue to run
  13. printing the BPF log buffer. The tcp_*_kern.o programs use special print
  14. functions to print logging information (if enabled by the ifdef).
  15. If using netperf/netserver to create traffic, you need to run them under the
  16. cgroupv2 to which the BPF programs are attached (i.e. under bash shell
  17. attached to the cgroupv2).
  18. To remove (unattach) a socket_ops BPF program from a cgroupv2:
  19. ./load_sock_ops -r /tmp/cgroupv2/foo