diff options
author | Jens Axboe <axboe@suse.de> | 2006-03-23 20:00:26 +0100 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2006-03-23 20:00:26 +0100 |
commit | 2056a782f8e7e65fd4bfd027506b4ce1c5e9ccd4 (patch) | |
tree | d4fe59a7ca0c110690937085548936a4535c39db /drivers | |
parent | 6dac40a7ce2483a47b54af07afebeb84131c7228 (diff) | |
download | linux-3.10-2056a782f8e7e65fd4bfd027506b4ce1c5e9ccd4.tar.gz linux-3.10-2056a782f8e7e65fd4bfd027506b4ce1c5e9ccd4.tar.bz2 linux-3.10-2056a782f8e7e65fd4bfd027506b4ce1c5e9ccd4.zip |
[PATCH] Block queue IO tracing support (blktrace) as of 2006-03-23
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/cciss.c | 2 | ||||
-rw-r--r-- | drivers/md/dm.c | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index e29b8926f80..1f2890989b5 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -38,6 +38,7 @@ #include <linux/hdreg.h> #include <linux/spinlock.h> #include <linux/compat.h> +#include <linux/blktrace_api.h> #include <asm/uaccess.h> #include <asm/io.h> @@ -2331,6 +2332,7 @@ static inline void complete_command( ctlr_info_t *h, CommandList_struct *cmd, cmd->rq->completion_data = cmd; cmd->rq->errors = status; + blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE); blk_complete_request(cmd->rq); } diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 26b08ee425c..8c82373f7ff 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -17,6 +17,7 @@ #include <linux/mempool.h> #include <linux/slab.h> #include <linux/idr.h> +#include <linux/blktrace_api.h> static const char *_name = DM_NAME; @@ -334,6 +335,8 @@ static void dec_pending(struct dm_io *io, int error) /* nudge anyone waiting on suspend queue */ wake_up(&io->md->wait); + blk_add_trace_bio(io->md->queue, io->bio, BLK_TA_COMPLETE); + bio_endio(io->bio, io->bio->bi_size, io->error); free_io(io->md, io); } @@ -392,6 +395,7 @@ static void __map_bio(struct dm_target *ti, struct bio *clone, struct target_io *tio) { int r; + sector_t sector; /* * Sanity checks. @@ -407,10 +411,17 @@ static void __map_bio(struct dm_target *ti, struct bio *clone, * this io. */ atomic_inc(&tio->io->io_count); + sector = clone->bi_sector; r = ti->type->map(ti, clone, &tio->info); - if (r > 0) + if (r > 0) { /* the bio has been remapped so dispatch it */ + + blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, + tio->io->bio->bi_bdev->bd_dev, sector, + clone->bi_sector); + generic_make_request(clone); + } else if (r < 0) { /* error the io and bail out */ |