1 From 4b1945d3c055de4b49e310f799e6f92c57546349 Mon Sep 17 00:00:00 2001
2 From: Michael Jeanson <mjeanson@efficios.com>
3 Date: Sun, 23 Jan 2022 13:11:47 -0500
4 Subject: [PATCH 2/7] fix: block: remove the ->rq_disk field in struct request
9 commit f3fa33acca9f0058157214800f68b10d8e71ab7a
10 Author: Christoph Hellwig <hch@lst.de>
11 Date: Fri Nov 26 13:18:00 2021 +0100
13 block: remove the ->rq_disk field in struct request
15 Just use the disk attached to the request_queue instead.
17 Link: https://lore.kernel.org/r/20211126121802.2090656-4-hch@lst.de
19 Upstream-Status: Backport [lttng-modules commit 4b1945d3c055de4b49e310f799e6f92c57546349]
21 Change-Id: I24263be519d1b51f4b00bd95f14a9aeb8457889a
22 Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
23 Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
25 include/instrumentation/events/block.h | 95 ++++++++++++++++++++++++--
26 1 file changed, 91 insertions(+), 4 deletions(-)
28 diff --git a/include/instrumentation/events/block.h b/include/instrumentation/events/block.h
29 index 6782c36f..3e1104d7 100644
30 --- a/include/instrumentation/events/block.h
31 +++ b/include/instrumentation/events/block.h
32 @@ -310,7 +310,31 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_abort,
36 -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
37 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
39 + * block_rq_requeue - place block IO request back on a queue
40 + * @rq: block IO operation request
42 + * The block operation request @rq is being placed back into queue
43 + * @q. For some reason the request was not completed and needs to be
44 + * put back in the queue.
46 +LTTNG_TRACEPOINT_EVENT(block_rq_requeue,
48 + TP_PROTO(struct request *rq),
53 + ctf_integer(dev_t, dev,
54 + rq->q->disk ? disk_devt(rq->q->disk) : 0)
55 + ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
56 + ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
57 + blk_rwbs_ctf_integer(unsigned int, rwbs,
58 + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
61 +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
63 * block_rq_requeue - place block IO request back on a queue
64 * @rq: block IO operation request
65 @@ -380,7 +404,24 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_requeue,
66 * do for the request. If @rq->bio is non-NULL then there is
67 * additional work required to complete the request.
69 -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0))
70 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
71 +LTTNG_TRACEPOINT_EVENT(block_rq_complete,
73 + TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes),
75 + TP_ARGS(rq, error, nr_bytes),
78 + ctf_integer(dev_t, dev,
79 + rq->q->disk ? disk_devt(rq->q->disk) : 0)
80 + ctf_integer(sector_t, sector, blk_rq_pos(rq))
81 + ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
82 + ctf_integer(int, error, blk_status_to_errno(error))
83 + blk_rwbs_ctf_integer(unsigned int, rwbs,
84 + lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
87 +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0))
88 LTTNG_TRACEPOINT_EVENT(block_rq_complete,
90 TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes),
91 @@ -519,7 +560,26 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_complete,
93 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */
95 -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
96 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
97 +LTTNG_TRACEPOINT_EVENT_CLASS(block_rq,
99 + TP_PROTO(struct request *rq),
104 + ctf_integer(dev_t, dev,
105 + rq->q->disk ? disk_devt(rq->q->disk) : 0)
106 + ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
107 + ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
108 + ctf_integer(unsigned int, bytes, blk_rq_bytes(rq))
109 + ctf_integer(pid_t, tid, current->pid)
110 + blk_rwbs_ctf_integer(unsigned int, rwbs,
111 + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
112 + ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
115 +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
116 LTTNG_TRACEPOINT_EVENT_CLASS(block_rq,
118 TP_PROTO(struct request *rq),
119 @@ -1513,7 +1573,34 @@ LTTNG_TRACEPOINT_EVENT(block_bio_remap,
123 -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
124 +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0))
126 + * block_rq_remap - map request for a block operation request
127 + * @rq: block IO operation request
128 + * @dev: device for the operation
129 + * @from: original sector for the operation
131 + * The block operation request @rq in @q has been remapped. The block
132 + * operation request @rq holds the current information and @from hold
133 + * the original sector.
135 +LTTNG_TRACEPOINT_EVENT(block_rq_remap,
137 + TP_PROTO(struct request *rq, dev_t dev, sector_t from),
139 + TP_ARGS(rq, dev, from),
142 + ctf_integer(dev_t, dev, disk_devt(rq->q->disk))
143 + ctf_integer(sector_t, sector, blk_rq_pos(rq))
144 + ctf_integer(unsigned int, nr_sector, blk_rq_sectors(rq))
145 + ctf_integer(dev_t, old_dev, dev)
146 + ctf_integer(sector_t, old_sector, from)
147 + blk_rwbs_ctf_integer(unsigned int, rwbs,
148 + lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
151 +#elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
153 * block_rq_remap - map request for a block operation request
154 * @rq: block IO operation request