summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-02-01Remove extraneous malloc in find_input routinesEric Sandeen
No point in malloc()ing space if we just immediately overwrite the pointer via strdup. That'll leak some space. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2012-02-01Close stream in 'I' switch handlingEric Sandeen
The file containing the list of devices was never closed after processing was complete. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2012-02-01Free pdu_buff on bad pdu path in process()Eric Sandeen
On this error path, pdu_buf was never freed. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2012-02-01Fix potential array overrun in act_to_strEric Sandeen
The acts[] array is only N_ACTS elements, so we should not ever set acts[N_ACTS] Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2012-02-01Check setvbuf return valueEric Sandeen
Check for setvbuf failure. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2012-01-31blktrace 1.0.4blktrace-1.0.4Jens Axboe
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2012-01-31Merge branch 'master' of ssh://brick.kernel.dk/data/git/blktraceJens Axboe
2012-01-31Fix for realloc bug and wrong error loggingMikulas Patocka
This patch fixes two bugs in blktrace. 1. realloc is called on a wrong memory address (glibc reports heap corruption if the user sends the output to a pipe, for example "blktrace /dev/sdc -o -"). 2. errno 0 is actually reported if debugfs is not mounted Mikulas Signed-off-by: Jens Axboe <axboe@kernel.dk>
2011-08-11blktrace 1.0.3blktrace-1.0.3Jens Axboe
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-08-11Add FLUSH/FUA supportNamhyung Kim
Add FLUSH/FUA support to blktrace. As FLUSH precedes WRITE and/or FUA follows WRITE, use the same 'F' flag for both cases and distinguish them by their (relative) position. The end results look like (other flags might be shown also): - WRITE: W - WRITE_FLUSH: FW - WRITE_FUA: WF - WRITE_FLUSH_FUA: FWF Note that we reuse TC_BARRIER due to lack of bit space of act_mask. Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-08-03Merge branch 'master' of ssh://router.home.kernel.dk/data/git/blktraceJens Axboe
2011-08-03blkparse: fix up incorrect pc write completion countJeff Moyer
I noticed in some traces that I was seeing summaries like the following: Total (sde): Reads Queued: 76, 304KiB Writes Queued: 16,384, 1,048MiB Read Dispatches: 76, 304KiB Write Dispatches: 2,210, 1,048MiB Reads Requeued: 0 Writes Requeued: 0 Reads Completed: 76, 304KiB Writes Completed: 2,210, 1,048MiB Read Merges: 0, 0KiB Write Merges: 14,174, 907,136KiB PC Reads Queued: 0, 0KiB PC Writes Queued: 0, 0KiB PC Read Disp.: 4, 0KiB PC Write Disp.: 0, 0KiB PC Reads Req.: 0 PC Writes Req.: 0 PC Reads Compl.: 4 PC Writes Compl.: 2,210 IO unplugs: 2,124 Timer unplugs: 0 Note how there were no PC Writes dispatched, but there were 2210 completed. It turns out to be a minor typo in the code. The attached patch fixes the reporting for me. Signed-off-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-05-26blktrace: Use be32_to_cpu for blk_io_trace->cpu.Tao Ma
blk_io_trace->cpu is u32, so use be32_to_cpu instead. Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
2011-05-26blkparse: Avoid segfault for wrong cpu number.Tao Ma
Currently we only check the magic number to see whether a blktrace is valid or not, but Bill Broadley did meet with a case that the cpu info is wrong with a number of 1725552676. So in resize_cpu_info, we meet with a overflow when calculating size = new_count * sizeof(struct per_cpu_info); And the program will be either segfault or has the error of out of memory. Although this is more likely a kernel problem, the blkparse shoudn't segfault for it. So this patch just check whether the cpu stored in the trace is the same as the file, if not, just warn it out and skip it. Cc: Jens Axboe <axboe@kernel.dk> Reported-by: Bill Broadley <bill@broadley.org> Signed-off-by: Tao Ma <boyu.mt@taobao.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
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>