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.
Showing the changes to kernel (1 of 6 files). Show all
Unified · Split
| @@ -906,10 +906,9 @@ static void blk_add_trace_bio(struct request_queue *q, struct bio *bio, · 905 unmodified lines | |||
| 906 | rcu_read_unlock(); | 906 | rcu_read_unlock(); |
| 907 | } | 907 | } |
| 908 | 908 | ||
| 909 | static void blk_add_trace_bio_bounce(void *ignore, | 909 | static void blk_add_trace_bio_bounce(void *ignore, struct bio *bio) |
| 910 | struct request_queue *q, struct bio *bio) | ||
| 911 | { | 910 | { |
| 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); |
| 913 | } | 912 | } |
| 914 | 913 | ||
| 915 | static void blk_add_trace_bio_complete(void *ignore, | 914 | 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 | |||
| 919 | blk_status_to_errno(bio->bi_status)); | 918 | blk_status_to_errno(bio->bi_status)); |
| 920 | } | 919 | } |
| 921 | 920 | ||
| 922 | static void blk_add_trace_bio_backmerge(void *ignore, | 921 | static void blk_add_trace_bio_backmerge(void *ignore, struct bio *bio) |
| 923 | struct request_queue *q, | ||
| 924 | struct request *rq, | ||
| 925 | struct bio *bio) | ||
| 926 | { | 922 | { |
| 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); |
| 928 | } | 924 | } |
| 929 | 925 | ||
| 930 | static void blk_add_trace_bio_frontmerge(void *ignore, | 926 | static void blk_add_trace_bio_frontmerge(void *ignore, struct bio *bio) |
| 931 | struct request_queue *q, | ||
| 932 | struct request *rq, | ||
| 933 | struct bio *bio) | ||
| 934 | { | 927 | { |
| 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); |
| 936 | } | 929 | } |
| 937 | 930 | ||
| 938 | static void blk_add_trace_bio_queue(void *ignore, | 931 | static void blk_add_trace_bio_queue(void *ignore, struct bio *bio) |
| 939 | struct request_queue *q, struct bio *bio) | ||
| 940 | { | 932 | { |
| 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); |
| 942 | } | 934 | } |
| 943 | 935 | ||
| 944 | static void blk_add_trace_getrq(void *ignore, | 936 | static void blk_add_trace_getrq(void *ignore, struct bio *bio) |
| 945 | struct request_queue *q, | ||
| 946 | struct bio *bio, int rw) | ||
| 947 | { | 937 | { |
| 948 | if (bio) | 938 | blk_add_trace_bio(bio->bi_disk->queue, bio, BLK_TA_GETRQ, 0); |
| 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 | } | ||
| 960 | } | 939 | } |
| 961 | 940 | ||
| 962 | static void blk_add_trace_plug(void *ignore, struct request_queue *q) | 941 | static void blk_add_trace_plug(void *ignore, struct request_queue *q) |