BPFTOOL(8)
๐ BPFTOOL โ bestie's guide to poking at eBPF โจ
okay so this is the manual page for bpftool, which lives in section 8 of the System Manager's Manual. she's the tool for inspection and simple manipulation of eBPF programs and maps, and honestly? she ate. let's get into it ๐ซถ
๐ธ SYNOPSIS ๐ธ
here's the whole vibe, verbatim, no notes:
bpftool [OPTIONS] OBJECT { COMMAND | help }
bpftool batch file FILE
bpftool version
OBJECT := { map | prog | link | cgroup | perf | net | feature | btf |
gen | struct_ops | iter }
OPTIONS := { { -V | --version } | { -j | --json } [{ -p | --pretty }] |
{ -d | --debug } }
MAP-COMMANDS := { show | list | create | dump | update | lookup |
getnext | delete | pin | event_pipe | help }
PROG-COMMANDS := { show | list | dump jited | dump xlated | pin | load |
attach | detach | help }
LINK-COMMANDS := { show | list | pin | detach | help }
CGROUP-COMMANDS := { show | list | attach | detach | help }
PERF-COMMANDS := { show | list | help }
NET-COMMANDS := { show | list | help }
FEATURE-COMMANDS := { probe | help }
BTF-COMMANDS := { show | list | dump | help }
GEN-COMMANDS := { object | skeleton | min_core_btf | help }
STRUCT-OPS-COMMANDS := { show | list | dump | register | unregister |
help }
ITER-COMMANDS := { pin | help }
like. LOOK at all those little objects and commands. it's giving menu at a restaurant where every dish is a kernel subsystem ๐
โจ DESCRIPTION โจ
bpftool lets you inspect and simply modify BPF objects hanging out on your system. lowkey iconic behaviour.
โ ๏ธ ok bestie, gentle heads up: the format of the output of all the tools is not guaranteed to be stable and you should not depend upon it. fr fr. don't be out here parsing it like it's a stable API, because it is not. ๐
๐ OPTIONS ๐
-h,--helpโ prints a short help message, basically the same energy asbpftool help.-V,--versionโ printsbpftool's version number (kinda likebpftool versiondoes), plus the number of thelibbpfversion in use, plus any optional features that got included whenbpftoolwas compiled. those optional features include linking against LLVM or libbfd so you get the disassembler for JIT-ted programs (bpftool prog dump jited), and usage of BPF skeletons โ and heads up, some features likebpftool prog profileor showing pids associated to BPF objects may rely on it. ๐ฆ-j,--jsonโ generate JSON output โจ. for commands that cannot produce JSON, this option has no effect (nothing happens, she's just sitting there, respectfully).-p,--prettyโ generate human-readable JSON output. implies-j. so you get pretty AND json, we love a combo ๐-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 a lot of tea and she spills all of it ๐-m,--mapcompatโ allow loading maps with unknown map definitions. living dangerously, we respect it.-n,--nomountโ do not automatically attempt to mount any virtual file system (such astracefsor BPF virtual file system) when necessary. hands off the filesystems, she said ๐
๐ SEE ALSO ๐
go read these too, they're all part of the same friend group:
bpf(2), bpf-helpers(7), 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-struct_ops(8), bpftool-token(8)
ok that's the whole page, you're officially educated โจ this was BPFTOOL(8), straight out of the System Manager's Manual โ section 8, as the footer will tell you. mwah, go inspect some maps, bestie ๐ ๐ฆ ๐ periodt.
๐ฆ 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