On 5/8/23 07:05, Benjamin Block wrote:
On Wed, May 03, 2023 at 04:06:52PM -0700, Bart Van Assche wrote:
@@ -285,11 +290,22 @@ DECLARE_EVENT_CLASS(scsi_cmd_done_timeout_template,
__entry->prot_sglen = scsi_prot_sg_count(cmd);
__entry->prot_op = scsi_get_prot_op(cmd);
memcpy(__get_dynamic_array(cmnd), cmd->cmnd, cmd->cmd_len);
+ if (cmd->sense_buffer && SCSI_SENSE_VALID(cmd) &&
Can't hurt to have these explicitly here, but these checks are also
done by `scsi_command_normalize_sense()` AFAICT.
Niklas requested these checks as a performance optimization.
+ scsi_command_normalize_sense(cmd, &sshdr)) {
+ __entry->sense_key = sshdr.sense_key;
+ __entry->asc = sshdr.asc;
+ __entry->ascq = sshdr.ascq;
+ } else {
+ __entry->sense_key = 0;
+ __entry->asc = 0;
+ __entry->ascq = 0;
+ }
),
TP_printk("host_no=%u channel=%u id=%u lun=%u data_sgl=%u prot_sgl=%u " \
"prot_op=%s driver_tag=%d scheduler_tag=%d cmnd=(%s %s raw=%s) " \
- "result=(driver=%s host=%s message=%s status=%s)",
+ "result=(driver=%s host=%s message=%s status=%s "
+ "sense_key=%u asc=%#x ascq=%#x))",
In SPC, these are all in base 16, and some existing functions in
`scsi_logging.c` format Sense Key as base 16. We probably should keep
this consistent and also format Sense Key with `%#x`.
I can make this change.
Thanks,
Bart.