[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <78209d1c512a39b4ebbabda6181110b3c23e6f6b.camel@HansenPartnership.com>
Date: Wed, 14 May 2025 09:39:26 -0400
From: James Bottomley <James.Bottomley@...senPartnership.com>
To: Kassey Li <quic_yingangl@...cinc.com>, rostedt@...dmis.org,
martin.petersen@...cle.com, mathieu.desnoyers@...icios.com,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org,
linux-scsi@...r.kernel.org
Subject: Re: [PATCH v2] scsi: trace: change the rtn log in string
On Wed, 2025-05-14 at 15:44 +0800, Kassey Li wrote:
> In default it showed rtn 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
>
> In source code we define these possible value as hexadecimal:
>
> include/scsi/scsi.h
>
> SCSI_MLQUEUE_HOST_BUSY 0x1055
> SCSI_MLQUEUE_DEVICE_BUSY 0x1056
> SCSI_MLQUEUE_EH_RETRY 0x1057
> SCSI_MLQUEUE_TARGET_BUSY 0x1058
>
> This change shows the string type.
>
> Signed-off-by: Kassey Li <quic_yingangl@...cinc.com>
> ---
> include/trace/events/scsi.h | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/include/trace/events/scsi.h
> b/include/trace/events/scsi.h
> index bf6cc98d9122..56987f98ba4a 100644
> --- a/include/trace/events/scsi.h
> +++ b/include/trace/events/scsi.h
> @@ -240,14 +240,18 @@ TRACE_EVENT(scsi_dispatch_cmd_error,
>
> 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)" \
> - " rtn=%d",
> + " rtn=%s",
> __entry->host_no, __entry->channel, __entry->id,
> __entry->lun, __entry->data_sglen, __entry-
> >prot_sglen,
> show_prot_op_name(__entry->prot_op), __entry-
> >driver_tag,
> __entry->scheduler_tag, show_opcode_name(__entry-
> >opcode),
> __parse_cdb(__get_dynamic_array(cmnd), __entry-
> >cmd_len),
> __print_hex(__get_dynamic_array(cmnd), __entry-
> >cmd_len),
> - __entry->rtn)
> + __print_symbolic(rtn, { SCSI_MLQUEUE_HOST_BUSY,
> "HOST_BUSY" },
> + { SCSI_MLQUEUE_DEVICE_BUSY, "DEVICE_BUSY"
> },
> + { SCSI_MLQUEUE_EH_RETRY, "EH_RETRY" },
> + { SCSI_MLQUEUE_TARGET_BUSY, "TARGET_BUSY"
> })
> + )
We tend to do global print_symbolics as show_XXX_name definitions at
the top of the file even if they only occur once, just in case some
other trace point wants to use them.
Regards,
James
Powered by blists - more mailing lists