From: Michael Jeanson Date: Thu, 7 Jan 2021 16:56:25 +0000 (-0500) Subject: fix: block: remove the request_queue argument to the block_split tracepoint (v5.11) X-Git-Tag: v2.11.8~19 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=cdb4f855247e4879c0c28b9bcf447fda90233c62;p=lttng-modules.git fix: block: remove the request_queue argument to the block_split tracepoint (v5.11) See upstream commit: commit eb6f7f7cd3af0f67ce57b21fab1bc64beb643581 Author: Christoph Hellwig Date: Thu Dec 3 17:21:37 2020 +0100 block: remove the request_queue argument to the block_split tracepoint The request_queue can trivially be derived from the bio. Signed-off-by: Michael Jeanson Signed-off-by: Mathieu Desnoyers Change-Id: Id64217d35cbae698b3ab77401c5d3277800e2a6a --- diff --git a/instrumentation/events/lttng-module/block.h b/instrumentation/events/lttng-module/block.h index ad9a0538..65176265 100644 --- a/instrumentation/events/lttng-module/block.h +++ b/instrumentation/events/lttng-module/block.h @@ -1337,6 +1337,36 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(block_unplug, block_unplug_io, #endif ) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0)) +/** + * block_split - split a single bio struct into two bio structs + * @bio: block operation being split + * @new_sector: The starting sector for the new bio + * + * The bio request @bio needs to be split into two bio requests. The newly + * created @bio request starts at @new_sector. This split may be required due to + * hardware limitations such as operation crossing device boundaries in a RAID + * system. + */ +LTTNG_TRACEPOINT_EVENT(block_split, + + TP_PROTO(struct bio *bio, unsigned int new_sector), + + TP_ARGS(bio, new_sector), + + TP_FIELDS( + ctf_integer(dev_t, dev, bio_dev(bio)) + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_iter.bi_size) + ctf_integer(sector_t, new_sector, new_sector) + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) + +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) /** * block_split - split a single bio struct into two bio structs * @q: queue containing the bio @@ -1356,26 +1386,54 @@ LTTNG_TRACEPOINT_EVENT(block_split, TP_ARGS(q, bio, new_sector), TP_FIELDS( -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0)) ctf_integer(dev_t, dev, bio_dev(bio)) -#else + ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) + blk_rwbs_ctf_integer(unsigned int, rwbs, + lttng_bio_op(bio), lttng_bio_rw(bio), + bio->bi_iter.bi_size) + ctf_integer(sector_t, new_sector, new_sector) + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) +LTTNG_TRACEPOINT_EVENT(block_split, + + TP_PROTO(struct request_queue *q, struct bio *bio, + unsigned int new_sector), + + TP_ARGS(q, bio, new_sector), + + TP_FIELDS( ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) -#endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) ctf_integer(sector_t, sector, bio->bi_iter.bi_sector) blk_rwbs_ctf_integer(unsigned int, rwbs, lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_iter.bi_size) -#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ + ctf_integer(sector_t, new_sector, new_sector) + ctf_integer(pid_t, tid, current->pid) + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) + ) +) +#else +LTTNG_TRACEPOINT_EVENT(block_split, + + TP_PROTO(struct request_queue *q, struct bio *bio, + unsigned int new_sector), + + TP_ARGS(q, bio, new_sector), + + TP_FIELDS( + ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev) ctf_integer(sector_t, sector, bio->bi_sector) blk_rwbs_ctf_integer(unsigned int, rwbs, lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size) -#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */ ctf_integer(sector_t, new_sector, new_sector) ctf_integer(pid_t, tid, current->pid) ctf_array_text(char, comm, current->comm, TASK_COMM_LEN) ) ) +#endif /** * block_bio_remap - map request for a logical device to the raw device