Content-type: text/html
iotrace_util [options] start DEVICE
iotrace_util [options] stop
iotrace_syphon
request type: read or write
sector number (relative to the start of the partition)
number of sectors
start time (timespec)
finish time (timespec)
MD5 fingerprint of individual sectors (optional)
The kernel dumps the log to a special character device named /dev/iotrace. Any user program (e.g., cat or iotrace_syphon ) can read the log from the device and dump it into a permanent place.
First, patch the kernel:
% cd linux-2.X.Y % patch -p1 < IOTRACEDIR/iotrace.patch
Then, do "make xconfig" or something similar, and enable "CONFIG_IOTRACE", found in Drivers / Character. CONFIG_IOTRACE_FINGERPRINT is optional; it allows dumping MD5 fingerprint of sector contents. This bloats the log size by an average of 10x. Then do make and install as usual.
The iotrace log device has a major number of 209, minor number of 0 (you should also check the include/linux/major.h). If you haven't created the deviec yet, do:
# mknod /dev/iotrace c 209 0
There are three user-space tools: iotrace_util, iotrace_syphon, and iotrace_parse. Just do "make" to build them. Copying the files to /usr/bin is manual and optional.
I'll explain the use of these tools in more detail later.
Boot the kernel. Do:
# iotrace_util [-fDEVNAME] start /dev/sda2
where /dev/sda2 is the name of the device (partition) you want to trace. Option DEVNAME specifies the iotrace device name, which defaults to /dev/iotrace. The iotrace should accept any block device as the trace target. If you find any problem, please let me know the specific device type.
Currently, you can trace only one block device at a time.
To stop tracing, do
# iotrace_util [-fDEVNAME] stop
# cat /dev/iotrace >blah # iotrace_parse blah
The iotrace log buffer size is, by default, 16MB. Without MD5 fingerprints, it should be enough to hold more than a half million I/O requests, with MD5 fingerprints, it should be enough to hold ~100,000 requests. The log buffer is constructed as a ring buffer. When the log overflows, unread I/O records are erased in a FIFO manner.
It's defined in iotrace.h. You should also read iotrace_parse.cc.
Yasushi Saito Last updated: Oct 29, 2004.