Skip to content

Commit 61897c9

Browse files
morbidrsakawasaki
authored andcommitted
block: add trace messages to zone write plugging
Add tracepoints to zone write plugging plug and unplug events. Examples for these events are: kworker/u10:4-393 [001] d..1. 282.991660: disk_zone_wplug_add_bio: 8,0 zone 16, BIO 8388608 + 128 kworker/0:1H-58 [ [000] d..1. 283.083294: blk_zone_wplug_bio: 8,0 zone 15, BIO 7864320 + 128 Reviewed-by: Chaitanya Kulkarni <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]>
1 parent e16b669 commit 61897c9

2 files changed

Lines changed: 49 additions & 0 deletions

File tree

block/blk-zoned.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,8 @@ static inline void disk_zone_wplug_add_bio(struct gendisk *disk,
822822
* at the tail of the list to preserve the sequential write order.
823823
*/
824824
bio_list_add(&zwplug->bio_list, bio);
825+
trace_disk_zone_wplug_add_bio(zwplug->disk->queue, zwplug->zone_no,
826+
bio->bi_iter.bi_sector, bio_sectors(bio));
825827

826828
zwplug->flags |= BLK_ZONE_WPLUG_PLUGGED;
827829

@@ -1317,6 +1319,9 @@ static void blk_zone_wplug_bio_work(struct work_struct *work)
13171319
goto put_zwplug;
13181320
}
13191321

1322+
trace_blk_zone_wplug_bio(zwplug->disk->queue, zwplug->zone_no,
1323+
bio->bi_iter.bi_sector, bio_sectors(bio));
1324+
13201325
if (!blk_zone_wplug_prepare_bio(zwplug, bio)) {
13211326
blk_zone_wplug_bio_io_error(zwplug, bio);
13221327
goto again;

include/trace/events/block.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,50 @@ TRACE_EVENT(blkdev_zone_mgmt,
633633
(unsigned long long)__entry->sector,
634634
__entry->nr_sectors)
635635
);
636+
637+
DECLARE_EVENT_CLASS(block_zwplug,
638+
639+
TP_PROTO(struct request_queue *q, unsigned int zno, sector_t sector,
640+
unsigned int nr_sectors),
641+
642+
TP_ARGS(q, zno, sector, nr_sectors),
643+
644+
TP_STRUCT__entry(
645+
__field( dev_t, dev )
646+
__field( unsigned int, zno )
647+
__field( sector_t, sector )
648+
__field( unsigned int, nr_sectors )
649+
),
650+
651+
TP_fast_assign(
652+
__entry->dev = disk_devt(q->disk);
653+
__entry->zno = zno;
654+
__entry->sector = sector;
655+
__entry->nr_sectors = nr_sectors;
656+
),
657+
658+
TP_printk("%d,%d zone %u, BIO %llu + %u",
659+
MAJOR(__entry->dev), MINOR(__entry->dev), __entry->zno,
660+
(unsigned long long)__entry->sector,
661+
__entry->nr_sectors)
662+
);
663+
664+
DEFINE_EVENT(block_zwplug, disk_zone_wplug_add_bio,
665+
666+
TP_PROTO(struct request_queue *q, unsigned int zno, sector_t sector,
667+
unsigned int nr_sectors),
668+
669+
TP_ARGS(q, zno, sector, nr_sectors)
670+
);
671+
672+
DEFINE_EVENT(block_zwplug, blk_zone_wplug_bio,
673+
674+
TP_PROTO(struct request_queue *q, unsigned int zno, sector_t sector,
675+
unsigned int nr_sectors),
676+
677+
TP_ARGS(q, zno, sector, nr_sectors)
678+
);
679+
636680
#endif /* _TRACE_BLOCK_H */
637681

638682
/* This part must be outside protection */

0 commit comments

Comments
 (0)