ANDROID: scsi: ufs: Support I/O tracing for zoned block devices

Let's support tracing for WRITE(16), READ(16), ZBC IN and ZBC OUT.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Bug: 269471019
Bug: 415836627
Link: https://lore.kernel.org/linux-scsi/20230215190448.1687786-1-jaegeuk@kernel.org/
Change-Id: Ie6a1e42b8fdf38a21ca45de0b2384550171cbcdd
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
Bart Van Assche
2025-04-08 14:23:11 -07:00
parent e395d18c8b
commit 392bbaffdc
2 changed files with 7 additions and 5 deletions

View File

@@ -19,7 +19,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") \

View File

@@ -491,15 +491,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.