[PATCH] scsi: ufs: support IO traces for zoned block device

From: Jaegeuk Kim
Date: Wed Feb 15 2023 - 14:05:00 EST


From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>

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

Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx>
---
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