aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events/block.h
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2013-01-11 16:06:36 -0500
committerJens Axboe <axboe@kernel.dk>2013-01-14 09:00:36 -0500
commit5305cb830834549b9203ad4d009ad5483c5e293f (patch)
tree9781e0181cb1f3c8f6fa2c5ad2de445333383b87 /include/trace/events/block.h
parentf0059afd3e6e7aa1a0ffc23468b74c43d47660b8 (diff)
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 @@
6 6
7#include <linux/blktrace_api.h> 7#include <linux/blktrace_api.h>
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <linux/buffer_head.h>
9#include <linux/tracepoint.h> 10#include <linux/tracepoint.h>
10 11
11#define RWBS_LEN 8 12#define RWBS_LEN 8
12 13
14DECLARE_EVENT_CLASS(block_buffer,
15
16 TP_PROTO(struct buffer_head *bh),
17
18 TP_ARGS(bh),
19
20 TP_STRUCT__entry (
21 __field( dev_t, dev )
22 __field( sector_t, sector )
23 __field( size_t, size )
24 ),
25
26 TP_fast_assign(
27 __entry->dev = bh->b_bdev->bd_dev;
28 __entry->sector = bh->b_blocknr;
29 __entry->size = bh->b_size;
30 ),
31
32 TP_printk("%d,%d sector=%llu size=%zu",
33 MAJOR(__entry->dev), MINOR(__entry->dev),
34 (unsigned long long)__entry->sector, __entry->size
35 )
36);
37
38/**
39 * block_touch_buffer - mark a buffer accessed
40 * @bh: buffer_head being touched
41 *
42 * Called from touch_buffer().
43 */
44DEFINE_EVENT(block_buffer, block_touch_buffer,
45
46 TP_PROTO(struct buffer_head *bh),
47
48 TP_ARGS(bh)
49);
50
51/**
52 * block_dirty_buffer - mark a buffer dirty
53 * @bh: buffer_head being dirtied
54 *
55 * Called from mark_buffer_dirty().
56 */
57DEFINE_EVENT(block_buffer, block_dirty_buffer,
58
59 TP_PROTO(struct buffer_head *bh),
60
61 TP_ARGS(bh)
62);
63
13DECLARE_EVENT_CLASS(block_rq_with_error, 64DECLARE_EVENT_CLASS(block_rq_with_error,
14 65
15 TP_PROTO(struct request_queue *q, struct request *rq), 66 TP_PROTO(struct request_queue *q, struct request *rq),