pub/scm/linux/kernel/git/axboe/blktrace.git  about / heads / tags
blktrace/parse repo
$ git log --pretty=format:'%h %s (%cs)%d'
b9ea6e5 doc: btrace: fix wrong format on doc (2024-01-17)
	(HEAD -> master)
7f5d2c5 blkparse: fix incorrectly sized memset in check_cpu_map (2021-10-21)
ac416ab blkparse: skip check_cpu_map with pipe input (2021-10-21)
3a1b136 blktrace: exit directly when nthreads_running != ncpus in run_tracers() (2021-06-28)
366d30b blktrace 1.3.0 (2021-06-14)
	(tag: blktrace-1.3.0)
dc24c67 blkparse: Print time when trace was started (2021-04-19)
2ec0bb0 blktrace: inclusive terminology (2021-02-19)
a021a33 blkparse: Print PID information for TN_MESSAGE events (2020-05-20)
f442a04 iowatcher: Handle cgroup information (2020-05-20)
2d6a688 iowatcher: Use blktrace_api.h (2020-05-20)
...

$ git cat-file blob HEAD:README
Block IO Tracing
----------------

Written by Jens Axboe <axboe@kernel.dk> (initial version and kernel support),
Alan D. Brunelle (threading and splitup into two seperate programs),
Nathan Scott <nathans@sgi.com> (bug fixes, process names, multiple devices)
Also thanks to Tom Zanussi <zanussi@us.ibm.com> for good input and
patches.


Requirements
------------

blktrace was integrated into the mainline kernel between 2.6.16 and 2.6.17-rc1.
The target trace needs to run on a kernel at least that new.

git://git.kernel.dk/blktrace.git

If you don't have git, you can get hourly snapshots from:

http://brick.kernel.dk/snaps/

The snapshots include the full git object database as well. kernel.org has
excessively long mirror times, so if you have git installed, you can pull
the master tree from:

git://git.kernel.dk/blktrace.git

For browsing the repo over http and viewing history etc, you can direct
your browser to:

http://git.kernel.dk/

A blktrace visualization tool, iowatcher, was added to blktrace in version
1.1.0. It requires librsvg and either png2theora or ffmpeg to generate movies.

Usage
-----

$ blktrace -d <dev> [ -r debug_path ] [ -o output ] [ -k ] [ -w time ]
		    [ -a action ] [ -A action mask ]

	-d Use specified device. May also be given last after options.
	-r Path to mounted debugfs, defaults to /sys/kernel/debug.
	-o File(s) to send output to.
	-D Directory to prepend to output file names.
	-k Kill running trace.
	-w Stop after defined time, in seconds.
	-a Only trace specific actions (use more -a options to add actions).
	   Available actions are:

		READ
		WRITE
		BARRIER
		SYNC
		QUEUE
		REQUEUE
		ISSUE
		COMPLETE
		FS
		PC

	-A Give the trace mask directly as a number.

	-b Sub buffer size in KiB.
	-n Number of sub buffers.
	-l Run in network listen mode (blktrace server)
	-h Run in network client mode, connecting to the given host
	-p Network port to use (default 8462)
	-s Disable network client use of sendfile() to transfer data
	-V Print program version info.

$ blkparse -i <input> [ -o <output> ] [ -b rb_batch ] [ -s ] [ -t ] [ -q ]
		      [ -w start:stop ] [ -f output format ] [ -F format spec ]
		      [ -d <binary> ]

	-i Input file containing trace data, or '-' for stdin.
	-D Directory to prepend to input file names.
	-o Output file. If not given, output is stdout.
	-b stdin read batching.
	-s Show per-program io statistics.
	-h Hash processes by name, not pid.
	-t Track individual ios. Will tell you the time a request took to
	   get queued, to get dispatched, and to get completed.
	-q Quiet. Don't display any stats at the end of the trace.
	-w Only parse data between the given time interval in seconds. If
	   'start' isn't given, blkparse defaults the start time to 0.
	-d Dump sorted data in binary format
	-f Output format. Customize the output format. The format field
	   identifiers are:

		%a	- Action
		%c	- CPU ID
		%C	- Task command (process) name
		%d	- Direction (r/w)
		%D	- Device number
		%e	- Error number
		%M	- Major
		%m	- Minor
		%N	- Number of bytes
		%n	- Number of sectors
		%p	- PID
		%P	- PDU
		%s	- Sequence number
		%S	- Sector number
		%t	- Time (wallclock - nanoseconds)
		%T	- Time (wallclock - seconds)
		%u	- Time (processing - microseconds)
		%U	- Unplug depth

	-F Format specification. The individual specifiers are:

		A	- Remap
		B	- Bounce
		C	- Complete
		D	- Issue
		M	- Back merge
		F	- Front merge
		G	- Get request
		I	- Insert
		P	- Plug
		Q	- Queue
		R	- Requeue
		S	- Sleep requests
		T	- Unplug timer
		U	- Unplug IO
		W	- Bounce
		X	- Split

	-v More verbose for marginal errors.
	-V Print program version info.

