blkparse

Parse and display block I/O trace data

TLDR

Parse and display blktrace output for a device
$ blkparse [sda]
Parse multiple devices
$ blkparse [sda] [sdb]
Parse from stdin (live mode with blktrace)
$ blktrace -d [/dev/sda] -o - | blkparse -i -
Output to a file
$ blkparse [sda] -o [output.txt]
Show specific output fields
$ blkparse -f "%D %a %S %n\n" [sda]
Parse with quiet output (summary only)
$ blkparse -q [sda]

SYNOPSIS

blkparse [options] [device...]

DESCRIPTION

blkparse produces formatted output from event streams recorded by blktrace. It combines event streams from multiple CPUs and devices, converting machine-readable trace data into human-readable format.The tool is essential for analyzing block I/O patterns, debugging storage performance issues, and understanding how the Linux I/O scheduler processes requests.

PARAMETERS

-i file

Base name for input files (default device.blktrace.cpu); use "-" for live stdin
-o file
Output file (default: stdout)
-D dir
Prepend this directory to the input file names
-d file
Dump a merged binary event stream to file
-f format
Custom output format string for all events
-F typ,format
Output format string for a specific event type
-q
Quiet mode; only print summary at end
-s
Show per-program (per-process) statistics
-t
Track I/O timing; display time deltas per I/O
-w span
Limit output to a time window; end or start:end in nanoseconds
-a mask
Add mask to the current trace action filter
-A hexmask
Set the trace action filter to hexmask
-v
More verbose output

TRACE ACTIONS

Q - Queued: Intent to queue I/O notedI - Inserted: Request sent to I/O schedulerD - Issued: Request sent to driverC - Complete: Request completedM - Back merge: Request merged with existingF - Front merge: Request merged at frontP - Plug: Queue pluggedU - Unplug: Queue unplugged

INSTALL

sudo apt install blktrace
sudo dnf install blktrace
sudo zypper install blktrace
nix profile install nixpkgs#blktrace

CAVEATS

Requires trace data from blktrace to function. Trace files can become very large for busy systems. Running blktrace requires root privileges. Output can be overwhelming; use format options to limit fields.

HISTORY

blkparse was written by Jens Axboe, Alan D. Brunelle, and Nathan Scott as part of the blktrace toolkit. It was developed to provide detailed I/O tracing capabilities for Linux storage subsystem analysis and debugging.

SEE ALSO

blktrace(8), btrace(8), btt(1), iostat(1)

RESOURCES

Source code