Linux Trace Kernel
 help / color / mirror / Atom feed
* [PATCH] scsi: trace: change the rtn log in hex format
@ 2025-05-07  7:07 Kassey Li
  2025-05-07 15:54 ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Kassey Li @ 2025-05-07  7:07 UTC (permalink / raw)
  To: rostedt, mhiramat, mathieu.desnoyers, linux-kernel,
	linux-trace-kernel
  Cc: quic_yingangl

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 converts the rtn in hexadecimal.

Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
---
 include/trace/events/scsi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h
index bf6cc98d9122..a4c089ac834c 100644
--- a/include/trace/events/scsi.h
+++ b/include/trace/events/scsi.h
@@ -240,7 +240,7 @@ 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=0x%x",
 		  __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,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: trace: change the rtn log in hex format
  2025-05-07  7:07 [PATCH] scsi: trace: change the rtn log in hex format Kassey Li
@ 2025-05-07 15:54 ` Steven Rostedt
  2025-05-08  1:21   ` Kassey Li quic
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2025-05-07 15:54 UTC (permalink / raw)
  To: Kassey Li; +Cc: mhiramat, mathieu.desnoyers, linux-kernel, linux-trace-kernel

On Wed, 7 May 2025 15:07:14 +0800
Kassey Li <quic_yingangl@quicinc.com> wrote:


This patch is fine with me, but it needs to go through the scsi maintainers.

I don't see them Cc'd.

-- Steve


> 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 converts the rtn in hexadecimal.
> 
> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
> ---
>  include/trace/events/scsi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h
> index bf6cc98d9122..a4c089ac834c 100644
> --- a/include/trace/events/scsi.h
> +++ b/include/trace/events/scsi.h
> @@ -240,7 +240,7 @@ 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=0x%x",
>  		  __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,


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: trace: change the rtn log in hex format
  2025-05-07 15:54 ` Steven Rostedt
@ 2025-05-08  1:21   ` Kassey Li quic
  0 siblings, 0 replies; 6+ messages in thread
From: Kassey Li quic @ 2025-05-08  1:21 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: mhiramat, mathieu.desnoyers, linux-kernel, linux-trace-kernel,
	linux-scsi



On 2025/5/7 23:54, Steven Rostedt wrote:
> On Wed, 7 May 2025 15:07:14 +0800
> Kassey Li <quic_yingangl@quicinc.com> wrote:
> 
> 
> This patch is fine with me, but it needs to go through the scsi maintainers.
> 
> I don't see them Cc'd.
hi, Steve:
     Thanks for the comment.
     add linux-scsi@vger.kernel.org to cc with the review history info.

     if you want to me to re-send again with more cc (scsi) , please let 
me know.

BR
Kassey 	


> 
> -- Steve
> 
> 
>> 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 converts the rtn in hexadecimal.
>>
>> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
>> ---
>>   include/trace/events/scsi.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h
>> index bf6cc98d9122..a4c089ac834c 100644
>> --- a/include/trace/events/scsi.h
>> +++ b/include/trace/events/scsi.h
>> @@ -240,7 +240,7 @@ 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=0x%x",
>>   		  __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,
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] scsi: trace: change the rtn log in hex format
@ 2025-05-09  5:38 Kassey Li
  2025-05-12 16:11 ` Steven Rostedt
  0 siblings, 1 reply; 6+ messages in thread
From: Kassey Li @ 2025-05-09  5:38 UTC (permalink / raw)
  To: rostedt, James.Bottomley, martin.petersen, mathieu.desnoyers,
	linux-kernel, linux-trace-kernel, linux-scsi
  Cc: quic_yingangl

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 converts the rtn in hexadecimal.

Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
---
 include/trace/events/scsi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h
index bf6cc98d9122..a4c089ac834c 100644
--- a/include/trace/events/scsi.h
+++ b/include/trace/events/scsi.h
@@ -240,7 +240,7 @@ 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=0x%x",
 		  __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,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: trace: change the rtn log in hex format
  2025-05-09  5:38 Kassey Li
@ 2025-05-12 16:11 ` Steven Rostedt
  2025-05-14  7:43   ` Kassey Li quic
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Rostedt @ 2025-05-12 16:11 UTC (permalink / raw)
  To: Kassey Li
  Cc: James.Bottomley, martin.petersen, mathieu.desnoyers, linux-kernel,
	linux-trace-kernel, linux-scsi

On Fri, 9 May 2025 13:38:40 +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

Hmm, would you want to make this show text?

> 
> This change converts the rtn in hexadecimal.
> 
> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
> ---
>  include/trace/events/scsi.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h
> index bf6cc98d9122..a4c089ac834c 100644
> --- a/include/trace/events/scsi.h
> +++ b/include/trace/events/scsi.h
> @@ -240,7 +240,7 @@ 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=0x%x",

		  " 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,

		__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" })

?

-- Steve

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] scsi: trace: change the rtn log in hex format
  2025-05-12 16:11 ` Steven Rostedt
@ 2025-05-14  7:43   ` Kassey Li quic
  0 siblings, 0 replies; 6+ messages in thread
From: Kassey Li quic @ 2025-05-14  7:43 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: James.Bottomley, martin.petersen, mathieu.desnoyers, linux-kernel,
	linux-trace-kernel, linux-scsi



On 2025/5/13 0:11, Steven Rostedt wrote:
> On Fri, 9 May 2025 13:38:40 +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
> 
> Hmm, would you want to make this show text?

   agree, will send v2 as your suggest.
> 
>>
>> This change converts the rtn in hexadecimal.
>>
>> Signed-off-by: Kassey Li <quic_yingangl@quicinc.com>
>> ---
>>   include/trace/events/scsi.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/include/trace/events/scsi.h b/include/trace/events/scsi.h
>> index bf6cc98d9122..a4c089ac834c 100644
>> --- a/include/trace/events/scsi.h
>> +++ b/include/trace/events/scsi.h
>> @@ -240,7 +240,7 @@ 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=0x%x",
> 
> 		  " 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,
> 
> 		__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" })
> 
> ?
> 
> -- Steve


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-05-14  7:43 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07  7:07 [PATCH] scsi: trace: change the rtn log in hex format Kassey Li
2025-05-07 15:54 ` Steven Rostedt
2025-05-08  1:21   ` Kassey Li quic
  -- strict thread matches above, loose matches on Subject: below --
2025-05-09  5:38 Kassey Li
2025-05-12 16:11 ` Steven Rostedt
2025-05-14  7:43   ` Kassey Li quic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox