forked from bpftrace/bpftrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xfsdist_example.txt
65 lines (54 loc) · 3.57 KB
/
xfsdist_example.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Demonstrations of xfsdist, the Linux bpftrace/eBPF version.
xfsdist traces XFS reads, writes, opens, and fsyncs, and summarizes their
latency as a power-of-2 histogram. For example:
# xfsdist.bt
Attaching 9 probes...
Tracing XFS operation latency... Hit Ctrl-C to end.
^C
@us[xfs_file_write_iter]:
[0, 1] 0 | |
[2, 4) 0 | |
[4, 8) 0 | |
[8, 16) 1 |@@@@@@@@@@@@@@@@@@@@@@@@@@ |
[16, 32) 2 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
@us[xfs_file_read_iter]:
[0, 1] 724 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[2, 4) 137 |@@@@@@@@@ |
[4, 8) 143 |@@@@@@@@@@ |
[8, 16) 37 |@@ |
[16, 32) 11 | |
[32, 64) 22 |@ |
[64, 128) 7 | |
[128, 256) 0 | |
[256, 512) 485 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ |
[512, 1K) 149 |@@@@@@@@@@ |
[1K, 2K) 98 |@@@@@@@ |
[2K, 4K) 85 |@@@@@@ |
[4K, 8K) 27 |@ |
[8K, 16K) 29 |@@ |
[16K, 32K) 25 |@ |
[32K, 64K) 1 | |
[64K, 128K) 0 | |
[128K, 256K) 6 | |
@us[xfs_file_open]:
[0, 1] 1819 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[2, 4) 272 |@@@@@@@ |
[4, 8) 0 | |
[8, 16) 9 | |
[16, 32) 7 | |
This output shows a bi-modal distribution for read latency, with a faster
mode of 724 reads that took between 0 and 1 microseconds, and a slower
mode of over 485 reads that took between 256 and 512 microseconds. It's
likely that the faster mode was a hit from the in-memory file system cache,
and the slower mode is a read from a storage device (disk).
This "latency" is measured from when the operation was issued from the VFS
interface to the file system, to when it completed. This spans everything:
block device I/O (disk I/O), file system CPU cycles, file system locks, run
queue latency, etc. This is a better measure of the latency suffered by
applications reading from the file system than measuring this down at the
block device interface.
Note that this only traces the common file system operations previously
listed: other file system operations (eg, inode operations including
getattr()) are not traced.
There is another version of this tool in bcc: https://github.com/iovisor/bcc
The bcc version provides command line options to customize the output.