Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359516
b: refs/heads/master
c: 8c1cf6b
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jens Axboe committed Jan 14, 2013
1 parent 94b7069 commit 636a457
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3a366e614d0837d9fc23f78cdb1a1186ebc3387f
refs/heads/master: 8c1cf6bb02fda79b0a4b9bd121f6be6d4ce7a15a
4 changes: 2 additions & 2 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1347,7 +1347,7 @@ static bool bio_attempt_back_merge(struct request_queue *q, struct request *req,
if (!ll_back_merge_fn(q, req, bio))
return false;

trace_block_bio_backmerge(q, bio);
trace_block_bio_backmerge(q, req, bio);

if ((req->cmd_flags & REQ_FAILFAST_MASK) != ff)
blk_rq_set_mixed_merge(req);
Expand All @@ -1369,7 +1369,7 @@ static bool bio_attempt_front_merge(struct request_queue *q,
if (!ll_front_merge_fn(q, req, bio))
return false;

trace_block_bio_frontmerge(q, bio);
trace_block_bio_frontmerge(q, req, bio);

if ((req->cmd_flags & REQ_FAILFAST_MASK) != ff)
blk_rq_set_mixed_merge(req);
Expand Down
45 changes: 34 additions & 11 deletions trunk/include/trace/events/block.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ TRACE_EVENT(block_bio_complete,
__entry->nr_sector, __entry->error)
);

DECLARE_EVENT_CLASS(block_bio,
DECLARE_EVENT_CLASS(block_bio_merge,

TP_PROTO(struct request_queue *q, struct bio *bio),
TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),

TP_ARGS(q, bio),
TP_ARGS(q, rq, bio),

TP_STRUCT__entry(
__field( dev_t, dev )
Expand All @@ -272,31 +272,33 @@ DECLARE_EVENT_CLASS(block_bio,
/**
* block_bio_backmerge - merging block operation to the end of an existing operation
* @q: queue holding operation
* @rq: request bio is being merged into
* @bio: new block operation to merge
*
* Merging block request @bio to the end of an existing block request
* in queue @q.
*/
DEFINE_EVENT(block_bio, block_bio_backmerge,
DEFINE_EVENT(block_bio_merge, block_bio_backmerge,

TP_PROTO(struct request_queue *q, struct bio *bio),
TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),

TP_ARGS(q, bio)
TP_ARGS(q, rq, bio)
);

/**
* block_bio_frontmerge - merging block operation to the beginning of an existing operation
* @q: queue holding operation
* @rq: request bio is being merged into
* @bio: new block operation to merge
*
* Merging block IO operation @bio to the beginning of an existing block
* operation in queue @q.
*/
DEFINE_EVENT(block_bio, block_bio_frontmerge,
DEFINE_EVENT(block_bio_merge, block_bio_frontmerge,

TP_PROTO(struct request_queue *q, struct bio *bio),
TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),

TP_ARGS(q, bio)
TP_ARGS(q, rq, bio)
);

/**
Expand All @@ -306,11 +308,32 @@ DEFINE_EVENT(block_bio, block_bio_frontmerge,
*
* About to place the block IO operation @bio into queue @q.
*/
DEFINE_EVENT(block_bio, block_bio_queue,
TRACE_EVENT(block_bio_queue,

TP_PROTO(struct request_queue *q, struct bio *bio),

TP_ARGS(q, bio)
TP_ARGS(q, bio),

TP_STRUCT__entry(
__field( dev_t, dev )
__field( sector_t, sector )
__field( unsigned int, nr_sector )
__array( char, rwbs, RWBS_LEN )
__array( char, comm, TASK_COMM_LEN )
),

TP_fast_assign(
__entry->dev = bio->bi_bdev->bd_dev;
__entry->sector = bio->bi_sector;
__entry->nr_sector = bio->bi_size >> 9;
blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size);
memcpy(__entry->comm, current->comm, TASK_COMM_LEN);
),

TP_printk("%d,%d %s %llu + %u [%s]",
MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs,
(unsigned long long)__entry->sector,
__entry->nr_sector, __entry->comm)
);

DECLARE_EVENT_CLASS(block_get_rq,
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/trace/blktrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,13 +803,15 @@ static void blk_add_trace_bio_complete(void *ignore, struct bio *bio, int error)

static void blk_add_trace_bio_backmerge(void *ignore,
struct request_queue *q,
struct request *rq,
struct bio *bio)
{
blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE, 0);
}

static void blk_add_trace_bio_frontmerge(void *ignore,
struct request_queue *q,
struct request *rq,
struct bio *bio)
{
blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE, 0);
Expand Down

0 comments on commit 636a457

Please sign in to comment.