Brendan Gregg | 5be5194 | 2015-09-16 15:09:04 -0700 | [diff] [blame] | 1 | Demonstrations of biosnoop, the Linux eBPF/bcc version. |
| 2 | |
| 3 | |
| 4 | biosnoop traces block device I/O (disk I/O), and prints a line of output |
| 5 | per I/O. Example: |
| 6 | |
| 7 | # ./biosnoop |
| 8 | TIME(s) COMM PID DISK T SECTOR BYTES LAT(ms) |
| 9 | 0.000004001 supervise 1950 xvda1 W 13092560 4096 0.74 |
| 10 | 0.000178002 supervise 1950 xvda1 W 13092432 4096 0.61 |
| 11 | 0.001469001 supervise 1956 xvda1 W 13092440 4096 1.24 |
| 12 | 0.001588002 supervise 1956 xvda1 W 13115128 4096 1.09 |
| 13 | 1.022346001 supervise 1950 xvda1 W 13115272 4096 0.98 |
| 14 | 1.022568002 supervise 1950 xvda1 W 13188496 4096 0.93 |
| 15 | 1.023534000 supervise 1956 xvda1 W 13188520 4096 0.79 |
| 16 | 1.023585003 supervise 1956 xvda1 W 13189512 4096 0.60 |
| 17 | 2.003920000 xfsaild/md0 456 xvdc W 62901512 8192 0.23 |
| 18 | 2.003931001 xfsaild/md0 456 xvdb W 62901513 512 0.25 |
| 19 | 2.004034001 xfsaild/md0 456 xvdb W 62901520 8192 0.35 |
| 20 | 2.004042000 xfsaild/md0 456 xvdb W 63542016 4096 0.36 |
| 21 | 2.004204001 kworker/0:3 26040 xvdb W 41950344 65536 0.34 |
| 22 | 2.044352002 supervise 1950 xvda1 W 13192672 4096 0.65 |
| 23 | 2.044574000 supervise 1950 xvda1 W 13189072 4096 0.58 |
| 24 | |
| 25 | This includes the PID and comm (process name) that were on-CPU at the time of |
| 26 | issue (which usually means the process responsible). |
| 27 | |
| 28 | The latency of the disk I/O, measured from the issue to the device to its |
| 29 | completion, is included as the last column. |
| 30 | |
| 31 | This example output is from what should be an idle system, however, the |
| 32 | following is visible in iostat: |
| 33 | |
| 34 | $ iostat -x 1 |
| 35 | [...] |
| 36 | avg-cpu: %user %nice %system %iowait %steal %idle |
| 37 | 0.12 0.00 0.12 0.00 0.00 99.75 |
| 38 | |
Alexei Starovoitov | a79da0a | 2016-01-09 12:06:40 -0800 | [diff] [blame] | 39 | Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s await svctm %util |
| 40 | xvda 0.00 0.00 0.00 4.00 0.00 16.00 0.00 0.00 0.00 |
| 41 | xvdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
| 42 | xvdc 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
| 43 | md0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 |
Brendan Gregg | 5be5194 | 2015-09-16 15:09:04 -0700 | [diff] [blame] | 44 | |
| 45 | There are 4 write IOPS. |
| 46 | |
| 47 | The output of biosnoop identifies the reason: multiple supervise processes are |
| 48 | issuing writes to the xvda1 disk. I can now drill down on supervise using other |
| 49 | tools to understand its file system workload. |