Re: [PATCH v2 13/15] blktrace: trace zone management operations

Johannes Thumshirn
2025-10-08T13:29:35Z

On 10/1/25 9:30 AM, Damien Le Moal wrote:
> On 9/26/25 00:02, Johannes Thumshirn wrote:
>> Trace zone management operations on block devices.
>>
>> As tracing of zoned block commands needs the upper 32bit of the widened
>> 64bit action, only add traces to blktrace if user-space has requested
>> version 2 of the blktrace protocol.
>>
>> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
>
> Note: Are the zone management command completion traced ? I do not see a patch
> for that...
>
>

I finally had a chance to look into zone management command tracing
again, but the problem here is we're having this pattern:

int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op,
sector_t sector, sector_t nr_sectors)
{

/* [...] */

trace_blkdev_zone_mgmt(bio, nr_sectors);
ret = submit_bio_wait(bio);
bio_put(bio);

return ret;

}

I'm not sure if it makes sense to do completion tracing here. At least
we cannot do it in the endio handler as usual.

One thing to get the error and the duration would be the following:

int blkdev_zone_mgmt(struct block_device *bdev, enum req_op op,
sector_t sector, sector_t nr_sectors)
{

/* [...] */

trace_blkdev_zone_mgmt(bio, nr_sectors);
ret = submit_bio_wait(bio);

+     trace_blkdev_zone_mgmt_completion(bio, nr_sectors, bio->bi_error);
bio_put(bio);

return ret;

}