From: Kassey Li quic <quic_yingangl@quicinc.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: <James.Bottomley@HansenPartnership.com>,
<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 v2] scsi: trace: change the rtn log in string
Date: Mon, 19 May 2025 17:40:08 +0800 [thread overview]
Message-ID: <0dd2e7b5-7381-4e66-a887-64b92a549d60@quicinc.com> (raw)
In-Reply-To: <20250514090917.0fd363d5@batman.local.home>
On 2025/5/14 21:09, Steven Rostedt wrote:
> On Wed, 14 May 2025 15:44:56 +0800
> Kassey Li <quic_yingangl@quicinc.com> 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.
>
> Nit, but would an example of the new output be useful in the change log?
it is not 100% to reproduce the error path.
So I forced to show this by below change,
is this fine to test this ?
change to enforce the log:
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 2b27a412aad9..cbc76a09dc75 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1518,6 +1518,7 @@ static int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
trace_scsi_dispatch_cmd_start(cmd);
rtn = host->hostt->queuecommand(host, cmd);
+ trace_scsi_dispatch_cmd_error(cmd, rtn);
if (rtn) {
atomic_dec(&cmd->device->iorequest_cnt);
trace_scsi_dispatch_cmd_error(cmd, rtn);
test cmd:
echo 1 > /sys/kernel/tracing/events/scsi/scsi_dispatch_cmd_error/enable
cat /sys/kernel/tracing/trace_pipe &
dd if=/dev/block/sde of=/oem/1.txt bs=1M count=1
log:
dd-1092 [007] ..... 40.975673: scsi_dispatch_cmd_error: host_no=0
channel=0 id=0 lun=4 data_sgl=33 prot_sgl=0 prot_op=SCSI_PROT_NORMAL
driver_tag=57 scheduler_tag=52 cmnd=(READ_10 lba=3328 txlen=128
protect=0 raw=28 00 00 00 0d 00 00 00 80 00) rtn=0x0
>
>>
>> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
>
> Other than that,
>
> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
>
> -- Steve
next prev parent reply other threads:[~2025-05-19 9:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-14 7:44 [PATCH v2] scsi: trace: change the rtn log in string Kassey Li
2025-05-14 13:09 ` Steven Rostedt
2025-05-19 9:40 ` Kassey Li quic [this message]
2025-05-14 13:39 ` James Bottomley
2025-05-19 9:37 ` Kassey Li quic
2025-05-14 23:05 ` kernel test robot
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=0dd2e7b5-7381-4e66-a887-64b92a549d60@quicinc.com \
--to=quic_yingangl@quicinc.com \
--cc=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=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