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