blktrace.git
9 years agoiowatcher: Remove duplicate defines from blkparse.c
Jan Kara [Thu, 4 Apr 2013 10:18:26 +0000 (06:18 -0400)]
iowatcher: Remove duplicate defines from blkparse.c

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Skip events beyond max_seconds
Jan Kara [Thu, 4 Apr 2013 10:18:25 +0000 (06:18 -0400)]
iowatcher: Skip events beyond max_seconds

Skip events beyond max_seconds.  This not only saves CPU time but also
prevents memory corruption because not all functions were checking that
given time is in the expected range. Also remove now unnecessary checks
in the called functions.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Do not add events out of time range to the plot
Jan Kara [Thu, 4 Apr 2013 10:18:24 +0000 (06:18 -0400)]
iowatcher: Do not add events out of time range to the plot

If the event is out of time range that should be plotted, do not add it.
It will corrupt memory...

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Fine tune the ticks
Chris Mason [Tue, 24 Sep 2013 19:30:35 +0000 (15:30 -0400)]
iowatcher: Fine tune the ticks

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Update the README for a few new options
Chris Mason [Tue, 24 Sep 2013 19:30:23 +0000 (15:30 -0400)]
iowatcher: Update the README for a few new options

9 years agoiowatcher: Fix processing of trace filenames containing spaces
Andrew Price [Fri, 8 Nov 2013 10:06:54 +0000 (10:06 +0000)]
iowatcher: Fix processing of trace filenames containing spaces

blktrace_to_dump passes filenames containing spaces to blkparse via
system() so only the first chunk of the string is taken to be the
filename by the subprocess.

This switches to using posix_spawnp() so that we can present the
filename as an element of argv and avoid iowatcher failing in these
cases.

Signed-off-by: Andrew Price <anprice@redhat.com>
9 years agoiowatcher: Add bounds checking in find_step
Andrew Price [Wed, 6 Nov 2013 16:11:18 +0000 (16:11 +0000)]
iowatcher: Add bounds checking in find_step

Check the value of cur_mini_step is sane before using it as an index to
mini_step array.

Signed-off-by: Andrew Price <anprice@redhat.com>
9 years agoiowatcher: Fix a label overflow in plot_io
Andrew Price [Thu, 5 Sep 2013 16:35:04 +0000 (17:35 +0100)]
iowatcher: Fix a label overflow in plot_io

The length of the label option wasn't being checked before strcpy()ing
it into a char[256]. Use strncpy instead.

Signed-off-by: Andrew Price <anprice@redhat.com>
9 years agoiowatcher: Don't print a legend on the tput graphs during movies
Chris Mason [Mon, 21 Jan 2013 16:22:58 +0000 (11:22 -0500)]
iowatcher: Don't print a legend on the tput graphs during movies

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Update the FSF address in all files
Chris Mason [Mon, 21 Jan 2013 15:28:33 +0000 (10:28 -0500)]
iowatcher: Update the FSF address in all files

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Update the COPYING file to the correct address
Chris Mason [Mon, 21 Jan 2013 15:17:44 +0000 (10:17 -0500)]
iowatcher: Update the COPYING file to the correct address

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Add support for fio bandwith logs (-F logfile)
Chris Mason [Fri, 18 Jan 2013 16:08:39 +0000 (11:08 -0500)]
iowatcher: Add support for fio bandwith logs (-F logfile)

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Fix formatting errors in the iowatcher.1 man page.
Chris Mason [Thu, 17 Jan 2013 17:45:42 +0000 (12:45 -0500)]
iowatcher: Fix formatting errors in the iowatcher.1 man page.

Thanks to Andrew Price for sending me the corrected version

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Fix mpstat handling when the number of CPUs is not
Chris Mason [Thu, 17 Jan 2013 03:25:28 +0000 (22:25 -0500)]
iowatcher: Fix mpstat handling when the number of CPUs is not
in the mpstat output

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Handle traces to more than once device at a time
Chris Mason [Tue, 15 Jan 2013 01:59:06 +0000 (20:59 -0500)]
iowatcher: Handle traces to more than once device at a time

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: iowatcher: specify ffmpeg codec
Nikita Danilov [Wed, 19 Dec 2012 18:27:21 +0000 (11:27 -0700)]
iowatcher: iowatcher: specify ffmpeg codec

    Add -C option to specify ffmped video code to use.

    Allow ffmpeg video codec to be specified on the command line. "libx264" is
    default.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Add a man page for iowatcher
Andrew Price [Wed, 19 Dec 2012 18:54:45 +0000 (11:54 -0700)]
iowatcher: Add a man page for iowatcher

Adds a man page from iowatcher. Borrows some documentation from the
README file but covers all of the options found in main.c

Signed-off-by: Andrew Price <anprice@redhat.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Fix spindle rotation in the movie mode
Chris Mason [Mon, 14 Jan 2013 21:05:13 +0000 (16:05 -0500)]
iowatcher: Fix spindle rotation in the movie mode

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Fix some rounding errors around the max offset
Chris Mason [Fri, 26 Oct 2012 19:23:40 +0000 (15:23 -0400)]
iowatcher: Fix some rounding errors around the max offset

set_gdd_bit makes sure that we don't try to set bits past the max offset
we used to allocate our gdd array.

But, it only does this when the function is first called, and the whole
byte range for the IO we're recording may go past max offset.  This adds
a check to be sure we stay in the right range.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Fix crash due to missing queue action
Jan Kara [Tue, 23 Oct 2012 09:05:31 +0000 (11:05 +0200)]
iowatcher: Fix crash due to missing queue action

When queue action was missing from a trace, handling of dispatch didn't
quite get things right and crashed due to NULL pointer dereference.
Fix it.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Add -K command line option to keep the movie svg files
Chris Mason [Mon, 22 Oct 2012 15:51:41 +0000 (11:51 -0400)]
iowatcher: Add -K command line option to keep the movie svg files

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Only hash IOs if there are completion or issue events
Chris Mason [Mon, 22 Oct 2012 15:22:55 +0000 (11:22 -0400)]
iowatcher: Only hash IOs if there are completion or issue events

We use an IO hash table to keep track of the IOs in flight, and this is
used to calculate the latencies from when we issue the IO to when
we complete the IO.

But if there are no completion events, io is never removed from the hash
table.  It grows very large and slows down the run.

Since we already scan all the events looking for outliers, this commit
checks for each major type of event during the scan.  If there are
no completion and no issue events, we don't bother inserting things
into the hash table.

If there are no completion events, we clean up during the issue event.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: iowatcher: support png2theora for videos
Eric Sandeen [Thu, 18 Oct 2012 21:42:38 +0000 (15:42 -0600)]
iowatcher: iowatcher: support png2theora for videos

ffmpeg is not available on all distributions, so include Theora
as an option, via png2theora, if the output movie filename ends
in .ogg or .ogv

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Fix path name handling when the trace files are in the current directory
Chris Mason [Wed, 17 Oct 2012 19:45:49 +0000 (15:45 -0400)]
iowatcher: Fix path name handling when the trace files are in the current directory

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: Fix buffer overwrite issue
Yuanhan Liu [Fri, 12 Oct 2012 16:09:29 +0000 (10:09 -0600)]
iowatcher: Fix buffer overwrite issue

Current code allocates buffer for path based on strdup, which would let
the size of path equals to the size of blktrace_dest_dir. But the code
next that joins it with the filename of dump file, which would overwrite
the buffer, and triggered an issue like following:

$ ./iowatcher -t trace.dump -o trace.svg
Unable to find trace file ./trace.dumpY
                                      ^

Refactoring join_path a bit to fix this issue.

Cc: Liu Bo <liub.liubo@gmail.com>
Signed-off-by: Yuanhan Liu <yliu.null@gmail.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agoiowatcher: add blktrace destination options
Liu Bo [Fri, 28 Sep 2012 03:55:14 +0000 (21:55 -0600)]
iowatcher: add blktrace destination options

Add 'D' for blktrace destination options so that we can save trace
in the destination directory.

