Scroll to navigation

BPFTOOL-STRUCT_OPS(8) BPFTOOL-STRUCT_OPS(8)

NAME

bpftool-struct_ops - tool to register/unregister/introspect BPF struct_ops

SYNOPSIS

bpftool [OPTIONS] struct_ops COMMAND

OPTIONS := { { -j | --json } [{ -p | --pretty }] | { -d | --debug } | { -l | --legacy } }

COMMANDS := { show | list | dump | register | unregister | help }



STRUCT_OPS COMMANDS

bpftool struct_ops { show | list } [STRUCT_OPS_MAP]
bpftool struct_ops dump [STRUCT_OPS_MAP]
bpftool struct_ops register OBJ
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

DESCRIPTION

Show brief information about the struct_ops in the system. If STRUCT_OPS_MAP is specified, it shows information only for the given struct_ops. Otherwise, it lists all struct_ops currently existing in the system.

Output will start with struct_ops map ID, followed by its map name and its struct_ops's kernel type.

Dump details information about the struct_ops in the system. If STRUCT_OPS_MAP is specified, it dumps information only for the given struct_ops. Otherwise, it dumps all struct_ops currently existing in the system.
Register bpf struct_ops from OBJ. All struct_ops under the ELF section ".struct_ops" will be registered to its kernel subsystem.
Unregister the STRUCT_OPS_MAP from the kernel subsystem.
Print short help message.



OPTIONS

Print short help message (similar to bpftool help).
Print version number (similar to bpftool version), and optional features that were included when bpftool was compiled. Optional features include linking against libbfd to provide the disassembler for JIT-ted programs (bpftool prog dump jited) and usage of BPF skeletons (some features like bpftool prog profile or showing pids associated to BPF objects may rely on it).
Generate JSON output. For commands that cannot produce JSON, this option has no effect.
Generate human-readable JSON output. Implies -j.
Print all logs available, even debug-level information. This includes logs from libbpf as well as from the verifier, when attempting to load programs.
Use legacy libbpf mode which has more relaxed BPF program requirements. By default, bpftool has more strict requirements about section names, changes pinning logic and doesn't support some of the older non-BTF map declarations.

See https://github.com/libbpf/libbpf/wiki/Libbpf:-the-road-to-v1.0 for details.




EXAMPLES

# bpftool struct_ops show

100: dctcp           tcp_congestion_ops
105: cubic           tcp_congestion_ops


# bpftool struct_ops unregister id 105

Unregistered tcp_congestion_ops cubic id 105


# bpftool struct_ops register bpf_cubic.o

Registered tcp_congestion_ops cubic id 110


SEE ALSO