writeback.bt(8)
π NAME π
okay so the manual name is writeback.bt, and it's a bpftrace/eBPF tool that traces file system writeback events with details π₯ it's giving observability bestie energy β¨
π SYNOPSIS π
writeback.bt
β¨ DESCRIPTION β¨
okay bestie, this one traces when file system dirtied pages get flushed to disk by kernel writeback πΎ it prints details including when the event happened and how long it took β±οΈ this is lowkey so useful for matching those times up with other performance problems π if they line up, that's a clue the problem might be coming from writeback π΅οΈββοΈ
how fast the kernel does writeback can be tuned too ποΈ check the kernel docs for stuff like vm.dirty_writeback_centisecs πΈ
this uses the tracepoint:writeback:writeback_start and tracepoint:writeback:writeback_written tracepoints π§
π since this runs on BPF, only the root user can use this tool. no exceptions, no cap.
π¦ REQUIREMENTS π¦
you'll need CONFIG_BPF and bpftrace π οΈ
π EXAMPLES π
trace all writeback events with timestamps and latency details:
# writeback.bt
π FIELDS π
- TIME β the time the writeback event completed, in
%H:%M:%Sformat β° - DEVICE β the device name, in major:minor number format πΏ
- PAGES β how many pages were written during writeback π
- REASON β why the writeback event happened. this might be "background", "vmscan", "sync", "periodic", etc π―
- ms β how long the writeback event lasted, in milliseconds β‘
π OVERHEAD π
writeback events are supposed to be pretty rare (<10/sec), so the overhead of this tool is expected to be negligible, aka near 0% π«Ά
π SOURCE π
this is from bpftrace π
https://github.com/bpftrace/bpftrace
also peek in the bpftrace distribution for a companion _examples.txt file. it has example usage, output, and commentary for this tool π
π§ OS π§
Linux π§
β STABILITY β
β οΈ unstable, still in development. it's giving work in progress π§
π AUTHOR π
Brendan Gregg π
π SEE ALSO π
biosnoop.bt(8) π«§
that's the whole tea, bestie! π this is writeback.bt from the USER COMMANDS section, dated 2018-09-14. stay iconic πβ¨
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- debian trixie: bpftrace 0.23.2-1 Β· Apache-2.0
- fedora 43: bpftrace 0.24.0-1.fc43 Β· Apache-2.0
- fedora 43: bpftrace 0.24.2-1.fc43 Β· Apache-2.0
- fedora 44: bpftrace 0.24.2-3.fc44 Β· Apache-2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- opensuse-leap 16.0: bpftrace-tools 0.23.5-160000.1.2 Β· Apache-2.0
- ubuntu questing: bpftrace 0.23.5-1ubuntu1 Β· Apache-2.0
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms