null_blk: add trace in null_blk_zoned.c

With the help of previously added tracepoints we can now trace
report-zones, zone-write and zone-mgmt ops in null_blk_zoned.c.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Chaitanya Kulkarni 2020-03-25 10:49:56 -07:00 committed by Jens Axboe
parent c51d041998
commit 766c3297d7

View File

@ -2,6 +2,9 @@
#include <linux/vmalloc.h>
#include "null_blk.h"
#define CREATE_TRACE_POINTS
#include "null_blk_trace.h"
/* zone_size in MBs to sectors. */
#define ZONE_SIZE_SHIFT 11
@ -80,6 +83,8 @@ int null_report_zones(struct gendisk *disk, sector_t sector,
return 0;
nr_zones = min(nr_zones, dev->nr_zones - first_zone);
trace_nullb_report_zones(nullb, nr_zones);
for (i = 0; i < nr_zones; i++) {
/*
* Stacked DM target drivers will remap the zone information by
@ -148,6 +153,8 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector,
/* Invalid zone condition */
return BLK_STS_IOERR;
}
trace_nullb_zone_op(cmd, zno, zone->cond);
return BLK_STS_OK;
}
@ -155,7 +162,8 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op,
sector_t sector)
{
struct nullb_device *dev = cmd->nq->dev;
struct blk_zone *zone = &dev->zones[null_zone_no(dev, sector)];
unsigned int zone_no = null_zone_no(dev, sector);
struct blk_zone *zone = &dev->zones[zone_no];
size_t i;
switch (op) {
@ -203,6 +211,8 @@ static blk_status_t null_zone_mgmt(struct nullb_cmd *cmd, enum req_opf op,
default:
return BLK_STS_NOTSUPP;
}
trace_nullb_zone_op(cmd, zone_no, zone->cond);
return BLK_STS_OK;
}