scsi: trace: Show rtn in string for scsi_dispatch_cmd_error()
authorKassey Li <quic_yingangl@quicinc.com>
Wed, 21 May 2025 01:17:11 +0000 (09:17 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 10 Jun 2025 01:59:07 +0000 (21:59 -0400)
commit9d2c232d575a8c8dfa66276ed7edccfac482a4df
tree7dac337aa7b69f4e9d4b18c72ffcce8a8bfcc2f7
parentae7795a8c2582b5fb7971132753810a3f158e7b2
scsi: trace: Show rtn in string for scsi_dispatch_cmd_error()

By default the scsi_dispatch_cmd_error() return value is displayed in
decimal:

  kworker/3:1H-183 [003] ....  51.035474: scsi_dispatch_cmd_error: host_no=0 channel=0 id=0 lun=4 data_sgl=1  prot_sgl=0 prot_op=SCSI_PROT_NORMAL cmnd=(READ_10 lba=3907214  txlen=1 protect=0 raw=28 00 00 3b 9e 8e 00 00 01 00) rtn=4181

However, these numbers are not particularly helpful wrt. debugging
errors. Especially since the kernel code consistently uses the following
defines in hexadecimal:

  SCSI_MLQUEUE_HOST_BUSY   0x1055
  SCSI_MLQUEUE_DEVICE_BUSY 0x1056
  SCSI_MLQUEUE_EH_RETRY    0x1057
  SCSI_MLQUEUE_TARGET_BUSY 0x1058

Switch to using the string form of these values in the trace output:

  dd-1059    [007] .....    31.689529: scsi_dispatch_cmd_error: host_no=0 channel=0 id=0 lun=4 data_sgl=65 prot_sgl=0 prot_op=SCSI_PROT_NORMAL driver_tag=23 scheduler_tag=117 cmnd=(READ_10 lba=0 txlen=128 protect=0 raw=28 00 00 00 00 00 00 00 80 00) rtn=SCSI_MLQUEUE_DEVICE_BUSY

Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
Link: https://lore.kernel.org/r/20250521011711.1983625-1-quic_yingangl@quicinc.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
include/trace/events/scsi.h