Tracing SCSI Commands

This DTrace command traces all the SCSI command requests:

# dtrace -qn 'scsi:::cmd-request {
      printf("%s#%d %s: Opcode: %02x\n",
          args[0]->addr_ctrl, args[0]->addr_ctrl_inst,
          args[0]->addr_dev, args[1]->cdb_data[0]);}'

In this example, traced commands can appear twice in the output. First, as commands issued to scsi_vhci (vHCI) and second, as commands issued to a physical HBA driver (pHCI).