Skip to content

Instantly share code, notes, and snippets.

@baruch
Created May 15, 2014 19:08
Show Gist options
  • Save baruch/7b6d155ca0c2674b7b2e to your computer and use it in GitHub Desktop.
Save baruch/7b6d155ca0c2674b7b2e to your computer and use it in GitHub Desktop.
Get full SCSI Sense out of any command failure
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 May 15, 2014

You can use http://scsi.ev-en.org/ to decode the sense and http://blog.disksurvey.org/knowledge-base/scsi-sense/ to make sense of what it means.

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