linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: support IO traces for zoned block device
@ 2023-02-15 19:04 Jaegeuk Kim
  2023-02-15 19:13 ` Bart Van Assche
  2023-02-16  6:01 ` Christoph Hellwig
  0 siblings, 2 replies; 7+ messages in thread
From: Jaegeuk Kim @ 2023-02-15 19:04 UTC (permalink / raw)
  To: linux-kernel, linux-scsi, Martin K . Petersen, Bart Van Assche,
	Adrian Hunter, Avri Altman, Bean Huo, Stanley Chu, Can Guo
  Cc: Jaegeuk Kim, Jaegeuk Kim

From: Jaegeuk Kim <jaegeuk@google.com>

Let's support WRITE_16, READ_16, ZBC_IN, ZBC_OUT.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 drivers/ufs/core/ufshcd.c  | 8 ++++----
 include/trace/events/ufs.h | 4 +++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index e18c9f4463ec..235d2e2d828a 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -402,15 +402,15 @@ static void ufshcd_add_command_trace(struct ufs_hba *hba, unsigned int tag,
 
 	opcode = cmd->cmnd[0];
 
-	if (opcode == READ_10 || opcode == WRITE_10) {
-		/*
-		 * Currently we only fully trace read(10) and write(10) commands
-		 */
+	if (opcode == READ_10 || opcode == WRITE_10 ||
+				opcode == READ_16 || opcode == WRITE_16) {
 		transfer_len =
 		       be32_to_cpu(lrbp->ucd_req_ptr->sc.exp_data_transfer_len);
 		lba = scsi_get_lba(cmd);
 		if (opcode == WRITE_10)
 			group_id = lrbp->cmd->cmnd[6];
+		if (opcode == WRITE_16)
+			group_id = lrbp->cmd->cmnd[14];
 	} else if (opcode == UNMAP) {
 		/*
 		 * The number of Bytes to be unmapped beginning with the lba.
diff --git a/include/trace/events/ufs.h b/include/trace/events/ufs.h
index 599739ee7b20..f82a9e15fd78 100644
--- a/include/trace/events/ufs.h
+++ b/include/trace/events/ufs.h
@@ -18,7 +18,9 @@
 		{ READ_16,		"READ_16" },			\
 		{ READ_10,		"READ_10" },			\
 		{ SYNCHRONIZE_CACHE,	"SYNC" },			\
-		{ UNMAP,		"UNMAP" })
+		{ UNMAP,		"UNMAP" },			\
+		{ ZBC_IN,		"ZBC_IN" },			\
+		{ ZBC_OUT,		"ZBC_OUT" })
 
 #define UFS_LINK_STATES						\
 	EM(UIC_LINK_OFF_STATE,		"UIC_LINK_OFF_STATE")		\
-- 
2.39.1.581.gbfd45094c4-goog


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

* Re: [PATCH] scsi: ufs: support IO traces for zoned block device
  2023-02-15 19:04 [PATCH] scsi: ufs: support IO traces for zoned block device Jaegeuk Kim
@ 2023-02-15 19:13 ` Bart Van Assche
  2023-02-16  6:01 ` Christoph Hellwig
  1 sibling, 0 replies; 7+ messages in thread
From: Bart Van Assche @ 2023-02-15 19:13 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-scsi, Martin K . Petersen,
	Adrian Hunter, Avri Altman, Bean Huo, Stanley Chu, Can Guo
  Cc: Jaegeuk Kim

On 2/15/23 11:04, Jaegeuk Kim wrote:
> Let's support WRITE_16, READ_16, ZBC_IN, ZBC_OUT.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

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

* Re: [PATCH] scsi: ufs: support IO traces for zoned block device
  2023-02-15 19:04 [PATCH] scsi: ufs: support IO traces for zoned block device Jaegeuk Kim
  2023-02-15 19:13 ` Bart Van Assche
@ 2023-02-16  6:01 ` Christoph Hellwig
  2023-02-27 23:15   ` Jaegeuk Kim
  1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2023-02-16  6:01 UTC (permalink / raw)
  To: Jaegeuk Kim
  Cc: linux-kernel, linux-scsi, Martin K . Petersen, Bart Van Assche,
	Adrian Hunter, Avri Altman, Bean Huo, Stanley Chu, Can Guo,
	Jaegeuk Kim

Why does UFS even have it's own common tracing instad of just relying
on the core SCSI one, and even worse pokes into command set specifics
which is a no-go for LLDDs.  This code simply needs to go away instead
of beeing "enhanced".

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

* Re: [PATCH] scsi: ufs: support IO traces for zoned block device
  2023-02-16  6:01 ` Christoph Hellwig
@ 2023-02-27 23:15   ` Jaegeuk Kim
  2023-02-28  7:28     ` Avri Altman
  2023-03-20 12:55     ` Christoph Hellwig
  0 siblings, 2 replies; 7+ messages in thread
From: Jaegeuk Kim @ 2023-02-27 23:15 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: linux-kernel, linux-scsi, Martin K . Petersen, Bart Van Assche,
	Adrian Hunter, Avri Altman, Bean Huo, Stanley Chu, Can Guo

On 02/15, Christoph Hellwig wrote:
> Why does UFS even have it's own common tracing instad of just relying
> on the core SCSI one, and even worse pokes into command set specifics
> which is a no-go for LLDDs.  This code simply needs to go away instead
> of beeing "enhanced".

I'm not sure how all the other vendors use the trace tho, at least to me,
it's quite useful when debugging any UFS-specific information such as
group_id and doorbell status along with the attached scsi command, in
addition to the accurate latency measurements.

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

* RE: [PATCH] scsi: ufs: support IO traces for zoned block device
  2023-02-27 23:15   ` Jaegeuk Kim
@ 2023-02-28  7:28     ` Avri Altman
  2023-03-20 12:55       ` hch
  2023-03-20 12:55     ` Christoph Hellwig
  1 sibling, 1 reply; 7+ messages in thread
From: Avri Altman @ 2023-02-28  7:28 UTC (permalink / raw)
  To: Jaegeuk Kim, hch
  Cc: linux-kernel, linux-scsi, Martin K . Petersen, Bart Van Assche,
	Adrian Hunter, Bean Huo, Stanley Chu, Can Guo

 
> On 02/15, Christoph Hellwig wrote:
> > Why does UFS even have it's own common tracing instad of just relying
> > on the core SCSI one, and even worse pokes into command set specifics
> > which is a no-go for LLDDs.  This code simply needs to go away instead
> > of beeing "enhanced".
> 
> I'm not sure how all the other vendors use the trace tho, at least to me, it's
> quite useful when debugging any UFS-specific information such as group_id and
> doorbell status along with the attached scsi command, in addition to the
> accurate latency measurements.
For us as well.
Moreover, we are mainly using upiu tracing which is not available at scsi ML.

Thanks,
Avri

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

* Re: [PATCH] scsi: ufs: support IO traces for zoned block device
  2023-02-27 23:15   ` Jaegeuk Kim
  2023-02-28  7:28     ` Avri Altman
@ 2023-03-20 12:55     ` Christoph Hellwig
  1 sibling, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2023-03-20 12:55 UTC (permalink / raw)
  To: Jaegeuk Kim
  Cc: Christoph Hellwig, linux-kernel, linux-scsi, Martin K . Petersen,
	Bart Van Assche, Adrian Hunter, Avri Altman, Bean Huo,
	Stanley Chu, Can Guo

On Mon, Feb 27, 2023 at 03:15:51PM -0800, Jaegeuk Kim wrote:
> On 02/15, Christoph Hellwig wrote:
> > Why does UFS even have it's own common tracing instad of just relying
> > on the core SCSI one, and even worse pokes into command set specifics
> > which is a no-go for LLDDs.  This code simply needs to go away instead
> > of beeing "enhanced".
> 
> I'm not sure how all the other vendors use the trace tho, at least to me,
> it's quite useful when debugging any UFS-specific information such as
> group_id

The group ID isn't even ever set, how can it be useful to you?

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

* Re: [PATCH] scsi: ufs: support IO traces for zoned block device
  2023-02-28  7:28     ` Avri Altman
@ 2023-03-20 12:55       ` hch
  0 siblings, 0 replies; 7+ messages in thread
From: hch @ 2023-03-20 12:55 UTC (permalink / raw)
  To: Avri Altman
  Cc: Jaegeuk Kim, hch, linux-kernel, linux-scsi, Martin K . Petersen,
	Bart Van Assche, Adrian Hunter, Bean Huo, Stanley Chu, Can Guo

On Tue, Feb 28, 2023 at 07:28:35AM +0000, Avri Altman wrote:
> > doorbell status along with the attached scsi command, in addition to the
> > accurate latency measurements.
> For us as well.
> Moreover, we are mainly using upiu tracing which is not available at scsi ML.

So let's rework the tracepoints to work at the UPIU level and stop the
gracious poking into SCSI CDBs.

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

end of thread, other threads:[~2023-03-20 12:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-15 19:04 [PATCH] scsi: ufs: support IO traces for zoned block device Jaegeuk Kim
2023-02-15 19:13 ` Bart Van Assche
2023-02-16  6:01 ` Christoph Hellwig
2023-02-27 23:15   ` Jaegeuk Kim
2023-02-28  7:28     ` Avri Altman
2023-03-20 12:55       ` hch
2023-03-20 12:55     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).