Displaying TPGS Bits Received

The following script displays TPGS bits received in standard INQUIRY data.

#!/usr/sbin/dtrace -s
 /*
  * Response to INQUIRY with EVPD bit not set, i.e. DATA IN
  * contains standard INQUIRY data.
  * Tracing only on vHCI enumerated paths (addr_path != "NULL")
  * with DATA IN buffer mapped to a kernel virtual memory space.
  */
 scsi:::cmd-response
 /(args[1]->cdb_data[0] == 0x12) &&
  !(args[1]->cdb_data[1] & 0x01) &&
  (args[0]->addr_path != "NULL") &&
  (args[2]->data_mapped)/
 {
        printf("TPGS bits 0x%x received from %s\n",
            (args[2]->data_ptr[5] & 0x30) >> 4,
            args[0]->addr_path);
 }