Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359518
b: refs/heads/master
c: 5305cb8
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Jan 14, 2013
1 parent bf68284 commit 9590765
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0059afd3e6e7aa1a0ffc23468b74c43d47660b8
refs/heads/master: 5305cb830834549b9203ad4d009ad5483c5e293f
4 changes: 4 additions & 0 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include <linux/bitops.h>
#include <linux/mpage.h>
#include <linux/bit_spinlock.h>
#include <trace/events/block.h>

static int fsync_buffers_list(spinlock_t *lock, struct list_head *list);

Expand All @@ -55,6 +56,7 @@ EXPORT_SYMBOL(init_buffer);

inline void touch_buffer(struct buffer_head *bh)
{
trace_block_touch_buffer(bh);
mark_page_accessed(bh->b_page);
}
EXPORT_SYMBOL(touch_buffer);
Expand Down Expand Up @@ -1119,6 +1121,8 @@ void mark_buffer_dirty(struct buffer_head *bh)
{
WARN_ON_ONCE(!buffer_uptodate(bh));

trace_block_dirty_buffer(bh);

/*
* Very *carefully* optimize the it-is-already-dirty case.
*
Expand Down
51 changes: 51 additions & 0 deletions trunk/include/trace/events/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 9590765

Please sign in to comment.