diff options
-rw-r--r-- | fs/buffer.c | 4 | ||||
-rw-r--r-- | include/trace/events/block.h | 51 |
2 files changed, 55 insertions, 0 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index a8c2dfb68dcd..87ff335fbbe3 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/bitops.h> | 41 | #include <linux/bitops.h> |
42 | #include <linux/mpage.h> | 42 | #include <linux/mpage.h> |
43 | #include <linux/bit_spinlock.h> | 43 | #include <linux/bit_spinlock.h> |
44 | #include <trace/events/block.h> | ||
44 | 45 | ||
45 | static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); | 46 | static int fsync_buffers_list(spinlock_t *lock, struct list_head *list); |
46 | 47 | ||
@@ -55,6 +56,7 @@ EXPORT_SYMBOL(init_buffer); | |||
55 | 56 | ||
56 | inline void touch_buffer(struct buffer_head *bh) | 57 | inline void touch_buffer(struct buffer_head *bh) |
57 | { | 58 | { |
59 | trace_block_touch_buffer(bh); | ||
58 | mark_page_accessed(bh->b_page); | 60 | mark_page_accessed(bh->b_page); |
59 | } | 61 | } |
60 | EXPORT_SYMBOL(touch_buffer); | 62 | EXPORT_SYMBOL(touch_buffer); |
@@ -1119,6 +1121,8 @@ void mark_buffer_dirty(struct buffer_head *bh) | |||
1119 | { | 1121 | { |
1120 | WARN_ON_ONCE(!buffer_uptodate(bh)); | 1122 | WARN_ON_ONCE(!buffer_uptodate(bh)); |
1121 | 1123 | ||
1124 | trace_block_dirty_buffer(bh); | ||
1125 | |||
1122 | /* | 1126 | /* |
1123 | * Very *carefully* optimize the it-is-already-dirty case. | 1127 | * Very *carefully* optimize the it-is-already-dirty case. |
1124 | * | 1128 | * |
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 | ||
14 | DECLARE_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 | */ | ||
44 | DEFINE_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 | */ | ||
57 | DEFINE_EVENT(block_buffer, block_dirty_buffer, | ||
58 | |||
59 | TP_PROTO(struct buffer_head *bh), | ||
60 | |||
61 | TP_ARGS(bh) | ||
62 | ); | ||
63 | |||
13 | DECLARE_EVENT_CLASS(block_rq_with_error, | 64 | DECLARE_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), |