diff options
author | Jens Axboe <axboe@suse.de> | 2006-03-23 14:00:26 -0500 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2006-03-23 14:00:26 -0500 |
commit | 2056a782f8e7e65fd4bfd027506b4ce1c5e9ccd4 (patch) | |
tree | d4fe59a7ca0c110690937085548936a4535c39db /drivers | |
parent | 6dac40a7ce2483a47b54af07afebeb84131c7228 (diff) |
[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 e29b8926f80e..1f2890989b56 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/hdreg.h> | 38 | #include <linux/hdreg.h> |
39 | #include <linux/spinlock.h> | 39 | #include <linux/spinlock.h> |
40 | #include <linux/compat.h> | 40 | #include <linux/compat.h> |
41 | #include <linux/blktrace_api.h> | ||
41 | #include <asm/uaccess.h> | 42 | #include <asm/uaccess.h> |
42 | #include <asm/io.h> | 43 | #include <asm/io.h> |
43 | 44 | ||
@@ -2331,6 +2332,7 @@ static inline void complete_command( ctlr_info_t *h, CommandList_struct *cmd, | |||
2331 | 2332 | ||
2332 | cmd->rq->completion_data = cmd; | 2333 | cmd->rq->completion_data = cmd; |
2333 | cmd->rq->errors = status; | 2334 | cmd->rq->errors = status; |
2335 | blk_add_trace_rq(cmd->rq->q, cmd->rq, BLK_TA_COMPLETE); | ||
2334 | blk_complete_request(cmd->rq); | 2336 | blk_complete_request(cmd->rq); |
2335 | } | 2337 | } |
2336 | 2338 | ||
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 26b08ee425c7..8c82373f7ff3 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mempool.h> | 17 | #include <linux/mempool.h> |
18 | #include <linux/slab.h> | 18 | #include <linux/slab.h> |
19 | #include <linux/idr.h> | 19 | #include <linux/idr.h> |
20 | #include <linux/blktrace_api.h> | ||
20 | 21 | ||
21 | static const char *_name = DM_NAME; | 22 | static const char *_name = DM_NAME; |
22 | 23 | ||
@@ -334,6 +335,8 @@ static void dec_pending(struct dm_io *io, int error) | |||
334 | /* nudge anyone waiting on suspend queue */ | 335 | /* nudge anyone waiting on suspend queue */ |
335 | wake_up(&io->md->wait); | 336 | wake_up(&io->md->wait); |
336 | 337 | ||
338 | blk_add_trace_bio(io->md->queue, io->bio, BLK_TA_COMPLETE); | ||
339 | |||
337 | bio_endio(io->bio, io->bio->bi_size, io->error); | 340 | bio_endio(io->bio, io->bio->bi_size, io->error); |
338 | free_io(io->md, io); | 341 | free_io(io->md, io); |
339 | } | 342 | } |
@@ -392,6 +395,7 @@ static void __map_bio(struct dm_target *ti, struct bio *clone, | |||
392 | struct target_io *tio) | 395 | struct target_io *tio) |
393 | { | 396 | { |
394 | int r; | 397 | int r; |
398 | sector_t sector; | ||
395 | 399 | ||
396 | /* | 400 | /* |
397 | * Sanity checks. | 401 | * Sanity checks. |
@@ -407,10 +411,17 @@ static void __map_bio(struct dm_target *ti, struct bio *clone, | |||
407 | * this io. | 411 | * this io. |
408 | */ | 412 | */ |
409 | atomic_inc(&tio->io->io_count); | 413 | atomic_inc(&tio->io->io_count); |
414 | sector = clone->bi_sector; | ||
410 | r = ti->type->map(ti, clone, &tio->info); | 415 | r = ti->type->map(ti, clone, &tio->info); |
411 | if (r > 0) | 416 | if (r > 0) { |
412 | /* the bio has been remapped so dispatch it */ | 417 | /* the bio has been remapped so dispatch it */ |
418 | |||
419 | blk_add_trace_remap(bdev_get_queue(clone->bi_bdev), clone, | ||
420 | tio->io->bio->bi_bdev->bd_dev, sector, | ||
421 | clone->bi_sector); | ||
422 | |||
413 | generic_make_request(clone); | 423 | generic_make_request(clone); |
424 | } | ||
414 | 425 | ||
415 | else if (r < 0) { | 426 | else if (r < 0) { |
416 | /* error the io and bail out */ | 427 | /* error the io and bail out */ |