block: simplify and extend the block_bio_merge tracepoint class
The block_bio_merge tracepoint class can be reused for most bio-based tracepoints. For that it just needs to lose the superfluous q and rq parameters. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
b81b8f40c5
commit
e8a676d61c
+10
-31
@@ -906,10 +906,9 @@ static void blk_add_trace_bio(struct request_queue *q, struct bio *bio,
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static void blk_add_trace_bio_bounce(void *ignore,
|
||||
struct request_queue *q, struct bio *bio)
|
||||
static void blk_add_trace_bio_bounce(void *ignore, struct bio *bio)
|
||||
{
|
||||
blk_add_trace_bio(q, bio, BLK_TA_BOUNCE, 0);
|
||||
blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_BOUNCE, 0);
|
||||
}
|
||||
|
||||
static void blk_add_trace_bio_complete(void *ignore,
|
||||
@@ -919,44 +918,24 @@ static void blk_add_trace_bio_complete(void *ignore,
|
||||
blk_status_to_errno(bio->bi_status));
|
||||
}
|
||||
|
||||
static void blk_add_trace_bio_backmerge(void *ignore,
|
||||
struct request_queue *q,
|
||||
struct request *rq,
|
||||
struct bio *bio)
|
||||
static void blk_add_trace_bio_backmerge(void *ignore, struct bio *bio)
|
||||
{
|
||||
blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE, 0);
|
||||
blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_BACKMERGE, 0);
|
||||
}
|
||||
|
||||
static void blk_add_trace_bio_frontmerge(void *ignore,
|
||||
struct request_queue *q,
|
||||
struct request *rq,
|
||||
struct bio *bio)
|
||||
static void blk_add_trace_bio_frontmerge(void *ignore, struct bio *bio)
|
||||
{
|
||||
blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE, 0);
|
||||
blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_FRONTMERGE, 0);
|
||||
}
|
||||
|
||||
static void blk_add_trace_bio_queue(void *ignore,
|
||||
struct request_queue *q, struct bio *bio)
|
||||
static void blk_add_trace_bio_queue(void *ignore, struct bio *bio)
|
||||
{
|
||||
blk_add_trace_bio(q, bio, BLK_TA_QUEUE, 0);
|
||||
blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_QUEUE, 0);
|
||||
}
|
||||
|
||||
static void blk_add_trace_getrq(void *ignore,
|
||||
struct request_queue *q,
|
||||
struct bio *bio, int rw)
|
||||
static void blk_add_trace_getrq(void *ignore, struct bio *bio)
|
||||
{
|
||||
if (bio)
|
||||
blk_add_trace_bio(q, bio, BLK_TA_GETRQ, 0);
|
||||
else {
|
||||
struct blk_trace *bt;
|
||||
|
||||
rcu_read_lock();
|
||||
bt = rcu_dereference(q->blk_trace);
|
||||
if (bt)
|
||||
__blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_GETRQ, 0, 0,
|
||||
NULL, 0);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_GETRQ, 0);
|
||||
}
|
||||
|
||||
static void blk_add_trace_plug(void *ignore, struct request_queue *q)
|
||||
|
||||
Reference in New Issue
Block a user