xfsslower(8)
β¨ NAME β¨
xfsslower(8) is part of the System Manager's Manual π, and it's the one for tracing slow XFS file stuff! xfsslower is for tracing slow xfs file operations, with per-event details π
π¦ SYNOPSIS π¦
xfsslower [-h] [-j] [-p PID] [min_ms]
πΈ DESCRIPTION πΈ
okay so this tool traces the common XFS file operations: reads, writes, opens, and syncs π It measures how long each one takes, and it prints details for every single one that went over a threshold πβ¨
β οΈ WARNING: See the OVERHEAD section. Seriously, read it bestie π
by default the minimum threshold is 10 milliseconds π
If you use a threshold of 0, every event gets printed (warning: verbose π).
lowkey important: this works by tracing the xfs_file_operations interface functions, so it's going to need updating to match any changes to those functions π§
also since this uses BPF, only the root user can use this tool π
π§ REQUIREMENTS π§
You'll need CONFIG_BPF and bcc π
π OPTIONS π
-p PIDβ trace this PID only π―min_msβ the minimum I/O latency (duration) to trace, in milliseconds π The default is 10 ms.
π EXAMPLES π
Trace synchronous file reads and writes slower than 10 ms:
# xfsslower
Trace slower than 1 ms:
# xfsslower 1
Trace slower than 1 ms, and output just the fields in parsable format (csv) π§Ύ:
# xfsslower -j 1
Trace all file reads and writes (warning: the output will be verbose π):
# xfsslower 0
Trace slower than 1 ms, for PID 181 only:
# xfsslower -p 181 1
π₯ FIELDS π₯
TIME(s)β time of I/O completion, since the first I/O seen, in seconds β°COMMβ process name π£PIDβ process ID πͺͺTβ type of operation.R== read,W== write,O== open,S== fsync π«ΆOFF_KBβ file offset for the I/O, in Kbytes π¦BYTESβ size of I/O, in bytes πLAT(ms)β latency (duration) of I/O, measured from when it was issued by VFS to the filesystem, to when it completed. This time is inclusive of block device I/O, file system CPU cycles, file system locks, run queue latency, etc. It's a more accurate measure of the latency suffered by applications performing file system I/O, than to measure this down at the block device interface π§ β¨FILENAMEβ a cached kernel file name (comes fromdentry->d_name.name) πENDTIME_usβ completion timestamp, microseconds (-jonly) β±οΈOFFSET_bβ file offset, bytes (-jonly) π―LATENCY_usβ latency (duration) of the I/O, in microseconds (-jonly) π
π OVERHEAD π
π¨ this adds low-overhead instrumentation to these XFS operations, including reads and writes from the file system cache. Such reads and writes can be very frequent (depending on the workload; eg, 1M/sec), at which point the overhead of this tool (even if it prints no "slower" events) can begin to become significant. Measure and quantify before use. If this continues to be a problem, consider switching to a tool that prints in-kernel summaries only.
ngl the overhead of this tool should be less than fileslower(8), because this one only targets xfs functions and not all the file read/write paths (which can include socket I/O) π·
π SOURCE π
This is from bcc π
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool π
π OS π
Linux π§
π«§ STABILITY π«§
Unstable - in development π§
π AUTHOR π
Brendan Gregg π
π¦ SEE ALSO π¦
biosnoop(8), funccount(8), fileslower(8) π
USER COMMANDS Β· 2016-02-11 Β· xfsslower(8) πΈ that's a wrap, bestie! β¨ stay curious and stay slay π
π¦ where this page comes from
- alpine 3.24: bcc-doc 0.36.1-r1 Β· Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms