bpftool-perf(8)
π bpftool-perf β¨
okay bestie, so this is the bpftool-perf page from the System Manager's Manual β it's the little corner of bpftool that's all about peeking at perf-related BPF program attachments. literally all the vibes of "who attached what to where" ππ
πΈ NAME πΈ
bpftool-perf β the tool for inspection of perf related bpf prog attachments π«Ά
β¨ SYNOPSIS β¨
bpftool [OPTIONS] perf COMMAND
OPTIONS := { { -j | --json } [{ -p | --pretty }] | { -d | --debug } }
COMMANDS := { show | list | help }
π PERF COMMANDS π
bpftool perf { show | list }
bpftool perf help
π¦ DESCRIPTION π¦
bpftool perf { show | list }
it lists every raw_tracepoint, tracepoint, and kprobe attachment chillin' in the system, no cap π«‘
the output starts with the process id and the file descriptor inside that process, then the bpf program id, then the attachment info, and finally the attachment point π«
so like, what even is the attachment point for each one? let's break it down bestie:
- for
raw_tracepoint/tracepointit's the trace probe name - for
k[ret]probeit's either the symbol name and offset, or a kernel virtual address - for
u[ret]probeit's the file name and the file offset
bpftool perf help
just prints a short help message. short king energy π
π OPTIONS π
-h,--helpβ prints the short help message (basically the same vibe asbpftool help) πββοΈ-V,--versionβ printsbpftool's version number (similar tobpftool version), the number of thelibbpfversion in use, and, bestie, the optional features that got baked in whenbpftoolwas compiled β¨ those optional features include linking against LLVM or libbfd to give you 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β generates JSON output. for commands that can't produce JSON, this option has no effect (it's giving "I'm here but I'm not doing anything" π)-p,--prettyβ generates human-readable JSON output. implies-jπ-d,--debugβ prints all logs available, even debug-level information. this includes logs fromlibbpfas well as from the verifier, when attempting to load programs π₯
π EXAMPLES π
# bpftool perf
pid 21711 fd 5: prog_id 5 kprobe func __x64_sys_write offset 0
pid 21765 fd 5: prog_id 7 kretprobe func __x64_sys_nanosleep offset 0
pid 21767 fd 5: prog_id 8 tracepoint sys_enter_nanosleep
pid 21800 fd 5: prog_id 9 uprobe filename /home/yhs/a.out offset 1159
# bpftool -j perf
[{"pid":21711,"fd":5,"prog_id":5,"fd_type":"kprobe","func":"__x64_sys_write","offset":0}, \
{"pid":21765,"fd":5,"prog_id":7,"fd_type":"kretprobe","func":"__x64_sys_nanosleep","offset":0}, \
{"pid":21767,"fd":5,"prog_id":8,"fd_type":"tracepoint","tracepoint":"sys_enter_nanosleep"}, \
{"pid":21800,"fd":5,"prog_id":9,"fd_type":"uprobe","filename":"/home/yhs/a.out","offset":1159}]
π 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-prog(8), bpftool-struct_ops(8), bpftool-token(8)
and that's the whole page bestie, you ate that ππ this came from the System Manager's Manual, version <rainbow>bpftool-perf(8)</rainbow>, and the date stamp on it is the same as the page footer β go off, 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