Add support for RHEL 9.1
[lttng-modules.git] / instrumentation / events / lttng-module / block.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM block
4
5 #if !defined(LTTNG_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_BLOCK_H
7
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/blktrace_api.h>
10 #include <linux/blkdev.h>
11 #include <linux/trace_seq.h>
12 #include <lttng-kernel-version.h>
13
14 #if LTTNG_KERNEL_RANGE(4,11,0, 5,18,0)
15 #include <scsi/scsi_request.h>
16 #endif /* LTTNG_KERNEL_RANGE(4,11,0, 5,18,0) */
17
18 #ifndef _TRACE_BLOCK_DEF_
19 #define _TRACE_BLOCK_DEF_
20
21 enum {
22 RWBS_FLAG_WRITE = (1 << 0),
23 RWBS_FLAG_DISCARD = (1 << 1),
24 RWBS_FLAG_READ = (1 << 2),
25 RWBS_FLAG_RAHEAD = (1 << 3),
26 RWBS_FLAG_BARRIER = (1 << 4),
27 RWBS_FLAG_SYNC = (1 << 5),
28 RWBS_FLAG_META = (1 << 6),
29 RWBS_FLAG_SECURE = (1 << 7),
30 RWBS_FLAG_FLUSH = (1 << 8),
31 RWBS_FLAG_FUA = (1 << 9),
32 RWBS_FLAG_PREFLUSH = (1 << 10),
33 };
34
35 #endif /* _TRACE_BLOCK_DEF_ */
36
37 #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
38 LTTNG_TRACEPOINT_ENUM(block_rq_type,
39 TP_ENUM_VALUES(
40 ctf_enum_value("RWBS_FLAG_WRITE", RWBS_FLAG_WRITE)
41 ctf_enum_value("RWBS_FLAG_DISCARD", RWBS_FLAG_DISCARD)
42 ctf_enum_value("RWBS_FLAG_READ", RWBS_FLAG_READ)
43 ctf_enum_value("RWBS_FLAG_RAHEAD", RWBS_FLAG_RAHEAD)
44 ctf_enum_value("RWBS_FLAG_BARRIER", RWBS_FLAG_BARRIER)
45 ctf_enum_value("RWBS_FLAG_SYNC", RWBS_FLAG_SYNC)
46 ctf_enum_value("RWBS_FLAG_META", RWBS_FLAG_META)
47 ctf_enum_value("RWBS_FLAG_SECURE", RWBS_FLAG_SECURE)
48 ctf_enum_value("RWBS_FLAG_FLUSH", RWBS_FLAG_FLUSH)
49 ctf_enum_value("RWBS_FLAG_FUA", RWBS_FLAG_FUA)
50 ctf_enum_value("RWBS_FLAG_PREFLUSH", RWBS_FLAG_PREFLUSH)
51 )
52 )
53 #endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
54
55 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,8,0) || \
56 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
57 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
58 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
59 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \
60 LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \
61 LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \
62 LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0))
63
64 #define lttng_req_op(rq) req_op(rq)
65 #define lttng_req_rw(rq) ((rq)->cmd_flags)
66 #define lttng_bio_op(bio) bio_op(bio)
67 #define lttng_bio_rw(bio) ((bio)->bi_opf)
68
69 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,18,0) \
70 || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0))
71 #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
72 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
73 ctf_enum(block_rq_type, type, rwbs, \
74 ( (op) == REQ_OP_WRITE ? RWBS_FLAG_WRITE : \
75 ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \
76 ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \
77 ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \
78 ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \
79 ( 0 )))))) \
80 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
81 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
82 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
83 | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \
84 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
85 #else
86 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
87 ctf_integer(type, rwbs, \
88 ( (op) == REQ_OP_WRITE ? RWBS_FLAG_WRITE : \
89 ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \
90 ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \
91 ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \
92 ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \
93 ( 0 )))))) \
94 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
95 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
96 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
97 | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \
98 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
99 #endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
100 #else
101 #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
102 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
103 ctf_enum(block_rq_type, type, rwbs, \
104 (((op) == REQ_OP_WRITE || (op) == REQ_OP_WRITE_SAME) ? RWBS_FLAG_WRITE : \
105 ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \
106 ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \
107 ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \
108 ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \
109 ( 0 )))))) \
110 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
111 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
112 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
113 | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \
114 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
115 #else
116 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
117 ctf_integer(type, rwbs, \
118 (((op) == REQ_OP_WRITE || (op) == REQ_OP_WRITE_SAME) ? RWBS_FLAG_WRITE : \
119 ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \
120 ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \
121 ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \
122 ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \
123 ( 0 )))))) \
124 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
125 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
126 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
127 | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \
128 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
129 #endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
130 #endif
131
132 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0))
133
134 #define lttng_req_op(rq)
135 #define lttng_req_rw(rq) ((rq)->cmd_flags)
136 #define lttng_bio_op(bio)
137 #define lttng_bio_rw(bio) ((bio)->bi_rw)
138
139 #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
140 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
141 ctf_enum(block_rq_type, type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
142 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
143 ( (bytes) ? RWBS_FLAG_READ : \
144 ( 0 )))) \
145 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
146 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
147 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
148 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0) \
149 | ((rw) & REQ_FLUSH ? RWBS_FLAG_FLUSH : 0) \
150 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
151 #else
152 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
153 ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
154 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
155 ( (bytes) ? RWBS_FLAG_READ : \
156 ( 0 )))) \
157 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
158 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
159 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
160 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0) \
161 | ((rw) & REQ_FLUSH ? RWBS_FLAG_FLUSH : 0) \
162 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
163 #endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
164
165 #else
166
167 #define lttng_req_op(rq)
168 #define lttng_req_rw(rq) ((rq)->cmd_flags)
169 #define lttng_bio_op(bio)
170 #define lttng_bio_rw(bio) ((bio)->bi_rw)
171
172 #ifdef CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM
173 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
174 ctf_enum(block_rq_type, type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
175 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
176 ( (bytes) ? RWBS_FLAG_READ : \
177 ( 0 )))) \
178 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
179 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
180 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
181 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0))
182 #else
183 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
184 ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
185 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
186 ( (bytes) ? RWBS_FLAG_READ : \
187 ( 0 )))) \
188 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
189 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
190 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
191 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0))
192 #endif /* CONFIG_LTTNG_EXPERIMENTAL_BITWISE_ENUM */
193
194 #endif
195
196 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0))
197 LTTNG_TRACEPOINT_EVENT_CLASS(block_buffer,
198
199 TP_PROTO(struct buffer_head *bh),
200
201 TP_ARGS(bh),
202
203 TP_FIELDS (
204 ctf_integer(dev_t, dev, bh->b_bdev->bd_dev)
205 ctf_integer(sector_t, sector, bh->b_blocknr)
206 ctf_integer(size_t, size, bh->b_size)
207 )
208 )
209
210 /**
211 * block_touch_buffer - mark a buffer accessed
212 * @bh: buffer_head being touched
213 *
214 * Called from touch_buffer().
215 */
216 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer, block_touch_buffer,
217
218 TP_PROTO(struct buffer_head *bh),
219
220 TP_ARGS(bh)
221 )
222
223 /**
224 * block_dirty_buffer - mark a buffer dirty
225 * @bh: buffer_head being dirtied
226 *
227 * Called from mark_buffer_dirty().
228 */
229 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer, block_dirty_buffer,
230
231 TP_PROTO(struct buffer_head *bh),
232
233 TP_ARGS(bh)
234 )
235 #endif
236
237 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0))
238 /* block_rq_with_error event class removed in kernel 4.12 */
239 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0))
240 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error,
241
242 TP_PROTO(struct request_queue *q, struct request *rq),
243
244 TP_ARGS(q, rq),
245
246 TP_locvar(
247 sector_t sector;
248 unsigned int nr_sector;
249 unsigned char *cmd;
250 size_t cmd_len;
251 ),
252
253 TP_code_pre(
254 if (blk_rq_is_scsi(rq)) {
255 struct scsi_request *scsi_rq = scsi_req(rq);
256 tp_locvar->sector = 0;
257 tp_locvar->nr_sector = 0;
258 tp_locvar->cmd = scsi_rq->cmd;
259 tp_locvar->cmd_len = scsi_rq->cmd_len;
260 } else {
261 tp_locvar->sector = blk_rq_pos(rq);
262 tp_locvar->nr_sector = blk_rq_sectors(rq);
263 tp_locvar->cmd = NULL;
264 tp_locvar->cmd_len = 0;
265 }
266 ),
267
268 TP_FIELDS(
269 ctf_integer(dev_t, dev,
270 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
271 ctf_integer(sector_t, sector, tp_locvar->sector)
272 ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector)
273 ctf_integer(int, errors, rq->errors)
274 blk_rwbs_ctf_integer(unsigned int, rwbs,
275 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
276 ctf_sequence_hex(unsigned char, cmd,
277 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
278 ),
279
280 TP_code_post()
281 )
282 #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */
283 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error,
284
285 TP_PROTO(struct request_queue *q, struct request *rq),
286
287 TP_ARGS(q, rq),
288
289 TP_locvar(
290 sector_t sector;
291 unsigned int nr_sector;
292 unsigned char *cmd;
293 size_t cmd_len;
294 ),
295
296 TP_code_pre(
297
298 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
299 tp_locvar->sector = 0;
300 tp_locvar->nr_sector = 0;
301 tp_locvar->cmd = rq->cmd;
302 tp_locvar->cmd_len = rq->cmd_len;
303 } else {
304 tp_locvar->sector = blk_rq_pos(rq);
305 tp_locvar->nr_sector = blk_rq_sectors(rq);
306 tp_locvar->cmd = NULL;
307 tp_locvar->cmd_len = 0;
308 }
309 ),
310
311 TP_FIELDS(
312 ctf_integer(dev_t, dev,
313 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
314 ctf_integer(sector_t, sector, tp_locvar->sector)
315 ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector)
316 ctf_integer(int, errors, rq->errors)
317 blk_rwbs_ctf_integer(unsigned int, rwbs,
318 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
319 ctf_sequence_hex(unsigned char, cmd,
320 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
321 ),
322
323 TP_code_post()
324 )
325 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */
326
327 #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(4,12,0))
328 /**
329 * block_rq_abort - abort block operation request
330 * @q: queue containing the block operation request
331 * @rq: block IO operation request
332 *
333 * Called immediately after pending block IO operation request @rq in
334 * queue @q is aborted. The fields in the operation request @rq
335 * can be examined to determine which device and sectors the pending
336 * operation would access.
337 */
338 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_abort,
339
340 TP_PROTO(struct request_queue *q, struct request *rq),
341
342 TP_ARGS(q, rq)
343 )
344 #endif
345
346 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \
347 || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0))
348 /**
349 * block_rq_requeue - place block IO request back on a queue
350 * @rq: block IO operation request
351 *
352 * The block operation request @rq is being placed back into queue
353 * @q. For some reason the request was not completed and needs to be
354 * put back in the queue.
355 */
356 LTTNG_TRACEPOINT_EVENT(block_rq_requeue,
357
358 TP_PROTO(struct request *rq),
359
360 TP_ARGS(rq),
361
362 TP_FIELDS(
363 ctf_integer(dev_t, dev,
364 rq->q->disk ? disk_devt(rq->q->disk) : 0)
365 ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
366 ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
367 blk_rwbs_ctf_integer(unsigned int, rwbs,
368 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
369 )
370 )
371 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) \
372 || LTTNG_KERNEL_RANGE(5,10,137, 5,11,0) \
373 || LTTNG_RHEL_KERNEL_RANGE(4,18,0,372,0,0, 4,19,0,0,0,0))
374 /**
375 * block_rq_requeue - place block IO request back on a queue
376 * @rq: block IO operation request
377 *
378 * The block operation request @rq is being placed back into queue
379 * @q. For some reason the request was not completed and needs to be
380 * put back in the queue.
381 */
382 LTTNG_TRACEPOINT_EVENT(block_rq_requeue,
383
384 TP_PROTO(struct request *rq),
385
386 TP_ARGS(rq),
387
388 TP_FIELDS(
389 ctf_integer(dev_t, dev,
390 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
391 ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
392 ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
393 blk_rwbs_ctf_integer(unsigned int, rwbs,
394 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
395 )
396 )
397 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0))
398 /**
399 * block_rq_requeue - place block IO request back on a queue
400 * @q: queue holding operation
401 * @rq: block IO operation request
402 *
403 * The block operation request @rq is being placed back into queue
404 * @q. For some reason the request was not completed and needs to be
405 * put back in the queue.
406 */
407 LTTNG_TRACEPOINT_EVENT(block_rq_requeue,
408
409 TP_PROTO(struct request_queue *q, struct request *rq),
410
411 TP_ARGS(q, rq),
412
413 TP_FIELDS(
414 ctf_integer(dev_t, dev,
415 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
416 ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
417 ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
418 blk_rwbs_ctf_integer(unsigned int, rwbs,
419 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
420 )
421 )
422 #else
423 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_requeue,
424
425 TP_PROTO(struct request_queue *q, struct request *rq),
426
427 TP_ARGS(q, rq)
428 )
429 #endif
430
431 /**
432 * block_rq_complete - block IO operation completed by device driver
433 * @q: queue containing the block operation request
434 * @rq: block operations request
435 * @nr_bytes: number of completed bytes
436 *
437 * The block_rq_complete tracepoint event indicates that some portion
438 * of operation request has been completed by the device driver. If
439 * the @rq->bio is %NULL, then there is absolutely no additional work to
440 * do for the request. If @rq->bio is non-NULL then there is
441 * additional work required to complete the request.
442 */
443 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \
444 || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0))
445 LTTNG_TRACEPOINT_EVENT(block_rq_complete,
446
447 TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes),
448
449 TP_ARGS(rq, error, nr_bytes),
450
451 TP_FIELDS(
452 ctf_integer(dev_t, dev,
453 rq->q->disk ? disk_devt(rq->q->disk) : 0)
454 ctf_integer(sector_t, sector, blk_rq_pos(rq))
455 ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
456 ctf_integer(int, error, blk_status_to_errno(error))
457 blk_rwbs_ctf_integer(unsigned int, rwbs,
458 lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
459 )
460 )
461 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,16,0) \
462 || LTTNG_RHEL_KERNEL_RANGE(5,14,0,70,0,0, 5,15,0,0,0,0))
463 LTTNG_TRACEPOINT_EVENT(block_rq_complete,
464
465 TP_PROTO(struct request *rq, blk_status_t error, unsigned int nr_bytes),
466
467 TP_ARGS(rq, error, nr_bytes),
468
469 TP_FIELDS(
470 ctf_integer(dev_t, dev,
471 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
472 ctf_integer(sector_t, sector, blk_rq_pos(rq))
473 ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
474 ctf_integer(int, error, blk_status_to_errno(error))
475 blk_rwbs_ctf_integer(unsigned int, rwbs,
476 lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
477 )
478 )
479 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0))
480 LTTNG_TRACEPOINT_EVENT(block_rq_complete,
481
482 TP_PROTO(struct request *rq, int error, unsigned int nr_bytes),
483
484 TP_ARGS(rq, error, nr_bytes),
485
486 TP_FIELDS(
487 ctf_integer(dev_t, dev,
488 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
489 ctf_integer(sector_t, sector, blk_rq_pos(rq))
490 ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
491 ctf_integer(int, error, error)
492 blk_rwbs_ctf_integer(unsigned int, rwbs,
493 lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
494 )
495 )
496 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0))
497 LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete,
498
499 TP_PROTO(struct request_queue *q, struct request *rq,
500 unsigned int nr_bytes),
501
502 TP_ARGS(q, rq, nr_bytes),
503
504 TP_locvar(
505 unsigned char *cmd;
506 size_t cmd_len;
507 ),
508
509 TP_code_pre(
510 if (blk_rq_is_scsi(rq)) {
511 struct scsi_request *scsi_rq = scsi_req(rq);
512 tp_locvar->cmd = scsi_rq->cmd;
513 tp_locvar->cmd_len = scsi_rq->cmd_len;
514 } else {
515 tp_locvar->cmd = NULL;
516 tp_locvar->cmd_len = 0;
517 }
518 ),
519
520 TP_FIELDS(
521 ctf_integer(dev_t, dev,
522 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
523 ctf_integer(sector_t, sector, blk_rq_pos(rq))
524 ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
525 ctf_integer(int, errors, rq->errors)
526 blk_rwbs_ctf_integer(unsigned int, rwbs,
527 lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
528 ctf_sequence_hex(unsigned char, cmd,
529 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
530 ),
531
532 TP_code_post()
533 )
534 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,5) \
535 || LTTNG_KERNEL_RANGE(3,12,21, 3,13,0) \
536 || LTTNG_KERNEL_RANGE(3,10,41, 3,11,0) \
537 || LTTNG_KERNEL_RANGE(3,4,91, 3,5,0) \
538 || LTTNG_KERNEL_RANGE(3,2,58, 3,3,0) \
539 || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,28, 3,14,0,0) \
540 || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0))
541
542 LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete,
543
544 TP_PROTO(struct request_queue *q, struct request *rq,
545 unsigned int nr_bytes),
546
547 TP_ARGS(q, rq, nr_bytes),
548
549 TP_locvar(
550 unsigned char *cmd;
551 size_t cmd_len;
552 ),
553
554 TP_code_pre(
555 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
556 tp_locvar->cmd = rq->cmd;
557 tp_locvar->cmd_len = rq->cmd_len;
558 } else {
559 tp_locvar->cmd = NULL;
560 tp_locvar->cmd_len = 0;
561 }
562 ),
563
564 TP_FIELDS(
565 ctf_integer(dev_t, dev,
566 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
567 ctf_integer(sector_t, sector, blk_rq_pos(rq))
568 ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
569 ctf_integer(int, errors, rq->errors)
570 blk_rwbs_ctf_integer(unsigned int, rwbs,
571 lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
572 ctf_sequence_hex(unsigned char, cmd,
573 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
574 ),
575
576 TP_code_post()
577 )
578
579 #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */
580
581 /**
582 * block_rq_complete - block IO operation completed by device driver
583 * @q: queue containing the block operation request
584 * @rq: block operations request
585 *
586 * The block_rq_complete tracepoint event indicates that some portion
587 * of operation request has been completed by the device driver. If
588 * the @rq->bio is %NULL, then there is absolutely no additional work to
589 * do for the request. If @rq->bio is non-NULL then there is
590 * additional work required to complete the request.
591 */
592 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_complete,
593
594 TP_PROTO(struct request_queue *q, struct request *rq),
595
596 TP_ARGS(q, rq)
597 )
598
599 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,15,0)) */
600
601 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \
602 || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0))
603 LTTNG_TRACEPOINT_EVENT_CLASS(block_rq,
604
605 TP_PROTO(struct request *rq),
606
607 TP_ARGS(rq),
608
609 TP_FIELDS(
610 ctf_integer(dev_t, dev,
611 rq->q->disk ? disk_devt(rq->q->disk) : 0)
612 ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
613 ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
614 ctf_integer(unsigned int, bytes, blk_rq_bytes(rq))
615 ctf_integer(pid_t, tid, current->pid)
616 blk_rwbs_ctf_integer(unsigned int, rwbs,
617 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
618 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
619 )
620 )
621 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) \
622 || LTTNG_KERNEL_RANGE(5,10,137, 5,11,0) \
623 || LTTNG_RHEL_KERNEL_RANGE(4,18,0,372,0,0, 4,19,0,0,0,0))
624 LTTNG_TRACEPOINT_EVENT_CLASS(block_rq,
625
626 TP_PROTO(struct request *rq),
627
628 TP_ARGS(rq),
629
630 TP_FIELDS(
631 ctf_integer(dev_t, dev,
632 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
633 ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
634 ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
635 ctf_integer(unsigned int, bytes, blk_rq_bytes(rq))
636 ctf_integer(pid_t, tid, current->pid)
637 blk_rwbs_ctf_integer(unsigned int, rwbs,
638 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
639 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
640 )
641 )
642 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,12,0))
643 LTTNG_TRACEPOINT_EVENT_CLASS(block_rq,
644
645 TP_PROTO(struct request_queue *q, struct request *rq),
646
647 TP_ARGS(q, rq),
648
649 TP_FIELDS(
650 ctf_integer(dev_t, dev,
651 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
652 ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
653 ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
654 ctf_integer(unsigned int, bytes, blk_rq_bytes(rq))
655 ctf_integer(pid_t, tid, current->pid)
656 blk_rwbs_ctf_integer(unsigned int, rwbs,
657 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
658 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
659 )
660 )
661 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0))
662 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq,
663
664 TP_PROTO(struct request_queue *q, struct request *rq),
665
666 TP_ARGS(q, rq),
667
668 TP_locvar(
669 sector_t sector;
670 unsigned int nr_sector;
671 unsigned int bytes;
672 unsigned char *cmd;
673 size_t cmd_len;
674 ),
675
676 TP_code_pre(
677 if (blk_rq_is_scsi(rq)) {
678 struct scsi_request *scsi_rq = scsi_req(rq);
679 tp_locvar->sector = 0;
680 tp_locvar->nr_sector = 0;
681 tp_locvar->bytes = scsi_rq->resid_len;
682 tp_locvar->cmd = scsi_rq->cmd;
683 tp_locvar->cmd_len = scsi_rq->cmd_len;
684 } else {
685 tp_locvar->sector = blk_rq_pos(rq);
686 tp_locvar->nr_sector = blk_rq_sectors(rq);
687 tp_locvar->bytes = 0;
688 tp_locvar->cmd = NULL;
689 tp_locvar->cmd_len = 0;
690 }
691 ),
692
693 TP_FIELDS(
694 ctf_integer(dev_t, dev,
695 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
696 ctf_integer(sector_t, sector, tp_locvar->sector)
697 ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector)
698 ctf_integer(unsigned int, bytes, tp_locvar->bytes)
699 ctf_integer(pid_t, tid, current->pid)
700 blk_rwbs_ctf_integer(unsigned int, rwbs,
701 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
702 ctf_sequence_hex(unsigned char, cmd,
703 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
704 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
705 ),
706
707 TP_code_post()
708 )
709 #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */
710 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq,
711
712 TP_PROTO(struct request_queue *q, struct request *rq),
713
714 TP_ARGS(q, rq),
715
716 TP_locvar(
717 sector_t sector;
718 unsigned int nr_sector;
719 unsigned int bytes;
720 unsigned char *cmd;
721 size_t cmd_len;
722 ),
723
724 TP_code_pre(
725 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
726 tp_locvar->sector = 0;
727 tp_locvar->nr_sector = 0;
728 tp_locvar->bytes = blk_rq_bytes(rq);
729 tp_locvar->cmd = rq->cmd;
730 tp_locvar->cmd_len = rq->cmd_len;
731 } else {
732 tp_locvar->sector = blk_rq_pos(rq);
733 tp_locvar->nr_sector = blk_rq_sectors(rq);
734 tp_locvar->bytes = 0;
735 tp_locvar->cmd = NULL;
736 tp_locvar->cmd_len = 0;
737 }
738 ),
739
740 TP_FIELDS(
741 ctf_integer(dev_t, dev,
742 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
743 ctf_integer(sector_t, sector, tp_locvar->sector)
744 ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector)
745 ctf_integer(unsigned int, bytes, tp_locvar->bytes)
746 ctf_integer(pid_t, tid, current->pid)
747 blk_rwbs_ctf_integer(unsigned int, rwbs,
748 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
749 ctf_sequence_hex(unsigned char, cmd,
750 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
751 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
752 ),
753
754 TP_code_post()
755 )
756 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,11,0)) */
757
758 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) \
759 || LTTNG_KERNEL_RANGE(5,10,137, 5,11,0) \
760 || LTTNG_RHEL_KERNEL_RANGE(4,18,0,372,0,0, 4,19,0,0,0,0))
761 /**
762 * block_rq_insert - insert block operation request into queue
763 * @rq: block IO operation request
764 *
765 * Called immediately before block operation request @rq is inserted
766 * into queue @q. The fields in the operation request @rq struct can
767 * be examined to determine which device and sectors the pending
768 * operation would access.
769 */
770 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_insert,
771
772 TP_PROTO(struct request *rq),
773
774 TP_ARGS(rq)
775 )
776 #else
777 /**
778 * block_rq_insert - insert block operation request into queue
779 * @q: target queue
780 * @rq: block IO operation request
781 *
782 * Called immediately before block operation request @rq is inserted
783 * into queue @q. The fields in the operation request @rq struct can
784 * be examined to determine which device and sectors the pending
785 * operation would access.
786 */
787 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_insert,
788
789 TP_PROTO(struct request_queue *q, struct request *rq),
790
791 TP_ARGS(q, rq)
792 )
793 #endif
794
795 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) \
796 || LTTNG_KERNEL_RANGE(5,10,137, 5,11,0) \
797 || LTTNG_RHEL_KERNEL_RANGE(4,18,0,372,0,0, 4,19,0,0,0,0))
798 /**
799 * block_rq_issue - issue pending block IO request operation to device driver
800 * @rq: block IO operation operation request
801 *
802 * Called when block operation request @rq from queue @q is sent to a
803 * device driver for processing.
804 */
805 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_issue,
806
807 TP_PROTO(struct request *rq),
808
809 TP_ARGS(rq)
810 )
811 #else
812 /**
813 * block_rq_issue - issue pending block IO request operation to device driver
814 * @q: queue holding operation
815 * @rq: block IO operation operation request
816 *
817 * Called when block operation request @rq from queue @q is sent to a
818 * device driver for processing.
819 */
820 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_issue,
821
822 TP_PROTO(struct request_queue *q, struct request *rq),
823
824 TP_ARGS(q, rq)
825 )
826 #endif
827
828 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) \
829 || LTTNG_KERNEL_RANGE(5,10,137, 5,11,0))
830 /**
831 * block_rq_merge - merge request with another one in the elevator
832 * @rq: block IO operation operation request
833 *
834 * Called when block operation request @rq from queue @q is merged to another
835 * request queued in the elevator.
836 */
837 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_merge,
838
839 TP_PROTO(struct request *rq),
840
841 TP_ARGS(rq)
842 )
843 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,9,0))
844 /**
845 * block_rq_merge - merge request with another one in the elevator
846 * @q: queue holding operation
847 * @rq: block IO operation operation request
848 *
849 * Called when block operation request @rq from queue @q is merged to another
850 * request queued in the elevator.
851 */
852 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_merge,
853
854 TP_PROTO(struct request_queue *q, struct request *rq),
855
856 TP_ARGS(q, rq)
857 )
858 #endif
859
860 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,8,0) || \
861 LTTNG_RHEL_KERNEL_RANGE(4,18,0,305,0,0, 4,19,0,0,0,0))
862
863 /**
864 * block_bio_complete - completed all work on the block operation
865 * @q: queue holding the block operation
866 * @bio: block operation completed
867 * @error: io error value
868 *
869 * This tracepoint indicates there is no further work to do on this
870 * block IO operation @bio.
871 */
872 LTTNG_TRACEPOINT_EVENT(block_bio_complete,
873
874 TP_PROTO(struct request_queue *q, struct bio *bio),
875
876 TP_ARGS(q, bio),
877
878 TP_FIELDS(
879 ctf_integer(dev_t, dev, bio_dev(bio))
880 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
881 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
882 ctf_integer(int, error, blk_status_to_errno(bio->bi_status))
883 blk_rwbs_ctf_integer(unsigned int, rwbs,
884 lttng_bio_op(bio), lttng_bio_rw(bio),
885 bio->bi_iter.bi_size)
886 )
887 )
888 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0))
889 /**
890 * block_bio_complete - completed all work on the block operation
891 * @q: queue holding the block operation
892 * @bio: block operation completed
893 * @error: io error value
894 *
895 * This tracepoint indicates there is no further work to do on this
896 * block IO operation @bio.
897 */
898 LTTNG_TRACEPOINT_EVENT(block_bio_complete,
899
900 TP_PROTO(struct request_queue *q, struct bio *bio, int error),
901
902 TP_ARGS(q, bio, error),
903
904 TP_FIELDS(
905 ctf_integer(dev_t, dev, bio_dev(bio))
906 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
907 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
908 ctf_integer(int, error, error)
909 blk_rwbs_ctf_integer(unsigned int, rwbs,
910 lttng_bio_op(bio), lttng_bio_rw(bio),
911 bio->bi_iter.bi_size)
912 )
913 )
914 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0))
915 /**
916 * block_bio_complete - completed all work on the block operation
917 * @q: queue holding the block operation
918 * @bio: block operation completed
919 * @error: io error value
920 *
921 * This tracepoint indicates there is no further work to do on this
922 * block IO operation @bio.
923 */
924 LTTNG_TRACEPOINT_EVENT(block_bio_complete,
925
926 TP_PROTO(struct request_queue *q, struct bio *bio, int error),
927
928 TP_ARGS(q, bio, error),
929
930 TP_FIELDS(
931 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
932 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
933 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
934 ctf_integer(int, error, error)
935 blk_rwbs_ctf_integer(unsigned int, rwbs,
936 lttng_bio_op(bio), lttng_bio_rw(bio),
937 bio->bi_iter.bi_size)
938 )
939 )
940 #else
941 /**
942 * block_bio_complete - completed all work on the block operation
943 * @q: queue holding the block operation
944 * @bio: block operation completed
945 * @error: io error value
946 *
947 * This tracepoint indicates there is no further work to do on this
948 * block IO operation @bio.
949 */
950 LTTNG_TRACEPOINT_EVENT(block_bio_complete,
951
952 TP_PROTO(struct request_queue *q, struct bio *bio, int error),
953
954 TP_ARGS(q, bio, error),
955
956 TP_FIELDS(
957 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
958 ctf_integer(sector_t, sector, bio->bi_sector)
959 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
960 ctf_integer(int, error, error)
961 blk_rwbs_ctf_integer(unsigned int, rwbs,
962 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
963 )
964 )
965 #endif
966
967 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
968 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio,
969
970 TP_PROTO(struct bio *bio),
971
972 TP_ARGS(bio),
973
974 TP_FIELDS(
975 ctf_integer(dev_t, dev, bio_dev(bio))
976 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
977 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
978 blk_rwbs_ctf_integer(unsigned int, rwbs,
979 lttng_bio_op(bio), lttng_bio_rw(bio),
980 bio->bi_iter.bi_size)
981 ctf_integer(pid_t, tid, current->pid)
982 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
983 )
984 )
985 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0))
986 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge,
987
988 TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
989
990 TP_ARGS(q, rq, bio),
991
992 TP_FIELDS(
993 ctf_integer(dev_t, dev, bio_dev(bio))
994 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
995 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
996 blk_rwbs_ctf_integer(unsigned int, rwbs,
997 lttng_bio_op(bio), lttng_bio_rw(bio),
998 bio->bi_iter.bi_size)
999 ctf_integer(pid_t, tid, current->pid)
1000 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1001 )
1002 )
1003 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0))
1004 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge,
1005
1006 TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
1007
1008 TP_ARGS(q, rq, bio),
1009
1010 TP_FIELDS(
1011 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1012 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1013 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
1014 blk_rwbs_ctf_integer(unsigned int, rwbs,
1015 lttng_bio_op(bio), lttng_bio_rw(bio),
1016 bio->bi_iter.bi_size)
1017 ctf_integer(pid_t, tid, current->pid)
1018 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1019 )
1020 )
1021 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0))
1022 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge,
1023
1024 TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
1025
1026 TP_ARGS(q, rq, bio),
1027
1028 TP_FIELDS(
1029 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1030 ctf_integer(sector_t, sector, bio->bi_sector)
1031 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
1032 blk_rwbs_ctf_integer(unsigned int, rwbs,
1033 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
1034 ctf_integer(pid_t, tid, current->pid)
1035 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1036 )
1037 )
1038 #endif
1039
1040
1041
1042 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
1043 /**
1044 * block_bio_bounce - used bounce buffer when processing block operation
1045 * @bio: block operation
1046 *
1047 * A bounce buffer was used to handle the block operation @bio in @q.
1048 * This occurs when hardware limitations prevent a direct transfer of
1049 * data between the @bio data memory area and the IO device. Use of a
1050 * bounce buffer requires extra copying of data and decreases
1051 * performance.
1052 */
1053 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_bounce,
1054
1055 TP_PROTO(struct bio *bio),
1056
1057 TP_ARGS(bio)
1058 )
1059 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0))
1060 /**
1061 * block_bio_bounce - used bounce buffer when processing block operation
1062 * @q: queue holding the block operation
1063 * @bio: block operation
1064 *
1065 * A bounce buffer was used to handle the block operation @bio in @q.
1066 * This occurs when hardware limitations prevent a direct transfer of
1067 * data between the @bio data memory area and the IO device. Use of a
1068 * bounce buffer requires extra copying of data and decreases
1069 * performance.
1070 */
1071 LTTNG_TRACEPOINT_EVENT(block_bio_bounce,
1072
1073 TP_PROTO(struct request_queue *q, struct bio *bio),
1074
1075 TP_ARGS(q, bio),
1076
1077 TP_FIELDS(
1078 ctf_integer(dev_t, dev, bio_dev(bio))
1079 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1080 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
1081 blk_rwbs_ctf_integer(unsigned int, rwbs,
1082 lttng_bio_op(bio), lttng_bio_rw(bio),
1083 bio->bi_iter.bi_size)
1084 ctf_integer(pid_t, tid, current->pid)
1085 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1086 )
1087 )
1088 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0))
1089 LTTNG_TRACEPOINT_EVENT(block_bio_bounce,
1090
1091 TP_PROTO(struct request_queue *q, struct bio *bio),
1092
1093 TP_ARGS(q, bio),
1094
1095 TP_FIELDS(
1096 ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
1097 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1098 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
1099 blk_rwbs_ctf_integer(unsigned int, rwbs,
1100 lttng_bio_op(bio), lttng_bio_rw(bio),
1101 bio->bi_iter.bi_size)
1102 ctf_integer(pid_t, tid, current->pid)
1103 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1104 )
1105 )
1106 #else
1107 LTTNG_TRACEPOINT_EVENT(block_bio_bounce,
1108
1109 TP_PROTO(struct request_queue *q, struct bio *bio),
1110
1111 TP_ARGS(q, bio),
1112
1113 TP_FIELDS(
1114 ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
1115 ctf_integer(sector_t, sector, bio->bi_sector)
1116 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
1117 blk_rwbs_ctf_integer(unsigned int, rwbs,
1118 lttng_bio_op(bio), lttng_bio_rw(bio),
1119 bio->bi_size)
1120 ctf_integer(pid_t, tid, current->pid)
1121 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1122 )
1123 )
1124 #endif
1125
1126
1127 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
1128 /**
1129 * block_bio_backmerge - merging block operation to the end of an existing operation
1130 * @bio: new block operation to merge
1131 *
1132 * Merging block request @bio to the end of an existing block request.
1133 */
1134 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_backmerge,
1135
1136 TP_PROTO(struct bio *bio),
1137
1138 TP_ARGS(bio)
1139 )
1140
1141 /**
1142 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
1143 * @bio: new block operation to merge
1144 *
1145 * Merging block IO operation @bio to the beginning of an existing block request.
1146 */
1147 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_frontmerge,
1148
1149 TP_PROTO(struct bio *bio),
1150
1151 TP_ARGS(bio)
1152 )
1153
1154 /**
1155 * block_bio_queue - putting new block IO operation in queue
1156 * @bio: new block operation
1157 *
1158 * About to place the block IO operation @bio into queue @q.
1159 */
1160 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_queue,
1161
1162 TP_PROTO(struct bio *bio),
1163
1164 TP_ARGS(bio)
1165 )
1166 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0))
1167 /**
1168 * block_bio_backmerge - merging block operation to the end of an existing operation
1169 * @q: queue holding operation
1170 * @rq: request bio is being merged into
1171 * @bio: new block operation to merge
1172 *
1173 * Merging block request @bio to the end of an existing block request
1174 * in queue @q.
1175 */
1176 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_backmerge,
1177
1178 TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
1179
1180 TP_ARGS(q, rq, bio)
1181 )
1182
1183 /**
1184 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
1185 * @q: queue holding operation
1186 * @rq: request bio is being merged into
1187 * @bio: new block operation to merge
1188 *
1189 * Merging block IO operation @bio to the beginning of an existing block
1190 * operation in queue @q.
1191 */
1192 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_frontmerge,
1193
1194 TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
1195
1196 TP_ARGS(q, rq, bio)
1197 )
1198
1199 /**
1200 * block_bio_queue - putting new block IO operation in queue
1201 * @q: queue holding operation
1202 * @bio: new block operation
1203 *
1204 * About to place the block IO operation @bio into queue @q.
1205 */
1206 LTTNG_TRACEPOINT_EVENT(block_bio_queue,
1207
1208 TP_PROTO(struct request_queue *q, struct bio *bio),
1209
1210 TP_ARGS(q, bio),
1211
1212 TP_FIELDS(
1213 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0))
1214 ctf_integer(dev_t, dev, bio_dev(bio))
1215 #else
1216 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1217 #endif
1218 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0))
1219 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1220 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
1221 blk_rwbs_ctf_integer(unsigned int, rwbs,
1222 lttng_bio_op(bio), lttng_bio_rw(bio),
1223 bio->bi_iter.bi_size)
1224 #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) */
1225 ctf_integer(sector_t, sector, bio->bi_sector)
1226 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
1227 blk_rwbs_ctf_integer(unsigned int, rwbs,
1228 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
1229 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) */
1230 ctf_integer(pid_t, tid, current->pid)
1231 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1232 )
1233 )
1234 #else /* if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) */
1235 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio,
1236
1237 TP_PROTO(struct request_queue *q, struct bio *bio),
1238
1239 TP_ARGS(q, bio),
1240
1241 TP_FIELDS(
1242 ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
1243 ctf_integer(sector_t, sector, bio->bi_sector)
1244 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
1245 blk_rwbs_ctf_integer(unsigned int, rwbs,
1246 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
1247 ctf_integer(pid_t, tid, current->pid)
1248 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1249 )
1250 )
1251
1252 /**
1253 * block_bio_backmerge - merging block operation to the end of an existing operation
1254 * @q: queue holding operation
1255 * @bio: new block operation to merge
1256 *
1257 * Merging block request @bio to the end of an existing block request
1258 * in queue @q.
1259 */
1260 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_backmerge,
1261
1262 TP_PROTO(struct request_queue *q, struct bio *bio),
1263
1264 TP_ARGS(q, bio)
1265 )
1266
1267 /**
1268 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
1269 * @q: queue holding operation
1270 * @bio: new block operation to merge
1271 *
1272 * Merging block IO operation @bio to the beginning of an existing block
1273 * operation in queue @q.
1274 */
1275 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_frontmerge,
1276
1277 TP_PROTO(struct request_queue *q, struct bio *bio),
1278
1279 TP_ARGS(q, bio)
1280 )
1281
1282 /**
1283 * block_bio_queue - putting new block IO operation in queue
1284 * @q: queue holding operation
1285 * @bio: new block operation
1286 *
1287 * About to place the block IO operation @bio into queue @q.
1288 */
1289 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_queue,
1290
1291 TP_PROTO(struct request_queue *q, struct bio *bio),
1292
1293 TP_ARGS(q, bio)
1294 )
1295 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,9,0)) */
1296
1297 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
1298 /**
1299 * block_getrq - get a free request entry in queue for block IO operations
1300 * @bio: pending block IO operation (can be %NULL)
1301 *
1302 * A request struct has been allocated to handle the block IO operation @bio.
1303 */
1304 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_getrq,
1305
1306 TP_PROTO(struct bio *bio),
1307
1308 TP_ARGS(bio)
1309 )
1310 #else
1311 LTTNG_TRACEPOINT_EVENT_CLASS(block_get_rq,
1312
1313 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
1314
1315 TP_ARGS(q, bio, rw),
1316
1317 TP_FIELDS(
1318 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0))
1319 ctf_integer(dev_t, dev, bio ? bio_dev(bio) : 0)
1320 #else
1321 ctf_integer(dev_t, dev, bio ? bio->bi_bdev->bd_dev : 0)
1322 #endif
1323 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0))
1324 ctf_integer(sector_t, sector, bio ? bio->bi_iter.bi_sector : 0)
1325 ctf_integer(unsigned int, nr_sector,
1326 bio ? bio_sectors(bio) : 0)
1327 blk_rwbs_ctf_integer(unsigned int, rwbs,
1328 bio ? lttng_bio_op(bio) : 0,
1329 bio ? lttng_bio_rw(bio) : 0,
1330 bio ? bio->bi_iter.bi_size : 0)
1331 #else /* #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) */
1332 ctf_integer(sector_t, sector, bio ? bio->bi_sector : 0)
1333 ctf_integer(unsigned int, nr_sector,
1334 bio ? bio->bi_size >> 9 : 0)
1335 blk_rwbs_ctf_integer(unsigned int, rwbs,
1336 bio ? lttng_bio_op(bio) : 0,
1337 bio ? lttng_bio_rw(bio) : 0,
1338 bio ? bio->bi_size : 0)
1339 #endif /* #else #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0)) */
1340 ctf_integer(pid_t, tid, current->pid)
1341 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1342 )
1343 )
1344
1345 /**
1346 * block_getrq - get a free request entry in queue for block IO operations
1347 * @q: queue for operations
1348 * @bio: pending block IO operation (can be %NULL)
1349 * @rw: low bit indicates a read (%0) or a write (%1)
1350 *
1351 * A request struct for queue @q has been allocated to handle the
1352 * block IO operation @bio.
1353 */
1354 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq, block_getrq,
1355
1356 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
1357
1358 TP_ARGS(q, bio, rw)
1359 )
1360
1361 /**
1362 * block_sleeprq - waiting to get a free request entry in queue for block IO operation
1363 * @q: queue for operation
1364 * @bio: pending block IO operation (can be %NULL)
1365 * @rw: low bit indicates a read (%0) or a write (%1)
1366 *
1367 * In the case where a request struct cannot be provided for queue @q
1368 * the process needs to wait for an request struct to become
1369 * available. This tracepoint event is generated each time the
1370 * process goes to sleep waiting for request struct become available.
1371 */
1372 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq, block_sleeprq,
1373
1374 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
1375
1376 TP_ARGS(q, bio, rw)
1377 )
1378 #endif
1379
1380 /**
1381 * block_plug - keep operations requests in request queue
1382 * @q: request queue to plug
1383 *
1384 * Plug the request queue @q. Do not allow block operation requests
1385 * to be sent to the device driver. Instead, accumulate requests in
1386 * the queue to improve throughput performance of the block device.
1387 */
1388 LTTNG_TRACEPOINT_EVENT(block_plug,
1389
1390 TP_PROTO(struct request_queue *q),
1391
1392 TP_ARGS(q),
1393
1394 TP_FIELDS(
1395 ctf_integer(pid_t, tid, current->pid)
1396 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1397 )
1398 )
1399
1400 LTTNG_TRACEPOINT_EVENT_CLASS(block_unplug,
1401
1402 TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
1403
1404 TP_ARGS(q, depth, explicit),
1405
1406 TP_FIELDS(
1407 ctf_integer(int, nr_rq, depth)
1408 ctf_integer(pid_t, tid, current->pid)
1409 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1410 )
1411 )
1412
1413 /**
1414 * block_unplug - release of operations requests in request queue
1415 * @q: request queue to unplug
1416 * @depth: number of requests just added to the queue
1417 * @explicit: whether this was an explicit unplug, or one from schedule()
1418 *
1419 * Unplug request queue @q because device driver is scheduled to work
1420 * on elements in the request queue.
1421 */
1422 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_unplug, block_unplug,
1423
1424 TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
1425
1426 TP_ARGS(q, depth, explicit)
1427 )
1428
1429 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
1430 /**
1431 * block_split - split a single bio struct into two bio structs
1432 * @bio: block operation being split
1433 * @new_sector: The starting sector for the new bio
1434 *
1435 * The bio request @bio needs to be split into two bio requests. The newly
1436 * created @bio request starts at @new_sector. This split may be required due to
1437 * hardware limitations such as operation crossing device boundaries in a RAID
1438 * system.
1439 */
1440 LTTNG_TRACEPOINT_EVENT(block_split,
1441
1442 TP_PROTO(struct bio *bio, unsigned int new_sector),
1443
1444 TP_ARGS(bio, new_sector),
1445
1446 TP_FIELDS(
1447 ctf_integer(dev_t, dev, bio_dev(bio))
1448 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1449 blk_rwbs_ctf_integer(unsigned int, rwbs,
1450 lttng_bio_op(bio), lttng_bio_rw(bio),
1451 bio->bi_iter.bi_size)
1452 ctf_integer(sector_t, new_sector, new_sector)
1453 ctf_integer(pid_t, tid, current->pid)
1454 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1455 )
1456 )
1457
1458 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0))
1459 /**
1460 * block_split - split a single bio struct into two bio structs
1461 * @q: queue containing the bio
1462 * @bio: block operation being split
1463 * @new_sector: The starting sector for the new bio
1464 *
1465 * The bio request @bio in request queue @q needs to be split into two
1466 * bio requests. The newly created @bio request starts at
1467 * @new_sector. This split may be required due to hardware limitation
1468 * such as operation crossing device boundaries in a RAID system.
1469 */
1470 LTTNG_TRACEPOINT_EVENT(block_split,
1471
1472 TP_PROTO(struct request_queue *q, struct bio *bio,
1473 unsigned int new_sector),
1474
1475 TP_ARGS(q, bio, new_sector),
1476
1477 TP_FIELDS(
1478 ctf_integer(dev_t, dev, bio_dev(bio))
1479 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1480 blk_rwbs_ctf_integer(unsigned int, rwbs,
1481 lttng_bio_op(bio), lttng_bio_rw(bio),
1482 bio->bi_iter.bi_size)
1483 ctf_integer(sector_t, new_sector, new_sector)
1484 ctf_integer(pid_t, tid, current->pid)
1485 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1486 )
1487 )
1488 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0))
1489 LTTNG_TRACEPOINT_EVENT(block_split,
1490
1491 TP_PROTO(struct request_queue *q, struct bio *bio,
1492 unsigned int new_sector),
1493
1494 TP_ARGS(q, bio, new_sector),
1495
1496 TP_FIELDS(
1497 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1498 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1499 blk_rwbs_ctf_integer(unsigned int, rwbs,
1500 lttng_bio_op(bio), lttng_bio_rw(bio),
1501 bio->bi_iter.bi_size)
1502 ctf_integer(sector_t, new_sector, new_sector)
1503 ctf_integer(pid_t, tid, current->pid)
1504 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1505 )
1506 )
1507 #else
1508 LTTNG_TRACEPOINT_EVENT(block_split,
1509
1510 TP_PROTO(struct request_queue *q, struct bio *bio,
1511 unsigned int new_sector),
1512
1513 TP_ARGS(q, bio, new_sector),
1514
1515 TP_FIELDS(
1516 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1517 ctf_integer(sector_t, sector, bio->bi_sector)
1518 blk_rwbs_ctf_integer(unsigned int, rwbs,
1519 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
1520 ctf_integer(sector_t, new_sector, new_sector)
1521 ctf_integer(pid_t, tid, current->pid)
1522 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1523 )
1524 )
1525 #endif
1526
1527 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0))
1528 /**
1529 * block_bio_remap - map request for a logical device to the raw device
1530 * @bio: revised operation
1531 * @dev: original device for the operation
1532 * @from: original sector for the operation
1533 *
1534 * An operation for a logical device has been mapped to the
1535 * raw block device.
1536 */
1537 LTTNG_TRACEPOINT_EVENT(block_bio_remap,
1538
1539 TP_PROTO(struct bio *bio, dev_t dev, sector_t from),
1540
1541 TP_ARGS(bio, dev, from),
1542
1543 TP_FIELDS(
1544 ctf_integer(dev_t, dev, bio_dev(bio))
1545 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1546 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
1547 blk_rwbs_ctf_integer(unsigned int, rwbs,
1548 lttng_bio_op(bio), lttng_bio_rw(bio),
1549 bio->bi_iter.bi_size)
1550 ctf_integer(dev_t, old_dev, dev)
1551 ctf_integer(sector_t, old_sector, from)
1552 )
1553 )
1554 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,14,0))
1555 /**
1556 * block_bio_remap - map request for a logical device to the raw device
1557 * @q: queue holding the operation
1558 * @bio: revised operation
1559 * @dev: device for the operation
1560 * @from: original sector for the operation
1561 *
1562 * An operation for a logical device has been mapped to the
1563 * raw block device.
1564 */
1565 LTTNG_TRACEPOINT_EVENT(block_bio_remap,
1566
1567 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
1568 sector_t from),
1569
1570 TP_ARGS(q, bio, dev, from),
1571
1572 TP_FIELDS(
1573 ctf_integer(dev_t, dev, bio_dev(bio))
1574 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1575 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
1576 blk_rwbs_ctf_integer(unsigned int, rwbs,
1577 lttng_bio_op(bio), lttng_bio_rw(bio),
1578 bio->bi_iter.bi_size)
1579 ctf_integer(dev_t, old_dev, dev)
1580 ctf_integer(sector_t, old_sector, from)
1581 )
1582 )
1583 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,14,0))
1584 LTTNG_TRACEPOINT_EVENT(block_bio_remap,
1585
1586 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
1587 sector_t from),
1588
1589 TP_ARGS(q, bio, dev, from),
1590
1591 TP_FIELDS(
1592 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1593 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1594 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
1595 blk_rwbs_ctf_integer(unsigned int, rwbs,
1596 lttng_bio_op(bio), lttng_bio_rw(bio),
1597 bio->bi_iter.bi_size)
1598 ctf_integer(dev_t, old_dev, dev)
1599 ctf_integer(sector_t, old_sector, from)
1600 )
1601 )
1602 #else
1603 LTTNG_TRACEPOINT_EVENT(block_bio_remap,
1604
1605 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
1606 sector_t from),
1607
1608 TP_ARGS(q, bio, dev, from),
1609
1610 TP_FIELDS(
1611 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1612 ctf_integer(sector_t, sector, bio->bi_sector)
1613 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
1614 blk_rwbs_ctf_integer(unsigned int, rwbs,
1615 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
1616 ctf_integer(dev_t, old_dev, dev)
1617 ctf_integer(sector_t, old_sector, from)
1618 )
1619 )
1620 #endif
1621
1622 #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0) \
1623 || LTTNG_RHEL_KERNEL_RANGE(5,14,0,162,0,0, 5,15,0,0,0,0))
1624 /**
1625 * block_rq_remap - map request for a block operation request
1626 * @rq: block IO operation request
1627 * @dev: device for the operation
1628 * @from: original sector for the operation
1629 *
1630 * The block operation request @rq in @q has been remapped. The block
1631 * operation request @rq holds the current information and @from hold
1632 * the original sector.
1633 */
1634 LTTNG_TRACEPOINT_EVENT(block_rq_remap,
1635
1636 TP_PROTO(struct request *rq, dev_t dev, sector_t from),
1637
1638 TP_ARGS(rq, dev, from),
1639
1640 TP_FIELDS(
1641 ctf_integer(dev_t, dev, disk_devt(rq->q->disk))
1642 ctf_integer(sector_t, sector, blk_rq_pos(rq))
1643 ctf_integer(unsigned int, nr_sector, blk_rq_sectors(rq))
1644 ctf_integer(dev_t, old_dev, dev)
1645 ctf_integer(sector_t, old_sector, from)
1646 blk_rwbs_ctf_integer(unsigned int, rwbs,
1647 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
1648 )
1649 )
1650 #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,11,0) \
1651 || LTTNG_KERNEL_RANGE(5,10,137, 5,11,0) \
1652 || LTTNG_RHEL_KERNEL_RANGE(4,18,0,372,0,0, 4,19,0,0,0,0))
1653 /**
1654 * block_rq_remap - map request for a block operation request
1655 * @rq: block IO operation request
1656 * @dev: device for the operation
1657 * @from: original sector for the operation
1658 *
1659 * The block operation request @rq in @q has been remapped. The block
1660 * operation request @rq holds the current information and @from hold
1661 * the original sector.
1662 */
1663 LTTNG_TRACEPOINT_EVENT(block_rq_remap,
1664
1665 TP_PROTO(struct request *rq, dev_t dev, sector_t from),
1666
1667 TP_ARGS(rq, dev, from),
1668
1669 TP_FIELDS(
1670 ctf_integer(dev_t, dev, disk_devt(rq->rq_disk))
1671 ctf_integer(sector_t, sector, blk_rq_pos(rq))
1672 ctf_integer(unsigned int, nr_sector, blk_rq_sectors(rq))
1673 ctf_integer(dev_t, old_dev, dev)
1674 ctf_integer(sector_t, old_sector, from)
1675 blk_rwbs_ctf_integer(unsigned int, rwbs,
1676 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
1677 )
1678 )
1679 #else
1680 /**
1681 * block_rq_remap - map request for a block operation request
1682 * @q: queue holding the operation
1683 * @rq: block IO operation request
1684 * @dev: device for the operation
1685 * @from: original sector for the operation
1686 *
1687 * The block operation request @rq in @q has been remapped. The block
1688 * operation request @rq holds the current information and @from hold
1689 * the original sector.
1690 */
1691 LTTNG_TRACEPOINT_EVENT(block_rq_remap,
1692
1693 TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev,
1694 sector_t from),
1695
1696 TP_ARGS(q, rq, dev, from),
1697
1698 TP_FIELDS(
1699 ctf_integer(dev_t, dev, disk_devt(rq->rq_disk))
1700 ctf_integer(sector_t, sector, blk_rq_pos(rq))
1701 ctf_integer(unsigned int, nr_sector, blk_rq_sectors(rq))
1702 ctf_integer(dev_t, old_dev, dev)
1703 ctf_integer(sector_t, old_sector, from)
1704 blk_rwbs_ctf_integer(unsigned int, rwbs,
1705 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
1706 )
1707 )
1708 #endif
1709
1710 #undef __print_rwbs_flags
1711 #undef blk_fill_rwbs
1712
1713 #endif /* LTTNG_TRACE_BLOCK_H */
1714
1715 /* This part must be outside protection */
1716 #include <probes/define_trace.h>
This page took 0.065802 seconds and 4 git commands to generate.