Signed-off-by: Liu Bo <liub.liubo@gmail.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
9 years agosignal condition variable at end of stop_tracers
Robert Schiele [Mon, 8 Sep 2014 07:38:52 +0000 (09:38 +0200)]
signal condition variable at end of stop_tracers

stop_tracers modifies tp->is_done and thus must signal the condition
variable tracer_wait_unblock is waiting on to monitor tp->is_done.
Not doing so might cause the tool to deadlock if stop_tracers is
called while a tracer thread is in tracer_wait_unblock.

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoremove unused barrier.h
Riku Voipio [Fri, 11 Apr 2014 11:51:19 +0000 (14:51 +0300)]
remove unused barrier.h

While looking for things that needs porting for Aarch64,
barrier.h from blktrace was identified. However, a deeper
look shows that this file is not actually used anymore
in blktrace.

Remove unused file to avoid future confusion.

Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
10 years agoblktrace bno_plot.py: output comprehensive message when gnuplot not found
Eiichi Tsukata [Tue, 3 Dec 2013 12:04:59 +0000 (21:04 +0900)]
blktrace bno_plot.py: output comprehensive message when gnuplot not found

Currently, bno_plot.py uses os.execvp which does not show enough information
when executed command is not found. For example, when gnuplot is not found
bno_plot.py shows the following messages:

    Traceback (most recent call last):
      File "/usr/local/bin/bno_plot.py", line 123, in <module>
        os.execvp(cmd[0], cmd)
      File "/usr/lib64/python2.7/os.py", line 344, in execvp
        _execvpe(file, args)
      File "/usr/lib64/python2.7/os.py", line 368, in _execvpe
        func(file, *argrest)
    OSError: [Errno 2] No such file or directory

Users can't understand what happend directly from the message.

Instead of os.execvp, this patch uses os.system which shows the following
messages when gnuplot not found:

    sh: gnuplot: command not found

Signed-off-by: Eiichi Tsukata <devel@etsukata.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
10 years agoblktrace blkreplay: convert to use a dynamic cpu_set_t
Nathan Zimmer [Mon, 15 Apr 2013 14:53:36 +0000 (09:53 -0500)]
blktrace blkreplay: convert to use a dynamic cpu_set_t

Some distros have changed CPU_SETSIZE in glibc to 4096 since that matches
the NR_CPUS in the linux kernel config file.  Some distros have decided to
leave CPU_SETSIZE at 1024. This is a problem if you want to run that distro
on a very large machine.

CPU_SETSIZE is use by the struct cpu_set_t.  This means you to deal with cpus
greater the 1024 you must use the dynamic cpu sets, which involves converting
from things like CPU_SET to CPU_SET_S.

Cc: Jens Axboe <axboe@kernel.dk>
Modified by Jens to fix the CPU_{SET,ZERO}_S pointer mixup.

Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
10 years agoblktrace: use number of configured cpus instead of online cpus
Nathan Zimmer [Mon, 15 Apr 2013 14:53:35 +0000 (09:53 -0500)]
blktrace: use number of configured cpus instead of online cpus

We want to run on all online processors.  However is there is a hole in the
online cpumask this won't happen.  We need the number of configured processors
instead of online.

Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
10 years agobtreplay: use sysconf to get the number of configured cpus
Nathan Zimmer [Mon, 15 Apr 2013 14:53:34 +0000 (09:53 -0500)]
btreplay: use sysconf to get the number of configured cpus

We should use the standard methods for getting the number of cpus in the
system when they are available.  It is good practice to leave the old ways in
place for people stuck on older systems.

Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
10 years agobtreplay: Machines are now large enough that holes need to be dealt with
Nathan Zimmer [Mon, 15 Apr 2013 14:53:33 +0000 (09:53 -0500)]
btreplay: Machines are now large enough that holes need to be dealt with

The current method fails if once we hit the first offlined cpu.  This
will correct that case.  However this still underreports the number cpus if
the last cpu are offlined.

Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
10 years agoverify_blkparse: Change max_cpus to deal with systems larger the 512
Nathan Zimmer [Mon, 15 Apr 2013 14:53:32 +0000 (09:53 -0500)]
verify_blkparse: Change max_cpus to deal with systems larger the 512

