syncsnoop.bt(8)
β¨ syncsnoop.bt β bestie edition β¨
okay so real quick: this is a page from the System Manager's Manual (section 8, the big-user one π
), and it's all about syncsnoop.bt. welcome to the group chat, pull up a chair π«Ά
πΈ NAME πΈ
syncsnoop.bt β trace the sync() variety of syscalls. uses bpftrace/eBPF. no cap, that's literally the whole vibe.
π SYNOPSIS π
syncsnoop.bt
that's it. that's the whole invocation. iconic, honestly.
π DESCRIPTION π
so syncsnoop traces calls to the sync() syscalls β think sync(), fsync(), msync(), etc. those are the ones that flush the file system cache and buffers out to the storage devices. and bestie, when those fire, they can cause performance perturbations π. so it's genuinely useful to know if they're happening, when they're happening, and how frequently they're happening.
the way it works? it traces the sync() variety of syscalls via tracepoints. that's the whole trick. slay.
this program is also a basic example of eBPF/bcc β so if you're trying to learn what this stuff looks like, it's giving tutorial energy β¨.
β οΈ heads up: since this uses BPF, only the root user can use this tool. no root, no snooping. sorry bestie π
π¦ REQUIREMENTS π¦
CONFIG_BPFbpftrace
both of them. neither is optional. periodt.
π EXAMPLES π
trace calls to sync() syscalls:
# syncsnoop.bt
one command, zero notes. she's simple like that π
β FIELDS β
okay so when the output shows up, here's what each column is actually telling you:
TIMEβ a timestamp on the output, in"HH:MM:SS"format.PIDβ the process ID that was on-CPU during the event.COMMβ the process name that was on-CPU during the event.EVENTβ the tracepoint name for the sync event.
four little columns of truth π«Ά
π₯ OVERHEAD π₯
this traces sync syscalls and prints output for each event. and because the rate of this is generally expected to be low (<< 100/s), the overhead is also expected to be negligible. tiny. a crumb. nothing to worry about πΈ
π§ SOURCE π§
this is from bpftrace.
https://github.com/iovisor/bpftrace
also, do yourself a favor and look in the bpftrace distribution for a companion _examples.txt file β it's got example usage, output, and commentary for this tool. lowkey a whole extra resource, use it π
and fyi: this is a bpftrace version of the bcc tool of the same name.
https://github.com/iovisor/bcc
π OS π
Linux. that's the one. π§
π STABILITY π
Unstable - in development.
so like. she's in her development era. treat accordingly π
π AUTHOR π
Brendan Gregg
thank you for your service, legend π«‘
π SEE ALSO π
go read that one too, it's a whole other thing iykyk.
that's the page bestie!! this came out of the USER COMMANDS part of the System Manager's Manual, and the version/date stamped on it is 2018-09-06 π go forth and trace those syncs, and remember: root only, low overhead, main character energy only πβ¨π
π¦ where this page comes from
- debian bookworm: bpftrace 0.17.0-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms