/
usr
/
share
/
doc
/
bpftrace
/
examples
/
/usr/share/doc/bpftrace/examples
mkdir
upload
Name
Size
Mode
Actions
bashreadline_example.txt
722
0644
edit
dl
rm
biolatency_example.txt
1790
0644
edit
dl
rm
biosnoop_example.txt
2056
0644
edit
dl
rm
biostacks_example.txt
1914
0644
edit
dl
rm
bitesize_example.txt
3003
0644
edit
dl
rm
capable_example.txt
2659
0644
edit
dl
rm
cpuwalk_example.txt
4919
0644
edit
dl
rm
dcsnoop_example.txt
4612
0644
edit
dl
rm
execsnoop_example.txt
1535
0644
edit
dl
rm
gethostlatency_example.txt
923
0644
edit
dl
rm
killsnoop_example.txt
846
0644
edit
dl
rm
loads_example.txt
864
0644
edit
dl
rm
mdflush_example.txt
1866
0644
edit
dl
rm
naptime_example.txt
844
0644
edit
dl
rm
oomkill_example.txt
1668
0644
edit
dl
rm
opensnoop_example.txt
2528
0644
edit
dl
rm
pidpersec_example.txt
1504
0644
edit
dl
rm
runqlat_example.txt
8632
0644
edit
dl
rm
runqlen_example.txt
980
0644
edit
dl
rm
setuids_example.txt
2441
0644
edit
dl
rm
ssllatency_example.txt
4510
0644
edit
dl
rm
sslsnoop_example.txt
1916
0644
edit
dl
rm
statsnoop_example.txt
2738
0644
edit
dl
rm
swapin_example.txt
549
0644
edit
dl
rm
syncsnoop_example.txt
541
0644
edit
dl
rm
syscount_example.txt
1144
0644
edit
dl
rm
tcpaccept_example.txt
1350
0644
edit
dl
rm
tcpconnect_example.txt
1085
0644
edit
dl
rm
tcpdrop_example.txt
1256
0644
edit
dl
rm
tcplife_example.txt
1597
0644
edit
dl
rm
tcpretrans_example.txt
1153
0644
edit
dl
rm
tcpsynbl_example.txt
940
0644
edit
dl
rm
threadsnoop_example.txt
1182
0644
edit
dl
rm
undump_example.txt
680
0644
edit
dl
rm
vfscount_example.txt
1199
0644
edit
dl
rm
vfsstat_example.txt
929
0644
edit
dl
rm
writeback_example.txt
1962
0644
edit
dl
rm
xfsdist_example.txt
3419
0644
edit
dl
rm
Edit:
/usr/share/doc/bpftrace/examples/writeback_example.txt
(1962B)
Demonstrations of writeback, the Linux bpftrace/eBPF version. This tool traces when the kernel writeback procedure is writing dirtied pages to disk, and shows details such as the time, device numbers, reason for the write back, and the duration. For example: # ./writeback.bt Attaching 4 probes... Tracing writeback... Hit Ctrl-C to end. TIME DEVICE PAGES REASON ms 23:28:47 259:1 15791 periodic 0.005 23:28:48 259:0 15792 periodic 0.004 23:28:52 259:1 15784 periodic 0.003 23:28:53 259:0 18682 periodic 0.003 23:28:55 259:0 41970 background 326.663 23:28:56 259:0 18418 background 332.689 23:28:56 259:0 60402 background 362.446 23:28:57 259:1 18230 periodic 0.005 23:28:57 259:1 65492 background 3.343 23:28:57 259:1 65492 background 0.002 23:28:58 259:0 36850 background 0.000 23:28:58 259:0 13298 background 597.198 23:28:58 259:0 55282 background 322.050 23:28:59 259:0 31730 background 336.031 23:28:59 259:0 8178 background 357.119 23:29:01 259:0 50162 background 1803.146 23:29:02 259:0 27634 background 1311.876 23:29:03 259:0 6130 background 331.599 23:29:03 259:0 50162 background 293.968 23:29:03 259:0 28658 background 284.946 23:29:03 259:0 7154 background 286.572 [...] By looking a the timestamps and latency, it can be seen that the system was not spending much time in writeback until 23:28:55, when "background" writeback began, taking over 300 milliseconds per flush. If timestamps of heavy writeback coincide with times when applications suffered performance issues, that would be a clue that they are correlated and there is contention for the disk devices. There are various ways to tune this: eg, vm.dirty_writeback_centisecs.
Save
cmd:
run