verify_blkpars has troubles with systems larger then 512.
Also there is issue in the scanning code causing the cpu number to be
truncated to the first two digits. i.e cpu 542 would be read as 54.

Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoMore accurate calculation of the total read/write values
Ivan Dyukov [Tue, 19 Mar 2013 14:16:27 +0000 (08:16 -0600)]
More accurate calculation of the total read/write values

If block device has many request with size less than 1K,
blkparse ignores such requests because it treats each request
in Kb.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
11 years agoiowatcher: Per process IO graphs
Jan Kara [Mon, 10 Sep 2012 08:09:48 +0000 (10:09 +0200)]
iowatcher: Per process IO graphs

Add support for displaying different processes with different color in
the IO graph and movie.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Make sure we add the xtick labels if we're only plotting IO
Chris Mason [Fri, 21 Sep 2012 18:03:50 +0000 (14:03 -0400)]
iowatcher: Make sure we add the xtick labels if we're only plotting IO

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Merge branch 'jan'
Chris Mason [Tue, 11 Sep 2012 01:01:02 +0000 (21:01 -0400)]
iowatcher: Merge branch 'jan'

Jan Kara's updates for xzoom and yzoom

Conflicts:
main.c

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add option to set action which should be displayed in the IO graph
Jan Kara [Thu, 6 Sep 2012 16:23:05 +0000 (18:23 +0200)]
iowatcher: Add option to set action which should be displayed in the IO graph

Sometimes this is useful to see how IO scheduler or storage itself
changes the IO submitted by the application.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Improve xticks logic
Jan Kara [Thu, 6 Sep 2012 10:45:34 +0000 (12:45 +0200)]
iowatcher: Improve xticks logic

Ticks on x axis used integral step and fixed number of ticks. That generates
wrong results e.g. for 13s long trace with 10 ticks... Allow the code to
somewhat alter the number of ticks and also use non-integral step.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add options to limit time and sector range
Jan Kara [Fri, 31 Aug 2012 09:37:49 +0000 (11:37 +0200)]
iowatcher: Add options to limit time and sector range

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Ignore trace records beyond max_seconds
Jan Kara [Thu, 6 Sep 2012 08:14:59 +0000 (10:14 +0200)]
iowatcher: Ignore trace records beyond max_seconds

Currently we report error when we find a trace record beyond max_seconds.
When we allow user to set end of displayed period, records after the end
of period are no longer a bug so just ignore them.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add possibility to limit seconds from below
Jan Kara [Wed, 5 Sep 2012 21:01:08 +0000 (23:01 +0200)]
iowatcher: Add possibility to limit seconds from below

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Rename seconds to max_seconds
Jan Kara [Wed, 5 Sep 2012 20:08:24 +0000 (22:08 +0200)]
iowatcher: Rename seconds to max_seconds

Later we will add min_seconds to complement this.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add support for limitting IO graph offset from below
Jan Kara [Sat, 1 Sep 2012 21:31:46 +0000 (23:31 +0200)]
iowatcher: Add support for limitting IO graph offset from below

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Fix filtering of outliers from below
Jan Kara [Sat, 1 Sep 2012 21:37:20 +0000 (23:37 +0200)]
iowatcher: Fix filtering of outliers from below

There are lots of trace actions which do not carry a sector with them (e.g.
plug, unplug, ...). Thus sector is 0 for them and that results in trimming
of outliers from below never working. Fix the problem by accounting only
Queue events in the outlier statistics.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Define mask of trace action and use it instead of opencoding the constant
Jan Kara [Sat, 1 Sep 2012 21:35:55 +0000 (23:35 +0200)]
iowatcher: Define mask of trace action and use it instead of opencoding the constant

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Fix typo in option description
Jan Kara [Thu, 30 Aug 2012 13:59:01 +0000 (15:59 +0200)]
iowatcher: Fix typo in option description

Short variant of --movie is -m, not -p.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Check for null mpstat structs while generating plots
Chris Mason [Fri, 31 Aug 2012 00:42:30 +0000 (20:42 -0400)]
iowatcher: Check for null mpstat structs while generating plots

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add -c to split the graphs up into multiple columns
Chris Mason [Tue, 28 Aug 2012 06:15:11 +0000 (02:15 -0400)]
iowatcher: Add -c to split the graphs up into multiple columns

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Fix divide by zero while calculating averages
Chris Mason [Mon, 27 Aug 2012 22:27:59 +0000 (18:27 -0400)]
iowatcher: Fix divide by zero while calculating averages

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Update the README and the --help output
Chris Mason [Mon, 27 Aug 2012 22:09:57 +0000 (18:09 -0400)]
iowatcher: Update the README and the --help output

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Start support for multiple colums of plots
Chris Mason [Mon, 27 Aug 2012 21:39:58 +0000 (17:39 -0400)]
iowatcher: Start support for multiple colums of plots

The movie mode is updated to put extra plots on
the side.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Fix io line graphs at the edge of the X axis
Chris Mason [Mon, 27 Aug 2012 17:00:30 +0000 (13:00 -0400)]
iowatcher: Fix io line graphs at the edge of the X axis

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Fix the line graphs for values near the edges of the graph
Chris Mason [Mon, 27 Aug 2012 16:53:51 +0000 (12:53 -0400)]
iowatcher: Fix the line graphs for values near the edges of the graph

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Fix mpstat file permissions
Chris Mason [Mon, 27 Aug 2012 16:22:28 +0000 (12:22 -0400)]
iowatcher: Fix mpstat file permissions

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add initial support for flash tracing
Chris Mason [Fri, 24 Aug 2012 18:31:29 +0000 (14:31 -0400)]
iowatcher: Add initial support for flash tracing

This is incomplete, but it will catch messages from
the flash driver to find the actual chip an IO
was sent to.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add a new movie mode that maps the IOs onto a platter.
Chris Mason [Tue, 21 Aug 2012 19:19:35 +0000 (15:19 -0400)]
iowatcher: Add a new movie mode that maps the IOs onto a platter.

The --movie option defaults to spindle mode now,
but you can choose --movie=rect or --movie=spindle
as well.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Switch to ffmpeg for movie encoding. Chrome and vlc like these better.
Chris Mason [Tue, 21 Aug 2012 13:18:15 +0000 (09:18 -0400)]
iowatcher: Switch to ffmpeg for movie encoding.  Chrome and vlc like these better.

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add back missing plot title
Chris Mason [Mon, 20 Aug 2012 20:15:55 +0000 (16:15 -0400)]
iowatcher: Add back missing plot title

11 years agoiowatcher: Fix --help definition
Chris Mason [Mon, 20 Aug 2012 19:30:38 +0000 (15:30 -0400)]
iowatcher: Fix --help definition

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add mpstat.[ch] into git
Chris Mason [Mon, 20 Aug 2012 18:36:19 +0000 (14:36 -0400)]
iowatcher: Add mpstat.[ch] into git

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add movie support
Chris Mason [Fri, 17 Aug 2012 16:18:28 +0000 (12:18 -0400)]
iowatcher: Add movie support

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Add mpstat graphing support
Chris Mason [Thu, 16 Aug 2012 18:46:33 +0000 (14:46 -0400)]
iowatcher: Add mpstat graphing support

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
11 years agoiowatcher: Initial revision
Chris Mason [Wed, 15 Aug 2012 20:10:55 +0000 (16:10 -0400)]
iowatcher: Initial revision

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
12 years agoblktrace 1.0.5 origin blktrace-1.0.5
Jens Axboe [Mon, 27 Feb 2012 07:22:17 +0000 (08:22 +0100)]
blktrace 1.0.5

Signed-off-by: Jens Axboe <axboe@kernel.dk>
12 years agoToo small arrays for file names
Vasily Tarasov [Mon, 27 Feb 2012 07:21:11 +0000 (08:21 +0100)]
Too small arrays for file names

In our experiments blktrace/blkparse file names encode a lot of
infomation about the particular experiment.  We noticed that for long
enough file names blkparse does not work.

