summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJun'ichi Nomura <j-nomura@ce.jp.nec.com>2009-10-01 21:16:13 +0200
committerJens Axboe <jens.axboe@oracle.com>2009-10-01 21:19:34 +0200
commitb0da3f0dada78832c9da03ad2152ae76bd9a2496 (patch)
tree58380f5d8f3c313fbb9fd0310509a408b38a0399 /include
parent67efc9258010da35b27b3854d0880c7e193004ed (diff)
downloadop-kernel-dev-b0da3f0dada78832c9da03ad2152ae76bd9a2496.zip
op-kernel-dev-b0da3f0dada78832c9da03ad2152ae76bd9a2496.tar.gz
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')
-rw-r--r--include/linux/blktrace_api.h2
-rw-r--r--include/trace/events/block.h33
2 files changed, 34 insertions, 1 deletions
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 622939a..3b73b99 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -212,7 +212,7 @@ extern struct attribute_group blk_trace_attr_group;
# define blk_trace_startstop(q, start) (-ENOTTY)
# define blk_trace_remove(q) (-ENOTTY)
# define blk_add_trace_msg(q, fmt, ...) do { } while (0)
-# define blk_trace_remove_sysfs(struct device *dev) do { } while (0)
+# define blk_trace_remove_sysfs(dev) do { } while (0)
static inline int blk_trace_init_sysfs(struct device *dev)
{
return 0;
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index d86af94..00405b5 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -488,6 +488,39 @@ TRACE_EVENT(block_remap,
(unsigned long long)__entry->old_sector)
);
+TRACE_EVENT(block_rq_remap,
+
+ TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev,
+ sector_t from),
+
+ TP_ARGS(q, rq, dev, from),
+
+ TP_STRUCT__entry(
+ __field( dev_t, dev )
+ __field( sector_t, sector )
+ __field( unsigned int, nr_sector )
+ __field( dev_t, old_dev )
+ __field( sector_t, old_sector )
+ __array( char, rwbs, 6 )
+ ),
+
+ TP_fast_assign(
+ __entry->dev = disk_devt(rq->rq_disk);
+ __entry->sector = blk_rq_pos(rq);
+ __entry->nr_sector = blk_rq_sectors(rq);
+ __entry->old_dev = dev;
+ __entry->old_sector = from;
+ blk_fill_rwbs_rq(__entry->rwbs, rq);
+ ),
+
+ TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
+ MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
+ (unsigned long long)__entry->sector,
+ __entry->nr_sector,
+ MAJOR(__entry->old_dev), MINOR(__entry->old_dev),
+ (unsigned long long)__entry->old_sector)
+);
+
#endif /* _TRACE_BLOCK_H */
/* This part must be outside protection */
OpenPOWER on IntegriCloud