summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sd_zbc.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>2022-11-30 02:36:16 -0800
committerMartin K. Petersen <martin.petersen@oracle.com>2022-12-01 03:13:55 +0000
commit9f5436f47c58463f91bfeebcc4613138625098c2 (patch)
tree76d8f991362ec3b42212ab0c856c80ce4362bec4 /drivers/scsi/sd_zbc.c
parent6456ab5d7ccd4fae6e136025480ad4ad91a7c795 (diff)
downloadlinux-stable-9f5436f47c58463f91bfeebcc4613138625098c2.tar.gz
linux-stable-9f5436f47c58463f91bfeebcc4613138625098c2.tar.bz2
linux-stable-9f5436f47c58463f91bfeebcc4613138625098c2.zip
scsi: sd: sd_zbc: Trace zone append emulation
Add tracepoints to the SCSI zone append emulation in order to trace the zone start to write-pointer aligned LBA translation and the corresponding completion. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Link: https://lore.kernel.org/r/d103bcf5f90139143469f2a0084c74bd9e03ad4a.1669804487.git.johannes.thumshirn@wdc.com Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Jason Yan <yanaijie@huawei.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/sd_zbc.c')
-rw-r--r--drivers/scsi/sd_zbc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index b163bf936acc..62abebbaf2e7 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -20,6 +20,9 @@
#include "sd.h"
+#define CREATE_TRACE_POINTS
+#include "sd_trace.h"
+
/**
* sd_zbc_get_zone_wp_offset - Get zone write pointer offset.
* @zone: Zone for which to return the write pointer offset.
@@ -450,6 +453,7 @@ blk_status_t sd_zbc_prepare_zone_append(struct scsi_cmnd *cmd, sector_t *lba,
break;
}
+ trace_scsi_prepare_zone_append(cmd, *lba, wp_offset);
*lba += wp_offset;
}
spin_unlock_irqrestore(&sdkp->zones_wp_offset_lock, flags);
@@ -558,6 +562,8 @@ static unsigned int sd_zbc_zone_wp_update(struct scsi_cmnd *cmd,
switch (op) {
case REQ_OP_ZONE_APPEND:
+ trace_scsi_zone_wp_update(cmd, rq->__sector,
+ sdkp->zones_wp_offset[zno], good_bytes);
rq->__sector += sdkp->zones_wp_offset[zno];
fallthrough;
case REQ_OP_WRITE_ZEROES: