summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-10-07 10:58:16 +0200
committerJens Axboe <axboe@suse.de>2005-10-07 10:58:16 +0200
commitb6dc7d6ecf5bb181dd00a7c230c1a8d6e9b35c77 (patch)
treea9d538e78873d3b01c984968b71e7c3314734f0c /doc
parent1d6376a5e39ed9d13969f4217da386e49e028906 (diff)
downloadblktrace-b6dc7d6ecf5bb181dd00a7c230c1a8d6e9b35c77.tar.gz
blktrace-b6dc7d6ecf5bb181dd00a7c230c1a8d6e9b35c77.tar.bz2
[PATCH] doc: add example of PC command tracing
Diffstat (limited to 'doc')
-rw-r--r--doc/blktrace.tex34
1 files changed, 34 insertions, 0 deletions
diff --git a/doc/blktrace.tex b/doc/blktrace.tex
index f6280a7..5e47c01 100644
--- a/doc/blktrace.tex
+++ b/doc/blktrace.tex
@@ -181,6 +181,40 @@ Total (8,0):
Events (8,0): 89 entries, 0 skips
\end{verbatim}
+A \emph{btrace} script is included in the distribution to ease live
+tracing of devices. The above could also be accomplished by issuing:
+
+\begin{verbatim}
+% btrace /dev/sda
+\end{verbatim}
+
+By default, \emph{btrace} runs the trace in quiet mode so it will not
+include statistics when you break the run. Add the \emph{-S} option to
+get that dumped as well.
+
+\subsection{\label{sec:pc-blktrace}blktrace -- SCSI commands}
+
+The previous section showed typical file system io actions, but blktrace
+can also show SCSI commands going in and out of the queue as submitted
+by applications using the SCSI Generic (\emph{sg}) interface.
+
+\begin{verbatim}
+% btrace /dev/cdrom
+[...]
+ 3,0 0 25 0.004884107 13528 G R 0 + 0 [inquiry]
+ 3,0 0 26 0.004890361 13528 I R 56 (12 00 00 00 38 ..) [inquiry]
+ 3,0 0 27 0.004891223 13528 P R [inquiry]
+ 3,0 0 28 0.004893250 13528 D R 56 (12 00 00 00 38 ..) [inquiry]
+ 3,0 0 29 0.005344910 0 C R (12 00 00 00 38 ..) [0]
+\end{verbatim}
+
+Here we see a program issuing an INQUIRY command to the CDROM device.
+The program requested a read of 56 bytes of data, the CDB is included
+in parenthesis after the data length. The completion event shows shows
+that the command completed successfully. Tracing SCSI commands can be
+very useful for debugging problems with programs talking directly to the
+device. An example of that would be \emph{cdrecord} burning.
+
\subsection{\label{sec:blktrace-post}blktrace -- post-processing}
Another way to run blktrace is to have blktrace save data away for later