$ verify_blkparse filename

	Verifies an output file from blkparse. All it does is check if
	the events in the file are correctly time ordered. If an entry
	is found that isn't ordered, it's dumped to stdout.

$ blkrawverify <dev> [<dev>...]

	The blkrawverify utility can be used to verify data retrieved
	via blktrace. It will check for valid event formats, forward
	progressing sequence numbers and time stamps, also does reasonable
	checks for other potential issues within invidividual events.

	Errors found will be tracked in <dev>.verify.out.

If you want to do live tracing, you can pipe the data between blktrace
and blkparse:

% blktrace -d <device> -o - | blkparse -i -

This has a small risk of displaying some traces a little out of sync, since
it will do batch sorts of input events. Similarly, you can do traces over
the network. The network 'server' must run:

% blktrace -l

to listen to incoming blktrace connections, while the client should use

% blktrace -d /dev/sda -h <server hostname>

to connect and transfer data over the network.


Documentation
-------------

A users guide is distributed with the source. It is in latex, a
'make docs' will build a PDF in doc/. You need tetex and latex installed
to build the document.


Resources
---------

vger hosts a mailing list dedicated to btrace discussion and development.
The list is called linux-btrace@vger.kernel.org, subscribe by sending
a mail to majordomo@vger.kernel.org with 'subscribe linux-btrace' in
the mail body.



2006-09-05, Jens Axboe <axboe@kernel.dk>

# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
	--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
* master       doc: btrace: fix wrong format on doc (2024-01-17)
  origin       blktrace 1.0.5 (2012-02-27)

# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
	--format='%(refname:short) %(subject) (%(creatordate:short))'
blktrace-1.3.0 blktrace-1.3.0 (2021-06-14) tar.gz
blktrace-1.2.0 blktrace-1.2.0 (2017-11-04) tar.gz
blktrace-1.1.0 blktrace-1.1.0 (2014-09-24) tar.gz
blktrace-1.0.5 blktrace-1.0.5 (2012-02-27) tar.gz
blktrace-1.0.4 blktrace-1.0.4 (2012-01-31) tar.gz
blktrace-1.0.3 blktrace-1.0.3 (2011-08-11) tar.gz
blktrace-1.0.2 blktrace-1.0.2 (2011-03-16) tar.gz
blktrace-1.0.1 blktrace-1.0.1 (2009-05-11) tar.gz
blktrace-1.0.0 blktrace-1.0.0 (2008-10-30) tar.gz
blktrace-0.99.3 blktrace-0.99.3 (2007-08-28) tar.gz
...

