Skip to content

Instantly share code, notes, and snippets.

@baruch
Last active April 21, 2018 20:12
Show Gist options
  • Select an option

  • Save baruch/0115922b7571d9f0e6ad2133f45ad648 to your computer and use it in GitHub Desktop.

Select an option

Save baruch/0115922b7571d9f0e6ad2133f45ad648 to your computer and use it in GitHub Desktop.
Get SCSI Sense buffers in Linux with systemtap
probe module("scsi_mod").function("scsi_command_normalize_sense") {
printf("CDB:");
for (i = 0; i < $cmd->cmd_len; i++) {
printf(" %02X", $cmd->cmnd[i]);
}
printf(" | SENSE:");
for (i = 0; i < 32; i++) {
printf(" %02X", $cmd->sense_buffer[i]);
}
printf("\n");
}
@baruch
Copy link
Author

baruch commented Apr 21, 2018

Decoding SCSI sense buffers is easy with http://scsi.ev-en.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment