diff options
author | Jun'ichi Nomura <j-nomura@ce.jp.nec.com> | 2009-10-01 15:16:13 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-10-01 15:19:34 -0400 |
commit | b0da3f0dada78832c9da03ad2152ae76bd9a2496 (patch) | |
tree | 58380f5d8f3c313fbb9fd0310509a408b38a0399 /include/trace | |
parent | 67efc9258010da35b27b3854d0880c7e193004ed (diff) |
Add a tracepoint for block request remapping
Since 2.6.31 now has request-based device-mapper, it's useful to have
a tracepoint for request-remapping as well as bio-remapping.
This patch adds a tracepoint for request-remapping, trace_block_rq_remap().
Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/block.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index d86af94691c2..00405b5f624a 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -488,6 +488,39 @@ TRACE_EVENT(block_remap, | |||
488 | (unsigned long long)__entry->old_sector) | 488 | (unsigned long long)__entry->old_sector) |
489 | ); | 489 | ); |
490 | 490 | ||
491 | TRACE_EVENT(block_rq_remap, | ||
492 | |||
493 | TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev, | ||
494 | sector_t from), | ||
495 | |||
496 | TP_ARGS(q, rq, dev, from), | ||
497 | |||
498 | TP_STRUCT__entry( | ||
499 | __field( dev_t, dev ) | ||
500 | __field( sector_t, sector ) | ||
501 | __field( unsigned int, nr_sector ) | ||
502 | __field( dev_t, old_dev ) | ||
503 | __field( sector_t, old_sector ) | ||
504 | __array( char, rwbs, 6 ) | ||
505 | ), | ||
506 | |||
507 | TP_fast_assign( | ||
508 | __entry->dev = disk_devt(rq->rq_disk); | ||
509 | __entry->sector = blk_rq_pos(rq); | ||
510 | __entry->nr_sector = blk_rq_sectors(rq); | ||
511 | __entry->old_dev = dev; | ||
512 | __entry->old_sector = from; | ||
513 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
514 | ), | ||
515 | |||
516 | TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", | ||
517 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
518 | (unsigned long long)__entry->sector, | ||
519 | __entry->nr_sector, | ||
520 | MAJOR(__entry->old_dev), MINOR(__entry->old_dev), | ||
521 | (unsigned long long)__entry->old_sector) | ||
522 | ); | ||
523 | |||
491 | #endif /* _TRACE_BLOCK_H */ | 524 | #endif /* _TRACE_BLOCK_H */ |
492 | 525 | ||
493 | /* This part must be outside protection */ | 526 | /* This part must be outside protection */ |