Content-type: text/html Manpage of IOTRACE

IOTRACE

Section: Misc. Reference Manual Pages (4)
Updated: Oct 2004
Index Return to Main Contents

 

NAME

iotrace - Disk I/O tracing utility for Linux

 

SYNOPSIS

iotrace_util [options] start DEVICE

iotrace_util [options] stop

iotrace_syphon

 

DESCRIPTION

The iotrace facility allows tracing low-level disk I/O requests. The trace contains the following information:

    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.

 

PATCHING AND INSTALLING THE KERNEL

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

 

INSTALLING THE USER-SPACE TOOLS

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.

iotrace_util
This program is used to control the iotrace device. issues ioctl to the iotrace device to start and stop tracing, or inspect the status of the device.

iotrace_parse
This is a sample program that dumps the iotrace log contents in a human-readable manner.

iotrace_syphon
This is a daemon program that reads data from /dev/iotrace continuously and copies it to /var/log/iotrace/DATE. It is supposed to be started in an rc script.

I'll explain the use of these tools in more detail later.

 

STARTING AND STOPPING

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

 

READING THE LOG CONTENTS

   # 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.

 

LOG RECORD FORMAT

It's defined in iotrace.h. You should also read iotrace_parse.cc.

 

SEE ALSO

iotrace_util(1), iotrace_parse(1), iotrace_syphon(1)

 

AUTHOR

Yasushi Saito Last updated: Oct 29, 2004.


 

Index

NAME
SYNOPSIS
DESCRIPTION
PATCHING AND INSTALLING THE KERNEL
INSTALLING THE USER-SPACE TOOLS
STARTING AND STOPPING
READING THE LOG CONTENTS
LOG RECORD FORMAT
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 23:31:10 GMT, October 29, 2004