summaryrefslogtreecommitdiffstats
path: root/include/trace/events/block.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-01-11 13:06:36 -0800
committerJens Axboe <axboe@kernel.dk>2013-01-14 15:00:36 +0100
commit5305cb830834549b9203ad4d009ad5483c5e293f (patch)
tree9781e0181cb1f3c8f6fa2c5ad2de445333383b87 /include/trace/events/block.h
parentf0059afd3e6e7aa1a0ffc23468b74c43d47660b8 (diff)
downloadtalos-op-linux-5305cb830834549b9203ad4d009ad5483c5e293f.tar.gz
talos-op-linux-5305cb830834549b9203ad4d009ad5483c5e293f.zip
block: add block_{touch|dirty}_buffer tracepoint
The former is triggered from touch_buffer() and the latter mark_buffer_dirty(). This is part of tracepoint additions to improve visiblity into dirtying / writeback operations for io tracer and userland. v2: Transformed writeback_dirty_buffer to block_dirty_buffer and made it share TP definition with block_touch_buffer. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/trace/events/block.h')
-rw-r--r--include/trace/events/block.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index b408f518a819..9961726523d0 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -6,10 +6,61 @@
#include <linux/blktrace_api.h>
#include <linux/blkdev.h>
+#include <linux/buffer_head.h>
#include <linux/tracepoint.h>
#define RWBS_LEN 8
+DECLARE_EVENT_CLASS(block_buffer,
+
+ TP_PROTO(struct buffer_head *bh),
+
+ TP_ARGS(bh),
+
+ TP_STRUCT__entry (
+ __field( dev_t, dev )
+ __field( sector_t, sector )
+ __field( size_t, size )
+ ),
+
+ TP_fast_assign(
+ __entry->dev = bh->b_bdev->bd_dev;
+ __entry->sector = bh->b_blocknr;
+ __entry->size = bh->b_size;
+ ),
+
+ TP_printk("%d,%d sector=%llu size=%zu",
+ MAJOR(__entry->dev), MINOR(__entry->dev),
+ (unsigned long long)__entry->sector, __entry->size
+ )
+);
+
+/**
+ * block_touch_buffer - mark a buffer accessed
+ * @bh: buffer_head being touched
+ *
+ * Called from touch_buffer().
+ */
+DEFINE_EVENT(block_buffer, block_touch_buffer,
+
+ TP_PROTO(struct buffer_head *bh),
+
+ TP_ARGS(bh)
+);
+
+/**
+ * block_dirty_buffer - mark a buffer dirty
+ * @bh: buffer_head being dirtied
+ *
+ * Called from mark_buffer_dirty().
+ */
+DEFINE_EVENT(block_buffer, block_dirty_buffer,
+
+ TP_PROTO(struct buffer_head *bh),
+
+ TP_ARGS(bh)
+);
+
DECLARE_EVENT_CLASS(block_rq_with_error,
TP_PROTO(struct request_queue *q, struct request *rq),
OpenPOWER on IntegriCloud