I wan't to trace I/O block device requests using blktrace
command. To make a simple I/O block request I used the command below.
$ sudo dd if=/dev/sda bs=1k of=/dev/null count=1 iflag=direct &
[1] 17588
1+0 records out
1024 bytes (1.0 kB) copied, 0.0567514 s, 18.0 kB/s
As the terminal says the PID
is 17588
. But when I explored the blktrace
the pid that request I/O device was something else, here 17592
.
$ sudo blktrace -d /dev/sda -o -| blkparse -i -
8,0 2 1 0.000000000 17592 Q R 0 + 2 [dd]
8,0 2 2 0.000003858 17592 G R 0 + 2 [dd]
8,0 2 3 0.000005219 17592 P N [dd]
8,0 2 4 0.000006922 17592 I R 0 + 2 [dd]
8,0 2 5 0.000008121 17592 U N [dd] 1
8,0 2 6 0.000009415 17592 D R 0 + 2 [dd]
P.S:
blkparse
outputs format is like this:
major,minor cpu sequence timestamp pid action rwbs offset + size [process_name]