forked from bpftrace/bpftrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mdflush_example.txt
49 lines (43 loc) · 1.82 KB
/
mdflush_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
Demonstrations of mdflush, the Linux bpftrace/eBPF version.
The mdflush tool traces flushes at the md driver level, and prints details
including the time of the flush:
# ./mdflush.bt
Tracing md flush requests... Hit Ctrl-C to end.
TIME PID COMM DEVICE
03:13:49 16770 sync md0
03:14:08 16864 sync md0
03:14:49 496 kworker/1:0H md0
03:14:49 488 xfsaild/md0 md0
03:14:54 488 xfsaild/md0 md0
03:15:00 488 xfsaild/md0 md0
03:15:02 85 kswapd0 md0
03:15:02 488 xfsaild/md0 md0
03:15:05 488 xfsaild/md0 md0
03:15:08 488 xfsaild/md0 md0
03:15:10 488 xfsaild/md0 md0
03:15:11 488 xfsaild/md0 md0
03:15:11 488 xfsaild/md0 md0
03:15:11 488 xfsaild/md0 md0
03:15:11 488 xfsaild/md0 md0
03:15:11 488 xfsaild/md0 md0
03:15:12 488 xfsaild/md0 md0
03:15:13 488 xfsaild/md0 md0
03:15:15 488 xfsaild/md0 md0
03:15:19 496 kworker/1:0H md0
03:15:49 496 kworker/1:0H md0
03:15:55 18840 sync md0
03:16:49 496 kworker/1:0H md0
03:17:19 496 kworker/1:0H md0
03:20:19 496 kworker/1:0H md0
03:21:19 496 kworker/1:0H md0
03:21:49 496 kworker/1:0H md0
03:25:19 496 kworker/1:0H md0
[...]
This can be useful for correlation with latency outliers or spikes in disk
latency, as measured using another tool (eg, system monitoring). If spikes in
disk latency often coincide with md flush events, then it would make flushing
a target for tuning.
Note that the flush events are likely to originate from higher in the I/O
stack, such as from file systems. This traces md processing them, and the
timestamp corresponds with when md began to issue the flush to disks.
There is another version of this tool in bcc: https://github.com/iovisor/bcc