path: root/doc
diff options
authorAlex Polvi <>2006-05-08 07:15:50 +0200
committerJens Axboe <>2006-05-08 07:15:50 +0200
commit38e1f0c68bb7a808d889e639530c69830d110f75 (patch)
tree8fe94b548b2d8650c58e722e8a92b695b218b7cb /doc
parent1452478f2d1b27916c7cba6e3976ed2129533c73 (diff)
[PATCH] blktrace.c should ignore SIGPIPE
After sending a SIGINT to a "blktrace .. | blkparse .. " pipeline, occasionally I would not be able to run blktrace again. On my next run of the same pipeline I would get the following error: cs411vm:/usr/src/bt# ./blktrace -d /dev/sdb -o - | ./blkparse -i - BLKTRACESETUP: No such file or directory Failed to start trace on /dev/sdb After rebooting, I could reproduce this by starting the pipeline, and kicking off a big write and sending a SIGINT to blktrace. The following is what I used for a write: while [ 1 ] do dd if=/dev/zero of=/test/write bs=1M done It seemed like blktrace was not handling signals correctly, so I strace'd the process to see what was happening. Sure enough: --- SIGINT (Interrupt) @ 0 (0) --- ioctl(3, 0x1275, 0xb7fa6000) = 0 sigreturn() = ? (mask now []) write(1, "O\0\0\0\20\0\200\0\0\0\0\0\0\0\0\0\7taeN3\1\0\257R\260"..., 4096) = -1 EPIPE (Broken pipe) --- SIGPIPE (Broken pipe) @ 0 (0) --- +++ killed by SIGPIPE +++ Any idea what clean-up is not happening? I tried to figure it out, but my only work-around was a reboot. My patch against 2.6.17-rc3 just tells blktrace to ignore SIGPIPE. Nothing crazy. :) blktrace already does enough error checking elsewhere to handle a bad write. On a completely unrelated note, the write_data function calls fwrite, which will not return -1 on error. Instead you'll need to use ferror to check if there was a problem. I'm not sure if this is a cause of any bugs, but it seemed worth mentioning. Furthermore, I updated the URLs in the documentation to point at a valid git repo.
Diffstat (limited to 'doc')
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/blktrace.tex b/doc/blktrace.tex
index 4c1c844..a81e2ee 100644
--- a/doc/blktrace.tex
+++ b/doc/blktrace.tex
@@ -51,7 +51,7 @@ three major components that are provided:
The blktrace and blkparse utilities and associated kernel patch are provided
as part of the following git repository:
+git:// bt
\newpage\section{\label{sec:quick-start}Quick Start Guide}
@@ -65,7 +65,7 @@ to your environment.
As noted above, the kernel patch along with the blktrace and blkparse utilities are stored in a git repository. One simple way to get going would be:
-% git clone rsync:// bt
+% git clone git:// bt
% cd bt
% git checkout