OnCallReadyStart learning

bpftool: tool for inspection and simple manipulation of eBPF programs and maps

bpftool [OPTIONS] OBJECT { COMMAND | help }

What it does

bpftool lists and inspects the eBPF programs and maps loaded in the kernel, the kernel's BTF, and what the kernel supports. It is part of the kernel source; on Ubuntu it is the bpftool package. It needs root.

Options you will use

-j, --json
JSON output.
-p, --pretty
pretty JSON.
-V, --version
print version.

Examples

$ sudo bpftool prog list

loaded eBPF programs

$ sudo bpftool feature probe kernel | grep -i unprivileged

who may load BPF

$ bpftool btf dump file /sys/kernel/btf/vmlinux format c | head

the kernel types as C

Gotchas

Taught in

Try bpftool in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.