bpftool-struct_ops(8)
π bpftool-struct_ops(8) β the manual page, but make it cute π
okay bestie so this is the page for bpftool-struct_ops, from the System Manager's Manual β¨ it's the lil corner of bpftool that registers, unregisters and introspects BPF struct_ops, and honestly? it's giving backstage-pass energy π
πΈ Name πΈ
bpftool-struct_ops β a tool to register / unregister / introspect BPF struct_ops π
β¨ SYNOPSIS β¨
bpftool [OPTIONS] struct_ops COMMAND
OPTIONS := { { -j | --json } [{ -p | --pretty }] | { -d | --debug } }
COMMANDS := { show | list | dump | register | unregister | help }
so like. bpftool, then your options, then struct_ops, then whichever command you're feeling today π«Ά
π¦ STRUCT_OPS COMMANDS π¦
the whole menu, laid out for u:
bpftool struct_ops { show | list } [STRUCT_OPS_MAP]
bpftool struct_ops dump [STRUCT_OPS_MAP]
bpftool struct_ops register OBJ [LINK_DIR]
bpftool struct_ops unregister STRUCT_OPS_MAP
bpftool struct_ops help
STRUCT_OPS_MAP := { id STRUCT_OPS_MAP_ID | name STRUCT_OPS_MAP_NAME }
OBJ := /a/file/of/bpf_struct_ops.o
not me defining the grammar mid-command π anyway. your struct_ops map can be identified either by its id or by its name, and your OBJ is just a path to a .o file like /a/file/of/bpf_struct_ops.o β¨
π DESCRIPTION π
bpftool struct_ops { show | list } [STRUCT_OPS_MAP]
Show brief information about the struct_ops in the system π« If you pass a STRUCT_OPS_MAP, it shows info for only that one given struct_ops. Otherwise? It lists all the struct_ops currently existing in the system, no cap π₯
the output starts with the struct_ops map ID, then its map name, then its struct_ops's kernel type. iconic little trio π
bpftool struct_ops dump [STRUCT_OPS_MAP]
Dump detail information about the struct_ops in the system π¦ If STRUCT_OPS_MAP is specified, it dumps info only for the given struct_ops. Otherwise, it dumps all struct_ops currently existing in the system. same energy as show, just. more. lowkey extra in the best way π
bpftool struct_ops register OBJ [LINK_DIR]
Register bpf struct_ops from OBJ π«Ά All struct_ops under the ELF section .struct_ops and .struct_ops.link will be registered to its kernel subsystem. And for each struct_ops in the .struct_ops.link section, a link will be created β¨ You can hand over LINK_DIR to provide a directory path where these links will be pinned with the same name as their corresponding map name π
bpftool struct_ops unregister STRUCT_OPS_MAP
Unregister the STRUCT_OPS_MAP from the kernel subsystem. bye bestie ππ
bpftool struct_ops help
Print a short help message. ur lil safety net π
π OPTIONS π
-h,--helpβ Print short help message (similar tobpftool help). ur friendly lil reminder πΈ-V,--versionβ Print bpftool's version number (similar tobpftool version), the number of thelibbpfversion in use, and optional features that were included when bpftool was compiled π Those optional features include linking against LLVM or libbfd to provide the disassembler for JIT-ted programs (bpftool prog dump jited) and usage of BPF skeletons (some features likebpftool prog profileor showing pids associated to BPF objects may rely on it). receipts, basically π§Ύ-j,--jsonβ Generate JSON output β¨ For commands that cannot produce JSON, this option has no effect. soz π-p,--prettyβ Generate human-readable JSON output. Implies-j. it brings a friend, always π-d,--debugβ Print all logs available, even debug-level information π This includes logs fromlibbpfas well as from the verifier, when attempting to load programs. it's giving nosy in the most useful way fr fr
π EXAMPLES π
the show, run, slay sequence π
# bpftool struct_ops show
100: dctcp tcp_congestion_ops
105: cubic tcp_congestion_ops
look at them. two lil congestion control girlies living their best life ππ
# bpftool struct_ops unregister id 105
Unregistered tcp_congestion_ops cubic id 105
gone. not me. she left the group chat π
# bpftool struct_ops register bpf_cubic.o
Registered tcp_congestion_ops cubic id 110
and she's BACK β¨ reincarnated with a new id, main character energy only π
π SEE ALSO π
bpf(2), bpf-helpers(7), bpftool(8), bpftool-btf(8), bpftool-cgroup(8), bpftool-feature(8), bpftool-gen(8), bpftool-iter(8), bpftool-link(8), bpftool-map(8), bpftool-net(8), bpftool-perf(8), bpftool-prog(8), bpftool-token(8)
the whole friend group π«Ά go read them too, iykyk β¨
reminder bestie: this page lives in the System Manager's Manual, and its page name is bpftool-struct_ops(8) π that's the one to look up when u need it manually π
and that's a wrap on bpftool-struct_ops(8) from the System Manager's Manual π go forth, register ur struct_ops, unregister them politely, and always introspect with love πΈπ¦β¨
π¦ where this page comes from
- arch rolling: bpf 7.3.1-1 Β· GPL-2.0-only
- ubuntu stonking: bpftool 7.8.0+7.3.0-10.10
- ubuntu stonking: bpftool 7.8.0+7.3.0-9.9
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms