linux-btrace.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Mason <clm@fb.com>
To: linux-btrace@vger.kernel.org
Subject: Re: Events out of order
Date: Wed, 31 Dec 2014 14:58:24 +0000	[thread overview]
Message-ID: <1420037904.2705.0@mail.thefacebook.com> (raw)
In-Reply-To: <54A355D2.5060704@ubuntu.com>

On Wed, Dec 31, 2014 at 9:36 AM, Phillip Susi <psusi@ubuntu.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 12/30/2014 11:29 PM, Alireza Haghdoost wrote:
>>  Seems to me like you don't run blktrace and blkparse
>>  appropriately. blktrace stores IO trace in multiple files where
>>  each file is associated to a CPU core. However, you force the
>>  output of blktrace to redirect into a single file. This make some
>>  timing Confusion for blkparse in the next step. You are using live
>>  blkparse option (-i -) inappropriately. If you want to run live
>>  blkparse, you need to feed it through blktrace pipe. Like:
>>  #blktrace -d /dev/sda -o - | blkparse -i -
>> 
>>  If you want to store trace in a file then parse it offline, you
>>  need to use --input option of blkparse.
> 
> Whether it is piped directly, or buffered in a file on disk makes no
> difference; blkparse sees exactly the same input byte for byte, and
> produces the same output.  The man page recommends this interactive
> method and doesn't mention that it borks up the ordering, but I
> suppose I can try it the other way and see if that helps.  If the
> interactive method doesn't work correctly it should either be fixed or
> the man page should mention this and not recommend its use.

It's been a while since I looked at this, but looks like blkparse has a 
pipeline mode and a more exact mode.  In pipeline mode, it's really 
trying to get data to the screen quickly and without using a huge 
amount of resources.  In order to put things in order, it would need to 
buffer the entire stream before outputting anything.  So instead it 
works in chunks, which is what you're seeing.

It enables pipeline mode when the input file from -i is a pipe.  You'll 
get better results if you allow blktrace to output into a collection of 
files and pass the prefix to blkparse.

instead of blktrace -o - use blktrace -o prefix ; blkparse -i prefix

For multiple devices, iowatcher uses a directory to store all of them, 
which is easier.

If you really want a single file result, take the per-cpu files from 
blktrace, run them through blkparse and add -d dumpfile, which will 
sort and pack all the results into a single binary file.  It's 
compressable and you can then delete all the per-cpu files.

-chris




  parent reply	other threads:[~2014-12-31 14:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-31  1:48 Events out of order Phillip Susi
2014-12-31  1:51 ` Phillip Susi
2014-12-31  1:53 ` Alireza Haghdoost
2014-12-31  3:23 ` Phillip Susi
2014-12-31  4:29 ` Alireza Haghdoost
2014-12-31 14:36 ` Phillip Susi
2014-12-31 14:58 ` Chris Mason [this message]
2014-12-31 15:09 ` Phillip Susi
2014-12-31 15:19 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420037904.2705.0@mail.thefacebook.com \
    --to=clm@fb.com \
    --cc=linux-btrace@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).