The reason is that per_cpu_info->fname[] is of 128 bytes. As a result,
in setup_file() function only part of the file name gets to ->fname[].
Then stat() fails and we exit the function. Notice, that no error is
printed in this case.

In the following patch ->fname[] size is increased to POSIX defined
PATH_MAX.

Signed-off-by: Vasily Tarasov <tarasov@vasily.name
Signed-off-by: Jens Axboe <axboe@kernel.dk>
12 years agoFix compiler warnings
Jens Axboe [Wed, 1 Feb 2012 12:17:57 +0000 (13:17 +0100)]
Fix compiler warnings

One was a real bug, assigned i_time twice instead of c_time (which was
left unitialized).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
12 years agoavoid string overflows
Eric Sandeen [Fri, 16 Dec 2011 19:36:56 +0000 (13:36 -0600)]
avoid string overflows

Several places using strcpy would benefit from strncpy
for safety.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
12 years agoblktrace: remove unused variable
Eric Sandeen [Fri, 16 Dec 2011 19:27:33 +0000 (13:27 -0600)]
blktrace: remove unused variable

sp was being incremented w/o initialization, but thankfully
not used otherwise.  Just remove it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
12 years agoblkparse: initialize cpu_map
Eric Sandeen [Fri, 16 Dec 2011 19:25:16 +0000 (13:25 -0600)]
blkparse: initialize cpu_map

We malloc'd cpu_map, and then did:

cpu_map[CPU_IDX(cpu)] |= (1UL << CPU_BIT(cpu));

... not sure how that ever worked if cpu_map was not initialized!

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
12 years agobtt: close devmap file after processing
Eric Sandeen [Fri, 16 Dec 2011 19:17:52 +0000 (13:17 -0600)]
btt: close devmap file after processing

Close the file used for btt's -M argument after
processing.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
12 years agoFix several leaks on error paths
Eric Sandeen [Fri, 16 Dec 2011 19:15:54 +0000 (13:15 -0600)]
Fix several leaks on error paths

In several cases space is allocated for a filename but
not freed if open of that file fails.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
12 years agoRemove extraneous malloc in find_input routines
Eric Sandeen [Fri, 16 Dec 2011 19:13:21 +0000 (13:13 -0600)]
Remove extraneous malloc in find_input routines

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>
12 years agoClose stream in 'I' switch handling
Eric Sandeen [Fri, 16 Dec 2011 19:11:33 +0000 (13:11 -0600)]
Close stream in 'I' switch handling

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>
12 years agoFree pdu_buff on bad pdu path in process()
Eric Sandeen [Fri, 16 Dec 2011 19:08:14 +0000 (13:08 -0600)]
Free pdu_buff on bad pdu path in process()

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>
12 years agoFix potential array overrun in act_to_str
Eric Sandeen [Fri, 16 Dec 2011 19:06:31 +0000 (13:06 -0600)]
Fix potential array overrun in act_to_str

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>
12 years agoCheck setvbuf return value
Eric Sandeen [Fri, 16 Dec 2011 19:05:02 +0000 (13:05 -0600)]
Check setvbuf return value

Check for setvbuf failure.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
12 years agoblktrace 1.0.4 blktrace-1.0.4
Jens Axboe [Tue, 31 Jan 2012 09:53:21 +0000 (10:53 +0100)]
blktrace 1.0.4

Signed-off-by: Jens Axboe <axboe@kernel.dk>
12 years agoMerge branch 'master' of ssh://brick.kernel.dk/data/git/blktrace
Jens Axboe [Tue, 31 Jan 2012 09:52:25 +0000 (10:52 +0100)]
Merge branch 'master' of ssh://brick.kernel.dk/data/git/blktrace

