History

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.

Christoph Hellwig committed 5 years ago

Commit e8a676d1 parent b81b8f46 files · +48 −161Browse files

Showing the changes to kernel (1 of 6 files). Show all

Unified · Split

kernel/trace/blktrace.c+10−31
@@ -906,10 +906,9 @@ static void blk_add_trace_bio(struct request_queue *q, struct bio *bio, · 905 unmodified lines
906906 rcu_read_unlock();
907907 }
908908
909−static void blk_add_trace_bio_bounce(void *ignore,
910− struct request_queue *q, struct bio *bio)
909+static void blk_add_trace_bio_bounce(void *ignore, struct bio *bio)
911910 {
912− blk_add_trace_bio(q, bio, BLK_TA_BOUNCE, 0);
911+ blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_BOUNCE, 0);
913912 }
914913
915914 static void blk_add_trace_bio_complete(void *ignore,
@@ -919,44 +918,24 @@ static void blk_add_trace_bio_complete(void *ignore, · 3 unmodified lines
919918 blk_status_to_errno(bio->bi_status));
920919 }
921920
922−static void blk_add_trace_bio_backmerge(void *ignore,
923− struct request_queue *q,
924− struct request *rq,
925− struct bio *bio)
921+static void blk_add_trace_bio_backmerge(void *ignore, struct bio *bio)
926922 {
927− blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE, 0);
923+ blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_BACKMERGE, 0);
928924 }
929925
930−static void blk_add_trace_bio_frontmerge(void *ignore,
931− struct request_queue *q,
932− struct request *rq,
933− struct bio *bio)
926+static void blk_add_trace_bio_frontmerge(void *ignore, struct bio *bio)
934927 {
935− blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE, 0);
928+ blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_FRONTMERGE, 0);
936929 }
937930
938−static void blk_add_trace_bio_queue(void *ignore,
939− struct request_queue *q, struct bio *bio)
931+static void blk_add_trace_bio_queue(void *ignore, struct bio *bio)
940932 {
941− blk_add_trace_bio(q, bio, BLK_TA_QUEUE, 0);
933+ blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_QUEUE, 0);
942934 }
943935
944−static void blk_add_trace_getrq(void *ignore,
945− struct request_queue *q,
946− struct bio *bio, int rw)
936+static void blk_add_trace_getrq(void *ignore, struct bio *bio)
947937 {
948− if (bio)
949− blk_add_trace_bio(q, bio, BLK_TA_GETRQ, 0);
950− else {
951− struct blk_trace *bt;
952−
953− rcu_read_lock();
954− bt = rcu_dereference(q->blk_trace);
955− if (bt)
956− __blk_add_trace(bt, 0, 0, rw, 0, BLK_TA_GETRQ, 0, 0,
957− NULL, 0);
958− rcu_read_unlock();
959− }
938+ blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_GETRQ, 0);
960939 }
961940
962941 static void blk_add_trace_plug(void *ignore, struct request_queue *q)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t