blob: 7591f2847ad16bea76c554e670cc55ddace6eba1 [file] [log] [blame]
Brendan Greggcd1cad12016-02-12 02:27:19 -08001.TH ext4slower 8 "2016-02-11" "USER COMMANDS"
2.SH NAME
3ext4slower \- Trace slow ext4 file operations, with per-event details.
4.SH SYNOPSIS
5.B ext4slower [\-h] [\-j] [\-p PID] [min_ms]
6.SH DESCRIPTION
7This tool traces common ext4 file operations: reads, writes, opens, and
8syncs. It measures the time spent in these operations, and prints details
9for each that exceeded a threshold.
10
11WARNING: See the OVERHEAD section.
12
13By default, a minimum millisecond threshold of 10 is used. If a threshold of 0
14is used, all events are printed (warning: verbose).
15
16Since this works by tracing the ext4_file_operations interface functions, it
17will need updating to match any changes to these functions.
18
19Since this uses BPF, only the root user can use this tool.
20.SH REQUIREMENTS
21CONFIG_BPF and bcc.
22.SH OPTIONS
23\-p PID
24Trace this PID only.
25.TP
26min_ms
27Minimum I/O latency (duration) to trace, in milliseconds. Default is 10 ms.
28.SH EXAMPLES
29.TP
30Trace synchronous file reads and writes slower than 10 ms:
31#
32.B ext4slower
33.TP
34Trace slower than 1 ms:
35#
36.B ext4slower 1
37.TP
38Trace slower than 1 ms, and output just the fields in parsable format (csv):
39#
40.B ext4slower \-j 1
41.TP
42Trace all file reads and writes (warning: the output will be verbose):
43#
44.B ext4slower 0
45.TP
46Trace slower than 1 ms, for PID 181 only:
47#
48.B ext4slower \-p 181 1
49.SH FIELDS
50.TP
51TIME(s)
52Time of I/O completion since the first I/O seen, in seconds.
53.TP
54COMM
55Process name.
56.TP
57PID
58Process ID.
59.TP
60T
61Type of operation. R == read, W == write, O == open, S == fsync.
62.TP
63OFF_KB
64File offset for the I/O, in Kbytes.
65.TP
66BYTES
67Size of I/O, in bytes.
68.TP
69LAT(ms)
70Latency (duration) of I/O, measured from when it was issued by VFS to the
71filesystem, to when it completed. This time is inclusive of block device I/O,
72file system CPU cycles, file system locks, run queue latency, etc. It's a more
73accurate measure of the latency suffered by applications performing file
74system I/O, than to measure this down at the block device interface.
75.TP
76FILENAME
77A cached kernel file name (comes from dentry->d_iname).
78.TP
79ENDTIME_us
80Completion timestamp, microseconds (\-j only).
81.TP
82OFFSET_b
83File offset, bytes (\-j only).
84.TP
85LATENCY_us
86Latency (duration) of the I/O, in microseconds (\-j only).
87.SH OVERHEAD
88This adds low-overhead instrumentation to these ext4 operations,
89including reads and writes from the file system cache. Such reads and writes
90can be very frequent (depending on the workload; eg, 1M/sec), at which
91point the overhead of this tool (even if it prints no "slower" events) can
92begin to become significant. Measure and quantify before use. If this
93continues to be a problem, consider switching to a tool that prints in-kernel
94summaries only.
95.PP
96Note that the overhead of this tool should be less than fileslower(8), as
97this tool targets ext4 functions only, and not all file read/write paths
98(which can include socket I/O).
99.SH SOURCE
100This is from bcc.
101.IP
102https://github.com/iovisor/bcc
103.PP
104Also look in the bcc distribution for a companion _examples.txt file containing
105example usage, output, and commentary for this tool.
106.SH OS
107Linux
108.SH STABILITY
109Unstable - in development.
110.SH AUTHOR
111Brendan Gregg
112.SH SEE ALSO
113biosnoop(8), funccount(8), fileslower(8)