提交 40359ccb 编写于 作者: N Nathan Scott 提交者: Jens Axboe

[PATCH] blktrace: readahead support

Provide the needed kernel support for distinguishing readahead
from regular read requests when tracing block devices.
Signed-off-by: NNathan Scott <nathans@sgi.com>
Signed-off-by: NJens Axboe <axboe@suse.de>
上级 fc0a75ce
...@@ -69,7 +69,7 @@ static u32 ddir_act[2] __read_mostly = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK ...@@ -69,7 +69,7 @@ static u32 ddir_act[2] __read_mostly = { BLK_TC_ACT(BLK_TC_READ), BLK_TC_ACT(BLK
/* /*
* Bio action bits of interest * Bio action bits of interest
*/ */
static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC) }; static u32 bio_act[5] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_ACT(BLK_TC_SYNC), 0, BLK_TC_ACT(BLK_TC_AHEAD) };
/* /*
* More could be added as needed, taking care to increment the decrementer * More could be added as needed, taking care to increment the decrementer
...@@ -79,6 +79,8 @@ static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_AC ...@@ -79,6 +79,8 @@ static u32 bio_act[3] __read_mostly = { 0, BLK_TC_ACT(BLK_TC_BARRIER), BLK_TC_AC
(((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0)) (((rw) & (1 << BIO_RW_BARRIER)) >> (BIO_RW_BARRIER - 0))
#define trace_sync_bit(rw) \ #define trace_sync_bit(rw) \
(((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1)) (((rw) & (1 << BIO_RW_SYNC)) >> (BIO_RW_SYNC - 1))
#define trace_ahead_bit(rw) \
(((rw) & (1 << BIO_RW_AHEAD)) << (BIO_RW_AHEAD - 0))
/* /*
* The worker for the various blk_add_trace*() types. Fills out a * The worker for the various blk_add_trace*() types. Fills out a
...@@ -100,6 +102,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes, ...@@ -100,6 +102,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
what |= ddir_act[rw & WRITE]; what |= ddir_act[rw & WRITE];
what |= bio_act[trace_barrier_bit(rw)]; what |= bio_act[trace_barrier_bit(rw)];
what |= bio_act[trace_sync_bit(rw)]; what |= bio_act[trace_sync_bit(rw)];
what |= bio_act[trace_ahead_bit(rw)];
pid = tsk->pid; pid = tsk->pid;
if (unlikely(act_log_check(bt, what, sector, pid))) if (unlikely(act_log_check(bt, what, sector, pid)))
......
...@@ -19,6 +19,7 @@ enum blktrace_cat { ...@@ -19,6 +19,7 @@ enum blktrace_cat {
BLK_TC_FS = 1 << 8, /* fs requests */ BLK_TC_FS = 1 << 8, /* fs requests */
BLK_TC_PC = 1 << 9, /* pc requests */ BLK_TC_PC = 1 << 9, /* pc requests */
BLK_TC_NOTIFY = 1 << 10, /* special message */ BLK_TC_NOTIFY = 1 << 10, /* special message */
BLK_TC_AHEAD = 1 << 11, /* readahead */
BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ BLK_TC_END = 1 << 15, /* only 16-bits, reminder */
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册