The previous section showed typical file system io actions, but blktrace can also show SCSI commands going in and out of the queue as submitted by applications using the SCSI Generic (sg) interface.
% btrace /dev/cdrom [...] 3,0 0 25 0.004884107 13528 G R 0 + 0 [inquiry] 3,0 0 26 0.004890361 13528 I R 56 (12 00 00 00 38 ..) [inquiry] 3,0 0 27 0.004891223 13528 P R [inquiry] 3,0 0 28 0.004893250 13528 D R 56 (12 00 00 00 38 ..) [inquiry] 3,0 0 29 0.005344910 0 C R (12 00 00 00 38 ..) [0]
Here we see a program issuing an INQUIRY command to the CDROM device. The program requested a read of 56 bytes of data, the CDB is included in parenthesis after the data length. The completion event shows shows that the command completed successfully. Tracing SCSI commands can be very useful for debugging problems with programs talking directly to the device. An example of that would be cdrecord burning.