12 years agoFix for realloc bug and wrong error logging
Mikulas Patocka [Tue, 31 Jan 2012 09:51:50 +0000 (10:51 +0100)]
Fix for realloc bug and wrong error logging

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>
12 years agoblktrace 1.0.3 blktrace-1.0.3
Jens Axboe [Thu, 11 Aug 2011 10:49:08 +0000 (12:49 +0200)]
blktrace 1.0.3

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
12 years agoAdd FLUSH/FUA support
Namhyung Kim [Thu, 11 Aug 2011 10:48:07 +0000 (12:48 +0200)]
Add FLUSH/FUA support

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>
12 years agoMerge branch 'master' of ssh://router.home.kernel.dk/data/git/blktrace
Jens Axboe [Wed, 3 Aug 2011 13:06:18 +0000 (15:06 +0200)]
Merge branch 'master' of ssh://router.home.kernel.dk/data/git/blktrace

12 years agoblkparse: fix up incorrect pc write completion count
Jeff Moyer [Wed, 3 Aug 2011 13:05:55 +0000 (15:05 +0200)]
blkparse: fix up incorrect pc write completion count

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>
13 years agoblktrace: Use be32_to_cpu for blk_io_trace->cpu.
Tao Ma [Thu, 26 May 2011 19:11:09 +0000 (21:11 +0200)]
blktrace: Use be32_to_cpu for blk_io_trace->cpu.

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>
13 years agoblkparse: Avoid segfault for wrong cpu number.
Tao Ma [Thu, 26 May 2011 19:11:07 +0000 (21:11 +0200)]
blkparse: Avoid segfault for wrong cpu number.

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>
13 years agoblktrace 1.0.2 blktrace-1.0.2
Jens Axboe [Wed, 16 Mar 2011 08:06:30 +0000 (09:06 +0100)]
blktrace 1.0.2

Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
13 years agoblktrace: Document default values for -b and -n
Justin TerAvest [Wed, 16 Mar 2011 08:05:09 +0000 (09:05 +0100)]
blktrace: Document default values for -b and -n

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>
13 years agogitignore: add blkiomon to .gitignore.
Tao Ma [Wed, 9 Feb 2011 09:22:39 +0000 (10:22 +0100)]
gitignore: add blkiomon to .gitignore.

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>
13 years agoblktrace: remove unused idx from devpath.
Tao Ma [Wed, 9 Feb 2011 09:22:39 +0000 (10:22 +0100)]
blktrace: remove unused idx from devpath.

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>
13 years agoblktrace: break mlock in case of is_done.
Tao Ma [Wed, 9 Feb 2011 09:22:39 +0000 (10:22 +0100)]
blktrace: break mlock in case of is_done.

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>
13 years agoblkiomon: Fix an output error
Tao Ma [Fri, 14 Jan 2011 08:06:03 +0000 (09:06 +0100)]
blkiomon: Fix an output error

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>
13 years agoMerge branch 'master' of ssh://router.home.kernel.dk/data/git/blktrace
Jens Axboe [Tue, 11 Jan 2011 07:36:21 +0000 (08:36 +0100)]
Merge branch 'master' of ssh://router.home.kernel.dk/data/git/blktrace

13 years agoblkparse: Fix blktrace output pipe broken in the new kernel
Tao Ma [Tue, 11 Jan 2011 07:35:56 +0000 (08:35 +0100)]
blkparse: Fix blktrace output pipe broken in the new kernel

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>
13 years agoFixed build warning for btreplay
Alan D. Brunelle [Mon, 29 Nov 2010 15:34:30 +0000 (10:34 -0500)]
Fixed build warning for btreplay

btreplay.c:1332: warning: comparison between signed and unsigned integer
expressions

13 years agoblktrace: btt documentation update
Edward Shishkin [Fri, 22 Oct 2010 18:52:29 +0000 (20:52 +0200)]
blktrace: btt documentation update

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>
13 years agoblktrace: btreplay man pages update
Edward Shishkin [Fri, 30 Jul 2010 14:05:04 +0000 (16:05 +0200)]
blktrace: btreplay man pages update

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>
13 years agoblktrace: blktrace documentation update
Edward Shishkin [Fri, 22 Oct 2010 18:51:22 +0000 (20:51 +0200)]
blktrace: blktrace documentation update

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>
13 years agoblktrace: blkparse documentation update
Edward Shishkin [Fri, 30 Jul 2010 14:04:36 +0000 (16:04 +0200)]
blktrace: blkparse documentation update

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>