* [PATCH v2] scsi: ufs: Include the SCSI ID in UFS command tracing output
@ 2023-09-07 18:37 Bart Van Assche
2023-09-08 0:25 ` Can Guo
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bart Van Assche @ 2023-09-07 18:37 UTC (permalink / raw)
To: Martin K . Petersen
Cc: linux-scsi, Bart Van Assche, Christoph Hellwig, Steven Rostedt,
James E.J. Bottomley, Masami Hiramatsu, Stanley Chu, Can Guo,
Bean Huo, Asutosh Das, Bao D. Nguyen, Arthur Simchaev, Ziqi Chen,
Manivannan Sadhasivam
The logical unit information is missing from the UFS command tracing
output. Although the device name is logged, e.g. 13200000.ufs, this
name does not include logical unit information. Hence this patch that
replaces the device name with the SCSI ID in the tracing output. An
example of tracing output with this patch applied:
kworker/8:0H-80 [008] ..... 89.106063: ufshcd_command: send_req: 0:0:0:4: tag: 10, DB: 0x7ffffbff, size: 524288, IS: 0, LBA: 1085538, opcode: 0x8a (WRITE_16), group_id: 0x0
dd-4225 [000] d.h.. 89.106219: ufshcd_command: complete_rsp: 0:0:0:4: tag: 11, DB: 0x7ffff7ff, size: 524288, IS: 0, LBA: 1081728, opcode: 0x8a (WRITE_16), group_id: 0x0
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/ufs/core/ufshcd.c | 4 ++--
include/trace/events/ufs.h | 15 ++++++++-------
2 files changed, 10 insertions(+), 9 deletions(-)
Changes compared to v1 (see also
https://lore.kernel.org/linux-scsi/20230706215124.4113546-1-bvanassche@acm.org/):
replaced major and minor numbers with the SCSI ID.
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index c2df07545f96..bb3f100276c5 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -447,8 +447,8 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
} else {
doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
}
- trace_ufshcd_command(dev_name(hba->dev), str_t, tag,
- doorbell, hwq_id, transfer_len, intr, lba, opcode, group_id);
+ trace_ufshcd_command(cmd->device, str_t, tag, doorbell, hwq_id,
+ transfer_len, intr, lba, opcode, group_id);
}
static void ufshcd_print_clk_freqs(struct ufs_hba *hba)
diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h
index 992517ac3292..b930669bd1f0 100644
--- a/include/trace/events/ufs.h
+++ b/include/trace/events/ufs.h
@@ -267,15 +267,15 @@ DEFINE_EVENT(ufshcd_template, ufshcd_wl_runtime_resume,
TP_ARGS(dev_name, err, usecs, dev_state, link_state));
TRACE_EVENT(ufshcd_command,
- TP_PROTO(const char *dev_name, enum ufs_trace_str_t str_t,
+ TP_PROTO(struct scsi_device *sdev, enum ufs_trace_str_t str_t,
unsigned int tag, u32 doorbell, u32 hwq_id, int transfer_len,
u32 intr, u64 lba, u8 opcode, u8 group_id),
- TP_ARGS(dev_name, str_t, tag, doorbell, hwq_id, transfer_len,
- intr, lba, opcode, group_id),
+ TP_ARGS(sdev, str_t, tag, doorbell, hwq_id, transfer_len, intr, lba,
+ opcode, group_id),
TP_STRUCT__entry(
- __string(dev_name, dev_name)
+ __field(struct scsi_device *, sdev)
__field(enum ufs_trace_str_t, str_t)
__field(unsigned int, tag)
__field(u32, doorbell)
@@ -288,7 +288,7 @@ TRACE_EVENT(ufshcd_command,
),
TP_fast_assign(
- __assign_str(dev_name, dev_name);
+ __entry->sdev = sdev;
__entry->str_t = str_t;
__entry->tag = tag;
__entry->doorbell = doorbell;
@@ -302,8 +302,9 @@ TRACE_EVENT(ufshcd_command,
TP_printk(
"%s: %s: tag: %u, DB: 0x%x, size: %d, IS: %u, LBA: %llu, opcode: 0x%x (%s), group_id: 0x%x, hwq_id: %d",
- show_ufs_cmd_trace_str(__entry->str_t), __get_str(dev_name),
- __entry->tag, __entry->doorbell, __entry->transfer_len, __entry->intr,
+ show_ufs_cmd_trace_str(__entry->str_t),
+ dev_name(&__entry->sdev->sdev_dev), __entry->tag,
+ __entry->doorbell, __entry->transfer_len, __entry->intr,
__entry->lba, (u32)__entry->opcode, str_opcode(__entry->opcode),
(u32)__entry->group_id, __entry->hwq_id
)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] scsi: ufs: Include the SCSI ID in UFS command tracing output
2023-09-07 18:37 [PATCH v2] scsi: ufs: Include the SCSI ID in UFS command tracing output Bart Van Assche
@ 2023-09-08 0:25 ` Can Guo
2023-09-14 0:45 ` Martin K. Petersen
2023-09-22 1:05 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Can Guo @ 2023-09-08 0:25 UTC (permalink / raw)
To: Bart Van Assche, Martin K . Petersen
Cc: linux-scsi, Christoph Hellwig, Steven Rostedt,
James E.J. Bottomley, Masami Hiramatsu, Stanley Chu, Bean Huo,
Asutosh Das, Bao D. Nguyen, Arthur Simchaev, Ziqi Chen,
Manivannan Sadhasivam
On 9/8/2023 2:37 AM, Bart Van Assche wrote:
> The logical unit information is missing from the UFS command tracing
> output. Although the device name is logged, e.g. 13200000.ufs, this
> name does not include logical unit information. Hence this patch that
> replaces the device name with the SCSI ID in the tracing output. An
> example of tracing output with this patch applied:
>
> kworker/8:0H-80 [008] ..... 89.106063: ufshcd_command: send_req: 0:0:0:4: tag: 10, DB: 0x7ffffbff, size: 524288, IS: 0, LBA: 1085538, opcode: 0x8a (WRITE_16), group_id: 0x0
> dd-4225 [000] d.h.. 89.106219: ufshcd_command: complete_rsp: 0:0:0:4: tag: 11, DB: 0x7ffff7ff, size: 524288, IS: 0, LBA: 1081728, opcode: 0x8a (WRITE_16), group_id: 0x0
>
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/ufs/core/ufshcd.c | 4 ++--
> include/trace/events/ufs.h | 15 ++++++++-------
> 2 files changed, 10 insertions(+), 9 deletions(-)
>
> Changes compared to v1 (see also
> https://lore.kernel.org/linux-scsi/20230706215124.4113546-1-bvanassche@acm.org/):
> replaced major and minor numbers with the SCSI ID.
>
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index c2df07545f96..bb3f100276c5 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -447,8 +447,8 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
> } else {
> doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
> }
> - trace_ufshcd_command(dev_name(hba->dev), str_t, tag,
> - doorbell, hwq_id, transfer_len, intr, lba, opcode, group_id);
> + trace_ufshcd_command(cmd->device, str_t, tag, doorbell, hwq_id,
> + transfer_len, intr, lba, opcode, group_id);
> }
>
> static void ufshcd_print_clk_freqs(struct ufs_hba *hba)
> diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h
> index 992517ac3292..b930669bd1f0 100644
> --- a/include/trace/events/ufs.h
> +++ b/include/trace/events/ufs.h
> @@ -267,15 +267,15 @@ DEFINE_EVENT(ufshcd_template, ufshcd_wl_runtime_resume,
> TP_ARGS(dev_name, err, usecs, dev_state, link_state));
>
> TRACE_EVENT(ufshcd_command,
> - TP_PROTO(const char *dev_name, enum ufs_trace_str_t str_t,
> + TP_PROTO(struct scsi_device *sdev, enum ufs_trace_str_t str_t,
> unsigned int tag, u32 doorbell, u32 hwq_id, int transfer_len,
> u32 intr, u64 lba, u8 opcode, u8 group_id),
>
> - TP_ARGS(dev_name, str_t, tag, doorbell, hwq_id, transfer_len,
> - intr, lba, opcode, group_id),
> + TP_ARGS(sdev, str_t, tag, doorbell, hwq_id, transfer_len, intr, lba,
> + opcode, group_id),
>
> TP_STRUCT__entry(
> - __string(dev_name, dev_name)
> + __field(struct scsi_device *, sdev)
> __field(enum ufs_trace_str_t, str_t)
> __field(unsigned int, tag)
> __field(u32, doorbell)
> @@ -288,7 +288,7 @@ TRACE_EVENT(ufshcd_command,
> ),
>
> TP_fast_assign(
> - __assign_str(dev_name, dev_name);
> + __entry->sdev = sdev;
> __entry->str_t = str_t;
> __entry->tag = tag;
> __entry->doorbell = doorbell;
> @@ -302,8 +302,9 @@ TRACE_EVENT(ufshcd_command,
>
> TP_printk(
> "%s: %s: tag: %u, DB: 0x%x, size: %d, IS: %u, LBA: %llu, opcode: 0x%x (%s), group_id: 0x%x, hwq_id: %d",
> - show_ufs_cmd_trace_str(__entry->str_t), __get_str(dev_name),
> - __entry->tag, __entry->doorbell, __entry->transfer_len, __entry->intr,
> + show_ufs_cmd_trace_str(__entry->str_t),
> + dev_name(&__entry->sdev->sdev_dev), __entry->tag,
> + __entry->doorbell, __entry->transfer_len, __entry->intr,
> __entry->lba, (u32)__entry->opcode, str_opcode(__entry->opcode),
> (u32)__entry->group_id, __entry->hwq_id
> )
Reviewed-by: Can Guo <quic_cang@quicinc.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] scsi: ufs: Include the SCSI ID in UFS command tracing output
2023-09-07 18:37 [PATCH v2] scsi: ufs: Include the SCSI ID in UFS command tracing output Bart Van Assche
2023-09-08 0:25 ` Can Guo
@ 2023-09-14 0:45 ` Martin K. Petersen
2023-09-22 1:05 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2023-09-14 0:45 UTC (permalink / raw)
To: Bart Van Assche
Cc: Martin K . Petersen, linux-scsi, Christoph Hellwig,
Steven Rostedt, James E.J. Bottomley, Masami Hiramatsu,
Stanley Chu, Can Guo, Bean Huo, Asutosh Das, Bao D. Nguyen,
Arthur Simchaev, Ziqi Chen, Manivannan Sadhasivam
Bart,
> The logical unit information is missing from the UFS command tracing
> output. Although the device name is logged, e.g. 13200000.ufs, this
> name does not include logical unit information. Hence this patch that
> replaces the device name with the SCSI ID in the tracing output. An
> example of tracing output with this patch applied:
Applied to 6.7/scsi-staging, thanks!
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] scsi: ufs: Include the SCSI ID in UFS command tracing output
2023-09-07 18:37 [PATCH v2] scsi: ufs: Include the SCSI ID in UFS command tracing output Bart Van Assche
2023-09-08 0:25 ` Can Guo
2023-09-14 0:45 ` Martin K. Petersen
@ 2023-09-22 1:05 ` Martin K. Petersen
2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2023-09-22 1:05 UTC (permalink / raw)
To: Bart Van Assche
Cc: Martin K . Petersen, linux-scsi, Christoph Hellwig,
Steven Rostedt, James E.J. Bottomley, Masami Hiramatsu,
Stanley Chu, Can Guo, Bean Huo, Asutosh Das, Bao D. Nguyen,
Arthur Simchaev, Ziqi Chen, Manivannan Sadhasivam
On Thu, 07 Sep 2023 11:37:16 -0700, Bart Van Assche wrote:
> The logical unit information is missing from the UFS command tracing
> output. Although the device name is logged, e.g. 13200000.ufs, this
> name does not include logical unit information. Hence this patch that
> replaces the device name with the SCSI ID in the tracing output. An
> example of tracing output with this patch applied:
>
> kworker/8:0H-80 [008] ..... 89.106063: ufshcd_command: send_req: 0:0:0:4: tag: 10, DB: 0x7ffffbff, size: 524288, IS: 0, LBA: 1085538, opcode: 0x8a (WRITE_16), group_id: 0x0
> dd-4225 [000] d.h.. 89.106219: ufshcd_command: complete_rsp: 0:0:0:4: tag: 11, DB: 0x7ffff7ff, size: 524288, IS: 0, LBA: 1081728, opcode: 0x8a (WRITE_16), group_id: 0x0
>
> [...]
Applied to 6.7/scsi-queue, thanks!
[1/1] scsi: ufs: Include the SCSI ID in UFS command tracing output
https://git.kernel.org/mkp/scsi/c/ccc3e1363069
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-22 1:07 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-07 18:37 [PATCH v2] scsi: ufs: Include the SCSI ID in UFS command tracing output Bart Van Assche
2023-09-08 0:25 ` Can Guo
2023-09-14 0:45 ` Martin K. Petersen
2023-09-22 1:05 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox