summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-03-16blktrace 1.0.2blktrace-1.0.2Jens Axboe
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-03-16blktrace: Document default values for -b and -nJustin TerAvest
To help users better deal with the log message "You have dropped events, consider using a larger buffer size (-b)", it's helpful to list the defaults for sub buffer management, without flags. Signed-off-by: Justin TerAvest <teravest@google.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-02-09gitignore: add blkiomon to .gitignore.Tao Ma
Add blkiomon, btreplay/btrecord and btreplay/btreplay to .gitignore so that they don't show up in "Untracked files. Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2011-02-09blktrace: remove unused idx from devpath.Tao Ma
idx isn't used, so remove it. Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2011-02-09blktrace: break mlock in case of is_done.Tao Ma
In 38-rc2, there is a bug in mlock which will return error in mlock of blktrace(I have sent the corresponding patch to the lkml). So when we try to break the blktrace by "ctrl+c", mlock will loop forever and in the end, I have to use "kill -9" to kill it and then run "blktrace -k" to stop the tracer. I don't think it is good. How to reproduce it is simple: Use a 38-rc kernel, and run blktrace /dev/sdx then use "ctrl+c", it doesn't exit. So this patch adds the check for tp->is_done. In case of is_done is set, break mlock so that we don't deadloop in the mlock. In case of the real mlock error, I will let it to retry 10 times and it should succeed after 10 tries in case of tp->is_done. If tp isn't set or tp->is_done isn't set, it works like the original design. Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2011-01-14blkiomon: Fix an output errorTao Ma
When we give out some statistics in blkiomon, we don't consider the situation that the device has no correspoinding action. See if there is no disk read during the interval, the output in my box is like: sizes read (bytes): num 0, min -1, max 0, sum 0, squ 0, avg nan, var nan With the fix, now it looks like: sizes read (bytes): num 0, min -1, max 0, sum 0, squ 0, avg 0.0, var 0.0 Cc: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-01-11Merge branch 'master' of ssh://router.home.kernel.dk/data/git/blktraceJens Axboe
2011-01-11blkparse: Fix blktrace output pipe broken in the new kernelTao Ma
With the newest kernel(say 2.6.37, some older one should also have the similar problem), some cfq messages are added to blktrace, so it makes the old blkparse broken. See a simple example: 1. blktrace /dev/sdb -o -|blkparse -i - 2. Run the following command(/dev/sdb1 is mounted at /mnt/test_dir): dd if=/mnt/test_dir/test of=/dev/null bs=4k count=1 iflag=direct There are only 2 lines of output there: 8,16 0 1 0.000000000 13183 A R 114759 + 8 <- (8,17) 114696 8,16 0 2 0.000000491 13183 Q R 114759 + 8 [dd] And even we run a command line like: for((i=0;i<100;i++))do dd if=/mnt/ocfs2/test of=/dev/null bs=4k count=1 iflag=direct;done We are only given the same 2 lines of output. While the really one should look like: 8,16 0 1 0.000000000 13319 A R 114759 + 8 <- (8,17) 114696 8,16 0 2 0.000000376 13319 Q R 114759 + 8 [dd] 8,16 0 0 0.000005931 0 m N cfq13319 alloced 8,16 0 3 0.000006259 13319 G R 114759 + 8 [dd] 8,16 0 4 0.000007143 13319 P N [dd] 8,16 0 5 0.000007817 13319 I R 114759 + 8 [dd] 8,16 0 0 0.000008491 0 m N cfq13319 insert_request 8,16 0 0 0.000009029 0 m N cfq13319 add_to_rr ... The main reason is that in show_entries_rb, we test sequences every time, but actually with some messages like cfq, the sequence number is always 0 which makes the old sequence check refuses all the logs after it. So only check/store sequence number if it isn't a message. Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-11-29Fixed build warning for btreplayAlan D. Brunelle
btreplay.c:1332: warning: comparison between signed and unsigned integer expressions
2010-10-22blktrace: btt documentation updateEdward Shishkin
Fixup for RH bugzilla 595628. Document btt options: -m (--seeks-per-second); -X (--easy-parse-avgs). Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-10-22blktrace: btreplay man pages updateEdward Shishkin
Fixup for RH bugzilla 595623 Document btreplay option -x (--acc-factor) Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-10-22blktrace: blktrace documentation updateEdward Shishkin
Fixup for RH bugzilla 595620. Document undocumented blktrace options. Update the man pages. Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-10-22blktrace: blkparse documentation updateEdward Shishkin
Fixup for RH bugzilla 595615. Document blkparse options: -A, --set-mask, -a, --act-mask, -D. --input-directory Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-10-22blktrace: blkiomon documentation updateEdward Shishkin
Fixup for RH bugzilla 595419. Document blkiomon option -d (--dump-lldd). Add drv_data mask description to blktrace man page. Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-10-22blktrace: btrecord man pages fixupEdward Shishkin
Fix up for RH bugzilla 595413 Mistake in the man page for btrecord: documented option --input-base is unsupported, supported option --max-bunch-time is undocumented. Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2010-09-16blktrace: disallow -o when using multiple devicesAlan D. Brunelle
Document that "-o" does not work when specyfing multiple devices to blktrace, also: enforce this by stopping blktrace when one tries do do this. The technical reason why "-o" doesn't work with multiple devices is because we use multiple threads of execution - one per device/CPU pair - and each of them opens a file named "<prefix>.blktrace.<cpu>". With the "-o" all of the "<prefix>" values are the same - so multiple threads open the same file and try to do output. Not good. Without the "-o" we get unique files named: "<device>.blktrace.<cpu>" - as the tuple (<device>,<cpu>) is unique. Signed-off-by: Alan D. Brunelle <Alan.Brunelle@hp.com>
2010-04-20blktrace: disable kill option - take 2Edward Shishkin
Fixup for 513950. Problem: 'blktrace -d <device> -k' does not kill a running backgound trace. Executing 'blktrace -d <device> -k' for the second time results in "BLKTRACETEARDOWN: Invalid argument" message and then each run of blktrace on that machine prints the following output: BLKTRACESETUP: No such file or directory. The bug: The option -k results in clobbering information about running trace by kernel (blk_trace_remove), while resources (files open in debugfs by the running background blktrace) are not released. Solution: Update documentation: Undocument the non-working "kill" option. Advise to send SIGINT signall via kill(1) to the running background blktrace for its correct termination. Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-04-20blktrace: update blkiomon docEdward Shishkin
Fixup for 499398. Description of problem: blkiomon does not understand the output of blktrace when working with logical volume device (it is quiet, while working with physical device it prints IO statistics as expected). BUG (or design feature?): /dev/dm-* and /dev/md* don't see BLK_TC_COMPLETE actions: /* we need an older D trace and a younger C trace */ if (t_old->bit.action & BLK_TC_ACT(BLK_TC_ISSUE) && t_young->bit.action & BLK_TC_ACT(BLK_TC_COMPLETE)) { /* matching D and C traces - update statistics */ match++; blkiomon_account(&t_old->bit, &t_young->bit); blkiomon_free_trace(t_stored); return t; } Possible solution: Update documentation. Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-04-20blktrace: add back conversionEdward Shishkin
Fixup for bz 502889. Problem: when executing with /dev/cciss/foo (long path names) btreplay complains (No such file or directory). Bug: Missed back conversion of erscores to slashes. Solution: Convert underscores to slashes to restore device names that have larger paths. Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-04-20blktrace: print correct usageEdward Shishkin
Fixup for 498898: Problem: When somebody runs blktrace without parameters, it shows the usage message. The usage message suggests that version number "x.y.z" is a required parameter, which is not true. Solution: Don't print version number when running blktrace, blkparce, btt without parameters. Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-04-20blktrace: avoid device duplicationEdward Shishkin
Fixup for bz 501457. Problem: If the device list file contains the same device as supplied on the command line, blktrace stops immediately and further I/O tracing is impossible. Bug: device duplication in the devpaths ends with programm termination (BLKTRACESETUP ioctl returns error) while resources (open files in debugfs) are not released. Solution: Make sure devices are not duplicated in devpaths pool. Signed-off-by: Edward Shishkin <edward@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-04-19Merge branch 'master' of ssh://router.home.kernel.dk/data/git/blktraceJens Axboe
2010-04-19blkparse: exit with error if no tracefiles foundEric Sandeen
If no tracefiles are found, exit with non-0 status Resolves Red Hat Bugzilla #500118 Reported-by: Milos Malik <mmalik@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2010-03-22Fixed incorrect sizeof instead of strlen in btt/rstats.cAlan D. Brunelle
2010-03-22Corrected memory leak in btt/p_live.cAlan D. Brunelle
Forgot to free record when updating rather than adding.
2010-02-22add libpthread to btreplay/Makefile LIBSEric Sandeen
Fedora linking changes picked this up: /usr/bin/ld: btreplay.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5' /usr/bin/ld: note: 'pthread_create@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line See also https://bugzilla.redhat.com/show_bug.cgi?id=564775 Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-10-08btt: Added in I/O activity per device and system-wideAlan D. Brunelle
It now keeps track of I/O activity on a per-device basis (as well as a cumulative system-wide view). ``I/O activity'' is defined as defined as the time during which the device driver and device are activelty working on at least one I/O. Here's a sample output: ==================== I/O Active Period Information ==================== DEV | # Live Avg. Act Avg. !Act % Live ---------- | ---------- ------------- ------------- ------ (254, 0) | 0 0.000000000 0.000000000 0.00 ( 8, 17) | 0 0.000000000 0.000000000 0.00 ( 8, 16) | 29 0.909596815 0.094646263 90.87 ( 8, 33) | 0 0.000000000 0.000000000 0.00 ( 8, 32) | 168 0.097848226 0.068231948 59.06 ---------- | ---------- ------------- ------------- ------ Total Sys | 33 0.799808811 0.082334758 90.92 Also added a new btt -Z option that generates per-device and system-wide I/O activity data that can be plotted. Refer to the documentation updates (btt.1, btt.tex) for more information.
2009-10-08btt: better data file namingAlan D. Brunelle
More logical naming for .dat files created. Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com>
2009-09-01Merge branch 'master' of ssh://router.home.kernel.dk/data/git/blktraceJens Axboe
2009-09-01blkparse: allow stdout output with -d option (using '-' as the filename)Jens Axboe
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-08-14Added in running stats documentationAlan D. Brunelle
2009-08-14Added in running stats for bttAlan D. Brunelle
Create an overall system and per-device statistics file containing MB-per-second and I/Os-per-second values. Format for each file is first column contains an (integer) time stamp (seconds since start of run) and a (double) value. File names are: sys_mbps_fp.dat - system-wide mbps (for all devices watched, of course) sys_iops_fp.dat - I/Os per sec Each device watched will have a file with the device preceeding the _mbps or _iops section of the above file names.
2009-05-11Version 1.0.1blktrace-1.0.1Jens Axboe
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11blkrawverify: warn and return error if no traces are foundEric Sandeen
blkrawverify is prints no errors and returns success if the requested tracefiles aren't found: # blkrawverify foobar Verifying foobar # echo $? 0 With this change it's a bit more informative: # ./blkrawverify foobar Verifying foobar No tracefiles found for foobar # echo $? 1 Resolves Red Hat Bugzilla #499581 Reported-by: Milos Malik <mmalik@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11blkiomon manpage and usage reference invalid "msg-queue-name" optionEric Sandeen
the blkiomon usage text and man page reference a "msg-queue-name" option, but getopts is only looking for "msg-qeueue" - fix the docs to match the code. Reported-by: Milos Malik <mmalik@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11fix up btrace options & manpageEric Sandeen
The btrace script & man page didn't quite match for options, and the btrace script was missing a few options in the getopts specification (b&n). Also, there seems to be no such thing as a "summarize" option anywhere, so remove it. Reported-by: /Milos Malik <mmalik@redhat.com <mailto:mmalik@redhat.com>>/ Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11more manpage fixupsEric Sandeen
Fix various typos & inconsistencies in man pages. I think the manpages could use a general tidy-up, but this mostly fixes things which I'd consider "errors" vs. style issues. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11fix max-pkts option inconsistenciesEric Sandeen
This is for RH bug 498426, btrecord doesn't recognize --max-pkts and --max-packets cmd line options Usage text and some documentation references "--max-pkts" and the man page references "--max-packets" but the getopts code is looking for --max_pkts. I'm not sure if it's best to make the code match the majority of the docs, or fix the docs to match the code? This patch does the former, but I'm not picky if you want to go the other way :) Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11Converted to using the correct remap entriesAlan D. Brunelle
This follows the kernel changes to the blk_io_trace_remap structure to better align the names of the structure elements with the real intent of "from" and "to" (devices & sectors). See the kernel patches @ http://lkml.org/lkml/2009/4/30/340 http://lkml.org/lkml/2009/4/30/341 (Note: since the ABI order didn't change, old user code will work with the new kernel code & vice versa.) Signed-off-by: Alan D. Brunelle <alan.brunelle@hp.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-05-11blkiomon: fix unaligned accesses on ia64Martin Peschke
commit 7aa3ebcec011bfe9cc60d6476252c03376a37551 packed the blkiomon_stat structure so that traces from one arch could be analyzed on another (in truth only x86 is different, at least from x86_64/ia64/ppc/ppc64/s390/s390x) Moving the __u32 device member instead of a new padding field should be fine. Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-21fix off-by-one issues in blkiomon.hMartin Peschke
Fix two off-by-one issues. Last bucket of histogram was ommitted by mistake when being converted to big-endian or when being merged with another bucket. Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-21fix include statement in stats.hMartin Peschke
Some endianess conversion macros have been moved and the corresponding header file is gone. Need to adapt an include statement in stats.h. The compiler did not complain because blkiomon.c accidently included blktrace.h prior to stats.h. Introduced by blktrace rewrite which became version 2. Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-17handle race to mkdir at startupJeff Moyer
I ran into a problem when specifying -D dirname-that-doesnt-yet-exist. Blktrace would fail, spewing the following messages: [root@megadeth blktrace]# ./blktrace -d /dev/cciss/c0d1 -D ./2.6.30-rc2-cfq-local Destination dir ./2.6.30-rc2-cfq-local/ can't be made: 17/File exists Destination dir ./2.6.30-rc2-cfq-local/ can't be made: 17/File exists Destination dir ./2.6.30-rc2-cfq-local/ can't be made: 17/File exists Destination dir ./2.6.30-rc2-cfq-local/ can't be made: 17/File exists Destination dir ./2.6.30-rc2-cfq-local/ can't be made: 17/File exists FAILED to start thread on CPU 0: 1/Operation not permitted FAILED to start thread on CPU 4: 1/Operation not permitted FAILED to start thread on CPU 5: 1/Operation not permitted FAILED to start thread on CPU 6: 1/Operation not permitted FAILED to start thread on CPU 7: 1/Operation not permitted I tracked it down to the fact that there is no synchronization between threads when trying to create the output directory. The fix is simple, just allow the race to happen and detect it. It's not really worth putting in any extra synchronization. It looks like no place else in that startup path needs synchronization either. This patch fixes the issue for me. I tested it by running the very command that caused me headaches 100% of the time before. I also did a chattr +i on the directory and verified that it would really fail in the case where it couldn't create the directory. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-04-06Fixed plug/unplug logic in bttAlan D. Brunelle
Was not accounting for unplugged time due to timeout unplugs.
2009-04-02Working on fixing % time q pluggedAlan D. Brunelle
2009-03-26fix trivial typo in manpageEric Sandeen
Fix small typo as reported by Kent Baxley <kbaxley@redhat.com> in Red Hat Bug 489941 - tiny typo in blktrace manpage Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <axboe@carl.(none)>
2009-03-25Add NOTIFY to activity maskCarl Henrik Lunde
Allow masking in messages by using "-a notify". Signed-off-by: Carl Henrik Lunde <chlunde@ping.uio.no> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-03-23Blktrace failed to lock reader threads on the cpu used by the correspondingTom Zanussi
writer. This resulted in stale data being consumed when blktrace accidently read at a position that was being written to at the same time. This issue surfaced as "bad trace magic" warnings emitted by blktrace tools. The problem occured on an SMP System z machine. The patch fixes the issue. Signed-off-by: Martin Peschke <mpeschke@linux.vnet.ibm.com> Signed-off-by: Jens Axboe <axboe@carl.(none)>
2009-03-12Generate matplotlib plots for btt generated dataAlan D. Brunelle
btt_plot.py: Generate matplotlib plots for BTT generated data files Files handled: AQD - Average Queue Depth Running average of queue depths BNOS - Block numbers accessed Markers for each block Q2D - Queue to Issue latencies Running averages D2C - Issue to Complete latencies Running averages Q2C - Queue to Complete latencies Running averages Usage: btt_plot_aqd.py equivalent to: btt_plot.py -t aqd btt_plot_bnos.py equivalent to: btt_plot.py -t bnos btt_plot_q2d.py equivalent to: btt_plot.py -t q2d btt_plot_d2c.py equivalent to: btt_plot.py -t d2c btt_plot_q2c.py equivalent to: btt_plot.py -t q2c Arguments: [ -A | --generate-all ] Default: False [ -L | --no-legend ] Default: Legend table produced [ -o <file> | --output=<file> ] Default: <type>.png [ -T <string> | --title=<string> ] Default: Based upon <type> [ -v | --verbose ] Default: False <data-files...> The -A (--generate-all) argument is different: when this is specified, an attempt is made to generate default plots for all 5 types (aqd, bnos, q2d, d2c and q2c). It will find files with the appropriate suffix for each type ('aqd.dat' for example). If such files are found, a plot for that type will be made. The output file name will be the default for each type. The -L (--no-legend) option will be obeyed for all plots, but the -o (--output) and -T (--title) options will be ignored.
2009-02-18Merge branch 'master' of ssh://axboe@router.home.kernel.dk/data/git/blktraceJens Axboe