writeback.bt(8)

πŸ“¦
version 0.27.0 Β· 3 versions
  • 0.27.0 Β· alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.14.0 Β· ubuntu jammy
  • 0.20.2 Β· ubuntu noble
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ 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:%S format ⏰
  • 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 πŸ’–βœ¨