# associated public inboxes:
# (number on the left is used for dev purposes)
        281 linux-btrace
         13 lkml
          7 linux-block
          7 qemu-devel
          7 linux-fsdevel
          6 netdev
          5 linux-wireless
          4 linux-arm-kernel
          3 linux-mtd
          3 linux-nfs
          3 netfilter-devel
          3 linux-mm
          3 xen-devel
          3 stable
          3 dpdk-dev
          3 linuxppc-dev
          3 git
          3 bitbake-devel
          2 linux-samsung-soc
          2 linux-xfs
          2 linux-mediatek
          2 linux-acpi
          2 linux-media
          2 linux-btrfs
          2 selinux
          2 kernel-hardening
          2 linux-gpio
          2 linux-rdma
          2 linux-security-module
          2 util-linux
          2 backports
          2 linux-can
          2 platform-driver-x86
          2 dm-devel
          2 linux-sctp
          2 linux-s390
          2 b43-dev
          2 u-boot
          2 buildroot
          2 fio
          2 yocto
          2 linux-patches
          2 poky
          2 qemu-riscv
          2 linux-alpha
          1 linux-fscrypt
          1 cocci
          1 linux-riscv
          1 linux-nvme
          1 live-patching
          1 bpf
          1 linux-crypto
          1 linux-efi
          1 linux-integrity
          1 linux-edac
          1 linux-cifs
          1 linux-devicetree
          1 linux-arm-msm
          1 linux-amlogic
          1 linux-erofs
          1 linux-nvdimm
          1 linux-iommu
          1 linux-snps-arc
          1 linux-mips
          1 fstests
          1 linux-pm
          1 linux-hwmon
          1 linux-rtc
          1 linux-input
          1 alsa-devel
          1 linux-scsi
          1 kvmarm
          1 driverdev-devel
          1 linux-usb
          1 linux-renesas-soc
          1 linux-kselftest
          1 linux-clk
          1 linux-iio
          1 dmaengine
          1 linux-next
          1 linux-parisc
          1 linux-ext4
          1 linux-leds
          1 linux-pci
          1 linux-f2fs-devel
          1 kvm
          1 linux-modules
          1 kernelnewbies
          1 linux-rt-users
          1 linux-bluetooth
          1 linux-sgx
          1 linux-ide
          1 linux-serial
          1 linux-watchdog
          1 linux-trace-devel
          1 linux-hyperv
          1 workflows
          1 rcu
          1 linux-m68k
          1 linux-i3c
          1 linux-spdx
          1 linux-wpan
          1 ksummit-discuss
          1 wireguard
          1 io-uring
          1 linux-kernel-mentees
          1 linux-doc
          1 linux-csky
          1 linux-man
          1 linux-mmc
          1 amd-gfx
          1 dri-devel
          1 intel-gfx
          1 tpmdd-devel
          1 linux-unionfs
          1 linux-firmware
          1 linux-api
          1 cip-dev
          1 linux-omap
          1 linux-audit
          1 linux-spi
          1 linux-i2c
          1 linux-remoteproc
          1 linux-dash
          1 linux-bcache
          1 linux-sparse
          1 mm-commits
          1 linux-pwm
          1 linux-tegra
          1 lttng-dev
          1 virtualization
          1 linux-kbuild
          1 linux-fpga
          1 ceph-devel
          1 linux-arch
          1 containers
          1 linux-rockchip
          1 linux-raid
          1 xdp-newbies
          1 phone-devel
          1 openbmc
          1 linux-hardening
          1 dash
          1 keyrings
          1 linux-fbdev
          1 linux-cxl
          1 linux-perf-users
          1 target-devel
          1 lustre-devel
          1 linux-sh
          1 soc
          1 ocfs2-devel
          1 rust-for-linux
          1 ath10k
          1 ath11k
          1 nouveau
          1 linux-phy
          1 kernel-janitors
          1 sparclinux
          1 linux-staging
          1 linux-sunxi
          1 mptcp
          1 linux-coco
          1 regressions
          1 ksummit
          1 nvdimm
          1 linux-nfc
          1 linux-bcachefs
          1 ath9k-devel
          1 ntfs3
          1 llvm
          1 iwd
          1 ell
          1 ofono
          1 ltp
          1 yocto-meta-freescale
          1 openembedded-core
          1 yocto-toaster
          1 yocto-meta-arm
          1 yocto-docs
          1 openembedded-devel
          1 yocto-meta-virtualization
          1 chrome-platform
          1 ntb
          1 yocto-meta-ti
          1 yocto-meta-arago
          1 outreachy
          1 xenomai
          1 damon
          1 asahi
          1 openrisc
          1 intel-wired-lan
          1 kexec
          1 loongarch
          1 imx
          1 ath12k
          1 b4-sent
          1 linux-trace-kernel
          1 oe-linux-nfc
          1 oe-kbuild-all
          1 oe-chipsec
          1 batman
          1 intel-xe
          1 linux-um
          1 virtio-dev
          1 virtio-comment
          1 v9fs
          1 ecryptfs
          1 linux-ia64
          1 cluster-devel
          1 grub-devel
          1 kbd
          1 autofs
          1 cpufreq
          1 dccp
          1 cgroups
          1 devicetree-spec
          1 devicetree-compiler
          1 initramfs
          1 kvm-ppc
          1 hail-devel
          1 kvm-ia64
          1 linux-8086
          1 kernel-testers
          1 linux-embedded
          1 linux-hams
          1 linux-hexagon
          1 linux-hotplug
          1 linux-laptop
          1 linux-sound
          1 trinity
          1 reiserfs-devel
          1 linux-metag
          1 linux-x25
          1 linux-nilfs
          1 lvs-devel
          1 netfilter
          1 linux-oxnas
          1 u-boot-amlogic
          1 lm-sensors
          1 lvm-devel
          1 acpica-devel
          1 perfbook
          1 virtio-fs
          1 smatch
          1 ../../../../../../../fuego
          1 ../../../../../../../wireless-regdb
          1 ../../../../../../../igt-dev
          1 ../../../../../../../powertop

git clone https://yhbt.net/lore/pub/scm/linux/kernel/git/axboe/blktrace.git