blktrace - generate traces of the i/o traffic on block devices

sudo blktrace -d /dev/sda -o - | blkparse -i -
blktrace is a block layer IO tracing mechanism which provide detailed information about request queue operations up to user space. blkparse will combine streams of events for various devices on various CPUs, and produce a formatted output the the event information. It take the output of above tool blktrace and convert those information into fency readable form.
Sample Output
  8,0    1      307    16.300038018   364  G WFS 214877536 + 8 [dmcrypt_write]
  8,0    1      308    16.300038546   364  P   N [dmcrypt_write]
  8,0    1      309    16.300039823   364  I WFS 214877536 + 8 [dmcrypt_write]
  8,0    1      310    16.300040693   364  U   N [dmcrypt_write] 1
  8,0    1      311    16.300041212   364  D  WS 214877536 + 8 [dmcrypt_write]
  8,0    6     6055    16.743540891     0  C   R 581944 + 8 [0]
  8,0    7      478    16.743294229  1394  A   R 581944 + 8 <- (8,5) 80184
  8,0    7      479    16.743295236  1394  Q   R 581944 + 8 [ls]
  8,0    7      480    16.743300616  1394  G   R 581944 + 8 [ls]
  8,0    7      481    16.743302315  1394  I   R 581944 + 8 [ls]
  8,0    7      482    16.743304891  1394  D   R 581944 + 8 [ls]
  8,0    6     6056    18.155362789  1532  C   W 200588584 + 8 [0]
  8,0    1      312    18.155288246   364  A   W 200588584 + 8 <- (8,5) 200086824
  8,0    1      313    18.155289363   364  Q   W 200588584 + 8 [dmcrypt_write]
  8,0    1      314    18.155296277   364  G   W 200588584 + 8 [dmcrypt_write]
  8,0    1      315    18.155297452   364  P   N [dmcrypt_write]
  8,0    1      316    18.155299709   364  I   W 200588584 + 8 [dmcrypt_write]
  8,0    1      317    18.155300975   364  U   N [dmcrypt_write] 1
  8,0    1      318    18.155302739   364  D   W 200588584 + 8 [dmcrypt_write]
  8,0    0        1 1266874889.707513405   364  A  WS 214877096 + 8 <- (8,5) 214375336
  8,0    0        2 1266874889.707514373   364  Q  WS 214877096 + 8 [dmcrypt_write]
  8,0    0        3 1266874889.707518565   364  G  WS 214877096 + 8 [dmcrypt_write]
  8,0    0        4 1266874889.707519046   364  P   N [dmcrypt_write]
  8,0    0        5 1266874889.707519640   364  A  WS 214877104 + 8 <- (8,5) 214375344
  8,0    0        6 1266874889.707519776   364  Q  WS 214877104 + 8 [dmcrypt_write]
  8,0    0        7 1266874889.707521386   364  M  WS 214877104 + 8 [dmcrypt_write]
  8,0    0        8 1266874889.707521635   364  A  WS 214877112 + 8 <- (8,5) 214375352
  8,0    0        9 1266874889.707522030   364  Q  WS 214877112 + 8 [dmcrypt_write]
  8,0    0       10 1266874889.707522365   364  M  WS 214877112 + 8 [dmcrypt_write]
  8,0    0       11 1266874889.707522530   364  A  WS 214877120 + 8 <- (8,5) 214375360
  8,0    0       12 1266874889.707522636   364  Q  WS 214877120 + 8 [dmcrypt_write]
  8,0    0       13 1266874889.707522845   364  M  WS 214877120 + 8 [dmcrypt_write]
  8,0    0       14 1266874889.707522975   364  A  WS 214877128 + 8 <- (8,5) 214375368
  8,0    0       15 1266874889.707523072   364  Q  WS 214877128 + 8 [dmcrypt_write]
  8,0    0       16 1266874889.707523245   364  M  WS 214877128 + 8 [dmcrypt_write]
  8,0    0       17 1266874889.707524366   364  I  WS 214877096 + 40 [dmcrypt_write]
  8,0    0       18 1266874889.707525418   364  U   N [dmcrypt_write] 1
  8,0    0       19 1266874889.707526516   364  D  WS 214877096 + 40 [dmcrypt_write]
CPU0 (8,0):
 Reads Queued:         303,     1212KiB	 Writes Queued:         752,     3464KiB
 Read Dispatches:      277,     1196KiB	 Write Dispatches:       68,      272KiB
 Reads Requeued:         0		 Writes Requeued:        26
 Reads Completed:        0,        0KiB	 Writes Completed:        0,        0KiB
 Read Merges:           22,       88KiB	 Write Merges:          264,     1056KiB
 Read depth:           576        	 Write depth:            36
 IO unplugs:            42        	 Timer unplugs:          11

1
By: emphazer
2019-07-02 06:13:58

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: