public inbox for linux-trace-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Kassey Li <quic_yingangl@quicinc.com>,
	rostedt@goodmis.org,  martin.petersen@oracle.com,
	mathieu.desnoyers@efficios.com,  linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,  linux-scsi@vger.kernel.org
Subject: Re: [PATCH v4] scsi: trace: show rtn in string for scsi_dispatch_cmd_error
Date: Tue, 20 May 2025 08:28:42 -0700	[thread overview]
Message-ID: <bd3bf680a8910e261ba55a7ade12b93978cff326.camel@HansenPartnership.com> (raw)
In-Reply-To: <20250520015915.1464093-1-quic_yingangl@quicinc.com>

On Tue, 2025-05-20 at 09:59 +0800, Kassey Li wrote:
> By 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 values 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 rtn in strings:
> 
> 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>
> ---
>  include/trace/events/scsi.h | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/include/trace/events/scsi.h
> b/include/trace/events/scsi.h
> index 8e2d9b1b0e77..38743635f2c1 100644
> --- a/include/trace/events/scsi.h
> +++ b/include/trace/events/scsi.h
> @@ -199,6 +199,14 @@ TRACE_EVENT(scsi_dispatch_cmd_start,
>  		  __print_hex(__get_dynamic_array(cmnd), __entry-
> >cmd_len))
>  );
>  
> +#define scsi_rtn_name(result)	{ result, #result }
> +#define show_rtn_name(val)					\
> +	__print_symbolic(val,					\
> +		scsi_rtn_name(SCSI_MLQUEUE_HOST_BUSY),		\
> +		scsi_rtn_name(SCSI_MLQUEUE_DEVICE_BUSY),	\
> +		scsi_rtn_name(SCSI_MLQUEUE_EH_RETRY),	\
> +		scsi_rtn_name(SCSI_MLQUEUE_TARGET_BUSY))
> +

This looks much more consistent with the style of the file, thanks;
just make sure the last backslash aligns.

Also, could you assure us you have actually compiled and tested v4?  It
was pretty obvious from the kbuild errors for v2 and v3 that they
hadn't even been compiled.

Regards,

James


  reply	other threads:[~2025-05-20 15:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-20  1:59 [PATCH v4] scsi: trace: show rtn in string for scsi_dispatch_cmd_error Kassey Li
2025-05-20 15:28 ` James Bottomley [this message]
2025-05-21  1:02   ` Kassey Li quic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bd3bf680a8910e261ba55a7ade12b93978cff326.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=quic_yingangl@quicinc.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox