Update the README for a few new options
Fine tune the ticks

Signed-off-by: Chris Mason <chris.mason@fusionio.com>
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>
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>
Remove duplicate defines from blkparse.c

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Make seconds unsigned

Compiler was giving some warnings about signed vs unsigned comparisons.
Although these were harmless, make seconds unsigned because they really
are.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Handle REQUEUE events

When requeue event happens we have to decrease number of in-flight
requests. Otherwise they drift away.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Merge Jan Kara's fixes
Fix up directory trace processing

Similar to the fix for spaces in file names in commit 5d845e3, this
patch fixes processing of directories with spaces in their names by
using posix_spawnp() to run the blkparse command instead of system(). In
doing so, combine_blktrace_devs() and match_trace() have been reworked
to use a list structure instead of doing a lot of strdup()ing and string
appending.

Also make sure that trailing slashes are removed from the directory name
before attempting to use it as the base of the .dump filename.

Update the -t entry in the manpage to mention directory behaviour, too.

Signed-off-by: Andrew Price <anprice@redhat.com>
Check program exit code properly

The return value of posix_spawnp() was being checked but the exit status
of the child process was being ignored. This adds checks and error
reporting based on the status that waitpid returns.

Signed-off-by: Andrew Price <anprice@redhat.com>
Merge trace dumping functions into one

Now that combine_blktrace_devs() takes a list of traces it's fairly
generic so we might as well merge blktrace_to_dump() into it. The latter
can be replaced with a call using a list with a single entry.

combine_blktrace_devs() is renamed dump_traces() because that's what it
does.

Also eradicate the big global char array 'line' that was being used in a
bunch of places along with some more unnecessary strdup()s.

Signed-off-by: Andrew Price <anprice@redhat.com>