ext4slower(8)
๐ ext4slower(8) ๐
System Manager's Manual ๐
โจ NAME โจ
okay so ext4slower is the tool that traces slow ext4 file operations and gives you per-event details ๐ bestie, it's giving detective energy.
๐ SYNOPSIS ๐
ext4slower [-h] [-j] [-p PID] [min_ms]
๐ DESCRIPTION ๐
this tool keeps an eye on the common ext4 file operations: reads, writes, opens, and syncs ๐ it times each one and prints the details for any that go over a threshold. main character energy โจ
๐จ WARNING: see the OVERHEAD section. no cap, read it.
by default the minimum threshold is 10 milliseconds ๐ if you set it to 0, every single event gets printed (warning: verbose, we are not kidding ๐).
lowkey important: this works by tracing the ext4_file_operations interface functions, so it'll need updating whenever those functions change ๐ง
also, since this uses BPF, only the root user can run it ๐
๐งฐ 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:
# ext4slower
trace slower than 1 ms:
# ext4slower 1
trace slower than 1 ms, and output just the fields in parsable format (csv) ๐ง:
# ext4slower -j 1
trace all file reads and writes (warning: the output will be verbose ๐):
# ext4slower 0
trace slower than 1 ms, for PID 181 only ๐:
# ext4slower -p 181 1
๐ฅ FIELDS ๐ฅ
TIME(s)โ the time of I/O completion since the first I/O seen, in seconds โญCOMMโ the process name ๐ซถPIDโ the process ID ๐Tโ the type of operation.R== read,W== write,O== open,S== fsync ๐OFF_KBโ the file offset for the I/O, in Kbytes ๐BYTESโ the size of the I/O, in bytes ๐ฆLAT(ms)โ the latency (duration) of the I/O, measured from when VFS issued it to the filesystem, until 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 applications actually feel doing file system I/O, than measuring down at the block device interface ๐ฅบโจFILENAMEโ a cached kernel file name (comes fromdentry->d_name.name) ๐ENDTIME_usโ the completion timestamp, in microseconds (-jonly) โฐOFFSET_bโ the file offset, in bytes (-jonly) ๐งฎLATENCY_usโ the latency (duration) of the I/O, in microseconds (-jonly) ๐
๐ข OVERHEAD ๐ข
โ ๏ธ this adds low-overhead instrumentation to these ext4 operations, including reads and writes from the file system cache. those reads and writes can be super frequent (depending on the workload; eg, 1M/sec), and at that point the overhead of this tool can start to get significant, even if it prints no "slower" events ๐ญ measure and quantify before you use it. if it keeps being a problem, consider switching to a tool that only prints in-kernel summaries.
the overhead of this tool should be less than fileslower(8), though, because this one only targets ext4 functions and not every file read/write path (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 with 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) ๐ฆ
bestie, that's the whole tea โ๐ this page is from the USER COMMANDS section, dated 2016-02-11, and sourced from bcc, so go forth and trace those slow ext4 ops ๐งโจ๐
๐ฆ where this page comes from
- debian bookworm: bpfcc-tools 0.26.0+ds-1 ยท Apache-2.0
- debian trixie: bpfcc-tools 0.31.0+ds-7 ยท Apache-2.0
- ubuntu jammy: bpfcc-tools 0.18.0+ds-2 ยท Apache-2.0
- ubuntu noble: bpfcc-tools 0.29.1+ds-1ubuntu7 ยท Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 ยท Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 ยท Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 ยท Apache-2.0
- ๐ girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms