9.5 Optional Exercises
If not specified, these can be completed using either bpftrace or BCC:
Modify biolatency(8) to print a linear histogram instead, for the range 0 to 100 milliseconds and a step size of one millisecond.
Modify biolatency(8) to print the linear histogram summary every one second.
Develop a tool to show disk I/O completions by CPU, to check how these interrupts are balanced. It could be displayed as a linear histogram.
Develop a tool similar to biosnoop(8) to print per-event block I/O, with only the following fields, in CSV format: completion_time,direction,latency_ms. The direction is read or write.
Save two minutes of (4) and use plotting software to visualize it as a scatter plot, coloring reads red and writes blue.
Save two minutes of the output of (2) and use plotting software to display it as a latency heat map. (You can also develop some plotting software: e.g., use awk(1) to turn the count column into rows of a HTML table, with the background color scaled to the value.)
Rewrite biosnoop(8) to use block tracepoints.
Modify seeksize(8) to show the actual seek distances encountered by the storage devices: measured on completions.
Write a tool to show disk I/O timeouts. One solution could be to use the block tracepoints and BLK_STS_TIMEOUT (see bioerr(8)).
(Advanced, unsolved) Develop a tool that shows the lengths of block I/O merging as a histogram.