提交 c7149d6b 编写于 作者: A Alan D. Brunelle 提交者: Jens Axboe

Fix remap handling by blktrace

This patch provides more information concerning REMAP operations on block
IOs. The additional information provides clearer details at the user level,
and supports post-processing analysis in btt.

o  Adds in partition remaps on the same device.
o  Fixed up the remap information in DM to be in the right order
o  Sent up mapped-from and mapped-to device information
Signed-off-by: NAlan D. Brunelle <alan.brunelle@hp.com>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 ec05b297
...@@ -3047,6 +3047,10 @@ static inline void blk_partition_remap(struct bio *bio) ...@@ -3047,6 +3047,10 @@ static inline void blk_partition_remap(struct bio *bio)
bio->bi_sector += p->start_sect; bio->bi_sector += p->start_sect;
bio->bi_bdev = bdev->bd_contains; bio->bi_bdev = bdev->bd_contains;
blk_add_trace_remap(bdev_get_queue(bio->bi_bdev), bio,
bdev->bd_dev, bio->bi_sector,
bio->bi_sector - p->start_sect);
} }
} }
......
...@@ -580,8 +580,8 @@ static void __map_bio(struct dm_target *ti, struct bio *clone, ...@@ -580,8 +580,8 @@ static void __map_bio(struct dm_target *ti, struct bio *clone,
/* the bio has been remapped so dispatch it */ /* the bio has been remapped so dispatch it */
blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone,
tio->io->bio->bi_bdev->bd_dev, sector, tio->io->bio->bi_bdev->bd_dev,
clone->bi_sector); clone->bi_sector, sector);
generic_make_request(clone); generic_make_request(clone);
} else if (r < 0 || r == DM_MAPIO_REQUEUE) { } else if (r < 0 || r == DM_MAPIO_REQUEUE) {
......
...@@ -105,7 +105,7 @@ struct blk_io_trace { ...@@ -105,7 +105,7 @@ struct blk_io_trace {
*/ */
struct blk_io_trace_remap { struct blk_io_trace_remap {
__be32 device; __be32 device;
u32 __pad; __be32 device_from;
__be64 sector; __be64 sector;
}; };
...@@ -272,6 +272,7 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, ...@@ -272,6 +272,7 @@ static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio,
return; return;
r.device = cpu_to_be32(dev); r.device = cpu_to_be32(dev);
r.device_from = cpu_to_be32(bio->bi_bdev->bd_dev);
r.sector = cpu_to_be64(to); r.sector = cpu_to_be64(to);
__blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册