1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM block
5 #if !defined(LTTNG_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_BLOCK_H
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 <linux/version.h>
14 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
15 #include <scsi/scsi_request.h>
16 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
18 #ifndef _TRACE_BLOCK_DEF_
19 #define _TRACE_BLOCK_DEF_
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),
35 #endif /* _TRACE_BLOCK_DEF_ */
37 LTTNG_TRACEPOINT_ENUM(block_rq_type
,
39 ctf_enum_value("RWBS_FLAG_WRITE", RWBS_FLAG_WRITE
)
40 ctf_enum_value("RWBS_FLAG_DISCARD", RWBS_FLAG_DISCARD
)
41 ctf_enum_value("RWBS_FLAG_READ", RWBS_FLAG_READ
)
42 ctf_enum_value("RWBS_FLAG_RAHEAD", RWBS_FLAG_RAHEAD
)
43 ctf_enum_value("RWBS_FLAG_BARRIER", RWBS_FLAG_BARRIER
)
44 ctf_enum_value("RWBS_FLAG_SYNC", RWBS_FLAG_SYNC
)
45 ctf_enum_value("RWBS_FLAG_META", RWBS_FLAG_META
)
46 ctf_enum_value("RWBS_FLAG_SECURE", RWBS_FLAG_SECURE
)
47 ctf_enum_value("RWBS_FLAG_FLUSH", RWBS_FLAG_FLUSH
)
48 ctf_enum_value("RWBS_FLAG_FUA", RWBS_FLAG_FUA
)
49 ctf_enum_value("RWBS_FLAG_PREFLUSH", RWBS_FLAG_PREFLUSH
)
53 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0) || \
54 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,73,6,0,0) || \
55 LTTNG_SLE_KERNEL_RANGE(4,4,82,6,0,0, 4,4,82,7,0,0) || \
56 LTTNG_SLE_KERNEL_RANGE(4,4,92,6,0,0, 4,4,92,7,0,0) || \
57 LTTNG_SLE_KERNEL_RANGE(4,4,103,6,0,0, 4,4,103,7,0,0) || \
58 LTTNG_SLE_KERNEL_RANGE(4,4,114,94,0,0, 4,4,114,95,0,0) || \
59 LTTNG_SLE_KERNEL_RANGE(4,4,120,94,0,0, 4,4,120,95,0,0) || \
60 LTTNG_SLE_KERNEL_RANGE(4,4,126,94,0,0, 4,5,0,0,0,0))
62 #define lttng_req_op(rq) req_op(rq)
63 #define lttng_req_rw(rq) ((rq)->cmd_flags)
64 #define lttng_bio_op(bio) bio_op(bio)
65 #define lttng_bio_rw(bio) ((bio)->bi_opf)
67 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
68 ctf_enum(block_rq_type, type, rwbs, \
69 (((op) == REQ_OP_WRITE || (op) == REQ_OP_WRITE_SAME) ? RWBS_FLAG_WRITE : \
70 ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \
71 ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \
72 ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \
73 ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \
75 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
76 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
77 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
78 | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \
79 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
81 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
83 #define lttng_req_op(rq)
84 #define lttng_req_rw(rq) ((rq)->cmd_flags)
85 #define lttng_bio_op(bio)
86 #define lttng_bio_rw(bio) ((bio)->bi_rw)
88 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
89 ctf_enum(block_rq_type, type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
90 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
91 ( (bytes) ? RWBS_FLAG_READ : \
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_SECURE ? RWBS_FLAG_SECURE : 0) \
97 | ((rw) & REQ_FLUSH ? RWBS_FLAG_FLUSH : 0) \
98 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
102 #define lttng_req_op(rq)
103 #define lttng_req_rw(rq) ((rq)->cmd_flags)
104 #define lttng_bio_op(bio)
105 #define lttng_bio_rw(bio) ((bio)->bi_rw)
107 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
108 ctf_enum(block_rq_type, type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
109 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
110 ( (bytes) ? RWBS_FLAG_READ : \
112 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
113 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
114 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
115 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0))
119 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
120 LTTNG_TRACEPOINT_EVENT_CLASS(block_buffer
,
122 TP_PROTO(struct buffer_head
*bh
),
127 ctf_integer(dev_t
, dev
, bh
->b_bdev
->bd_dev
)
128 ctf_integer(sector_t
, sector
, bh
->b_blocknr
)
129 ctf_integer(size_t, size
, bh
->b_size
)
134 * block_touch_buffer - mark a buffer accessed
135 * @bh: buffer_head being touched
137 * Called from touch_buffer().
139 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer
, block_touch_buffer
,
141 TP_PROTO(struct buffer_head
*bh
),
147 * block_dirty_buffer - mark a buffer dirty
148 * @bh: buffer_head being dirtied
150 * Called from mark_buffer_dirty().
152 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer
, block_dirty_buffer
,
154 TP_PROTO(struct buffer_head
*bh
),
160 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
161 /* block_rq_with_error event class removed in kernel 4.12 */
162 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
163 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error
,
165 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
171 unsigned int nr_sector
;
177 if (blk_rq_is_scsi(rq
)) {
178 struct scsi_request
*scsi_rq
= scsi_req(rq
);
179 tp_locvar
->sector
= 0;
180 tp_locvar
->nr_sector
= 0;
181 tp_locvar
->cmd
= scsi_rq
->cmd
;
182 tp_locvar
->cmd_len
= scsi_rq
->cmd_len
;
184 tp_locvar
->sector
= blk_rq_pos(rq
);
185 tp_locvar
->nr_sector
= blk_rq_sectors(rq
);
186 tp_locvar
->cmd
= NULL
;
187 tp_locvar
->cmd_len
= 0;
192 ctf_integer(dev_t
, dev
,
193 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
194 ctf_integer(sector_t
, sector
, tp_locvar
->sector
)
195 ctf_integer(unsigned int, nr_sector
, tp_locvar
->nr_sector
)
196 ctf_integer(int, errors
, rq
->errors
)
197 blk_rwbs_ctf_integer(unsigned int, rwbs
,
198 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
199 ctf_sequence_hex(unsigned char, cmd
,
200 tp_locvar
->cmd
, size_t, tp_locvar
->cmd_len
)
205 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
206 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error
,
208 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
214 unsigned int nr_sector
;
221 if (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) {
222 tp_locvar
->sector
= 0;
223 tp_locvar
->nr_sector
= 0;
224 tp_locvar
->cmd
= rq
->cmd
;
225 tp_locvar
->cmd_len
= rq
->cmd_len
;
227 tp_locvar
->sector
= blk_rq_pos(rq
);
228 tp_locvar
->nr_sector
= blk_rq_sectors(rq
);
229 tp_locvar
->cmd
= NULL
;
230 tp_locvar
->cmd_len
= 0;
235 ctf_integer(dev_t
, dev
,
236 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
237 ctf_integer(sector_t
, sector
, tp_locvar
->sector
)
238 ctf_integer(unsigned int, nr_sector
, tp_locvar
->nr_sector
)
239 ctf_integer(int, errors
, rq
->errors
)
240 blk_rwbs_ctf_integer(unsigned int, rwbs
,
241 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
242 ctf_sequence_hex(unsigned char, cmd
,
243 tp_locvar
->cmd
, size_t, tp_locvar
->cmd_len
)
248 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
250 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0))
252 * block_rq_abort - abort block operation request
253 * @q: queue containing the block operation request
254 * @rq: block IO operation request
256 * Called immediately after pending block IO operation request @rq in
257 * queue @q is aborted. The fields in the operation request @rq
258 * can be examined to determine which device and sectors the pending
259 * operation would access.
261 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error
, block_rq_abort
,
263 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
269 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
271 * block_rq_requeue - place block IO request back on a queue
272 * @rq: block IO operation request
274 * The block operation request @rq is being placed back into queue
275 * @q. For some reason the request was not completed and needs to be
276 * put back in the queue.
278 LTTNG_TRACEPOINT_EVENT(block_rq_requeue
,
280 TP_PROTO(struct request
*rq
),
285 ctf_integer(dev_t
, dev
,
286 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
287 ctf_integer(sector_t
, sector
, blk_rq_trace_sector(rq
))
288 ctf_integer(unsigned int, nr_sector
, blk_rq_trace_nr_sectors(rq
))
289 blk_rwbs_ctf_integer(unsigned int, rwbs
,
290 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
293 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
295 * block_rq_requeue - place block IO request back on a queue
296 * @q: queue holding operation
297 * @rq: block IO operation request
299 * The block operation request @rq is being placed back into queue
300 * @q. For some reason the request was not completed and needs to be
301 * put back in the queue.
303 LTTNG_TRACEPOINT_EVENT(block_rq_requeue
,
305 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
310 ctf_integer(dev_t
, dev
,
311 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
312 ctf_integer(sector_t
, sector
, blk_rq_trace_sector(rq
))
313 ctf_integer(unsigned int, nr_sector
, blk_rq_trace_nr_sectors(rq
))
314 blk_rwbs_ctf_integer(unsigned int, rwbs
,
315 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
319 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error
, block_rq_requeue
,
321 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
328 * block_rq_complete - block IO operation completed by device driver
329 * @q: queue containing the block operation request
330 * @rq: block operations request
331 * @nr_bytes: number of completed bytes
333 * The block_rq_complete tracepoint event indicates that some portion
334 * of operation request has been completed by the device driver. If
335 * the @rq->bio is %NULL, then there is absolutely no additional work to
336 * do for the request. If @rq->bio is non-NULL then there is
337 * additional work required to complete the request.
339 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
340 LTTNG_TRACEPOINT_EVENT(block_rq_complete
,
342 TP_PROTO(struct request
*rq
, int error
, unsigned int nr_bytes
),
344 TP_ARGS(rq
, error
, nr_bytes
),
347 ctf_integer(dev_t
, dev
,
348 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
349 ctf_integer(sector_t
, sector
, blk_rq_pos(rq
))
350 ctf_integer(unsigned int, nr_sector
, nr_bytes
>> 9)
351 ctf_integer(int, error
, error
)
352 blk_rwbs_ctf_integer(unsigned int, rwbs
,
353 lttng_req_op(rq
), lttng_req_rw(rq
), nr_bytes
)
356 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
357 LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete
,
359 TP_PROTO(struct request_queue
*q
, struct request
*rq
,
360 unsigned int nr_bytes
),
362 TP_ARGS(q
, rq
, nr_bytes
),
370 if (blk_rq_is_scsi(rq
)) {
371 struct scsi_request
*scsi_rq
= scsi_req(rq
);
372 tp_locvar
->cmd
= scsi_rq
->cmd
;
373 tp_locvar
->cmd_len
= scsi_rq
->cmd_len
;
375 tp_locvar
->cmd
= NULL
;
376 tp_locvar
->cmd_len
= 0;
381 ctf_integer(dev_t
, dev
,
382 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
383 ctf_integer(sector_t
, sector
, blk_rq_pos(rq
))
384 ctf_integer(unsigned int, nr_sector
, nr_bytes
>> 9)
385 ctf_integer(int, errors
, rq
->errors
)
386 blk_rwbs_ctf_integer(unsigned int, rwbs
,
387 lttng_req_op(rq
), lttng_req_rw(rq
), nr_bytes
)
388 ctf_sequence_hex(unsigned char, cmd
,
389 tp_locvar
->cmd
, size_t, tp_locvar
->cmd_len
)
394 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,5) \
395 || LTTNG_KERNEL_RANGE(3,12,21, 3,13,0) \
396 || LTTNG_KERNEL_RANGE(3,10,41, 3,11,0) \
397 || LTTNG_KERNEL_RANGE(3,4,91, 3,5,0) \
398 || LTTNG_KERNEL_RANGE(3,2,58, 3,3,0) \
399 || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,28, 3,14,0,0) \
400 || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0))
402 LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete
,
404 TP_PROTO(struct request_queue
*q
, struct request
*rq
,
405 unsigned int nr_bytes
),
407 TP_ARGS(q
, rq
, nr_bytes
),
415 if (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) {
416 tp_locvar
->cmd
= rq
->cmd
;
417 tp_locvar
->cmd_len
= rq
->cmd_len
;
419 tp_locvar
->cmd
= NULL
;
420 tp_locvar
->cmd_len
= 0;
425 ctf_integer(dev_t
, dev
,
426 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
427 ctf_integer(sector_t
, sector
, blk_rq_pos(rq
))
428 ctf_integer(unsigned int, nr_sector
, nr_bytes
>> 9)
429 ctf_integer(int, errors
, rq
->errors
)
430 blk_rwbs_ctf_integer(unsigned int, rwbs
,
431 lttng_req_op(rq
), lttng_req_rw(rq
), nr_bytes
)
432 ctf_sequence_hex(unsigned char, cmd
,
433 tp_locvar
->cmd
, size_t, tp_locvar
->cmd_len
)
439 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
442 * block_rq_complete - block IO operation completed by device driver
443 * @q: queue containing the block operation request
444 * @rq: block operations request
446 * The block_rq_complete tracepoint event indicates that some portion
447 * of operation request has been completed by the device driver. If
448 * the @rq->bio is %NULL, then there is absolutely no additional work to
449 * do for the request. If @rq->bio is non-NULL then there is
450 * additional work required to complete the request.
452 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error
, block_rq_complete
,
454 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
459 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
461 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
462 LTTNG_TRACEPOINT_EVENT_CLASS(block_rq
,
464 TP_PROTO(struct request
*rq
),
469 ctf_integer(dev_t
, dev
,
470 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
471 ctf_integer(sector_t
, sector
, blk_rq_trace_sector(rq
))
472 ctf_integer(unsigned int, nr_sector
, blk_rq_trace_nr_sectors(rq
))
473 ctf_integer(unsigned int, bytes
, blk_rq_bytes(rq
))
474 ctf_integer(pid_t
, tid
, current
->pid
)
475 blk_rwbs_ctf_integer(unsigned int, rwbs
,
476 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
477 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
480 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
481 LTTNG_TRACEPOINT_EVENT_CLASS(block_rq
,
483 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
488 ctf_integer(dev_t
, dev
,
489 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
490 ctf_integer(sector_t
, sector
, blk_rq_trace_sector(rq
))
491 ctf_integer(unsigned int, nr_sector
, blk_rq_trace_nr_sectors(rq
))
492 ctf_integer(unsigned int, bytes
, blk_rq_bytes(rq
))
493 ctf_integer(pid_t
, tid
, current
->pid
)
494 blk_rwbs_ctf_integer(unsigned int, rwbs
,
495 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
496 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
499 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
500 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq
,
502 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
508 unsigned int nr_sector
;
515 if (blk_rq_is_scsi(rq
)) {
516 struct scsi_request
*scsi_rq
= scsi_req(rq
);
517 tp_locvar
->sector
= 0;
518 tp_locvar
->nr_sector
= 0;
519 tp_locvar
->bytes
= scsi_rq
->resid_len
;
520 tp_locvar
->cmd
= scsi_rq
->cmd
;
521 tp_locvar
->cmd_len
= scsi_rq
->cmd_len
;
523 tp_locvar
->sector
= blk_rq_pos(rq
);
524 tp_locvar
->nr_sector
= blk_rq_sectors(rq
);
525 tp_locvar
->bytes
= 0;
526 tp_locvar
->cmd
= NULL
;
527 tp_locvar
->cmd_len
= 0;
532 ctf_integer(dev_t
, dev
,
533 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
534 ctf_integer(sector_t
, sector
, tp_locvar
->sector
)
535 ctf_integer(unsigned int, nr_sector
, tp_locvar
->nr_sector
)
536 ctf_integer(unsigned int, bytes
, tp_locvar
->bytes
)
537 ctf_integer(pid_t
, tid
, current
->pid
)
538 blk_rwbs_ctf_integer(unsigned int, rwbs
,
539 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
540 ctf_sequence_hex(unsigned char, cmd
,
541 tp_locvar
->cmd
, size_t, tp_locvar
->cmd_len
)
542 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
547 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
548 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq
,
550 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
556 unsigned int nr_sector
;
563 if (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) {
564 tp_locvar
->sector
= 0;
565 tp_locvar
->nr_sector
= 0;
566 tp_locvar
->bytes
= blk_rq_bytes(rq
);
567 tp_locvar
->cmd
= rq
->cmd
;
568 tp_locvar
->cmd_len
= rq
->cmd_len
;
570 tp_locvar
->sector
= blk_rq_pos(rq
);
571 tp_locvar
->nr_sector
= blk_rq_sectors(rq
);
572 tp_locvar
->bytes
= 0;
573 tp_locvar
->cmd
= NULL
;
574 tp_locvar
->cmd_len
= 0;
579 ctf_integer(dev_t
, dev
,
580 rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
581 ctf_integer(sector_t
, sector
, tp_locvar
->sector
)
582 ctf_integer(unsigned int, nr_sector
, tp_locvar
->nr_sector
)
583 ctf_integer(unsigned int, bytes
, tp_locvar
->bytes
)
584 ctf_integer(pid_t
, tid
, current
->pid
)
585 blk_rwbs_ctf_integer(unsigned int, rwbs
,
586 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
587 ctf_sequence_hex(unsigned char, cmd
,
588 tp_locvar
->cmd
, size_t, tp_locvar
->cmd_len
)
589 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
594 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
596 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
598 * block_rq_insert - insert block operation request into queue
599 * @rq: block IO operation request
601 * Called immediately before block operation request @rq is inserted
602 * into queue @q. The fields in the operation request @rq struct can
603 * be examined to determine which device and sectors the pending
604 * operation would access.
606 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq
, block_rq_insert
,
608 TP_PROTO(struct request
*rq
),
614 * block_rq_insert - insert block operation request into queue
616 * @rq: block IO operation request
618 * Called immediately before block operation request @rq is inserted
619 * into queue @q. The fields in the operation request @rq struct can
620 * be examined to determine which device and sectors the pending
621 * operation would access.
623 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq
, block_rq_insert
,
625 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
631 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
633 * block_rq_issue - issue pending block IO request operation to device driver
634 * @rq: block IO operation operation request
636 * Called when block operation request @rq from queue @q is sent to a
637 * device driver for processing.
639 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq
, block_rq_issue
,
641 TP_PROTO(struct request
*rq
),
647 * block_rq_issue - issue pending block IO request operation to device driver
648 * @q: queue holding operation
649 * @rq: block IO operation operation request
651 * Called when block operation request @rq from queue @q is sent to a
652 * device driver for processing.
654 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq
, block_rq_issue
,
656 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
662 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
664 * block_rq_merge - merge request with another one in the elevator
665 * @rq: block IO operation operation request
667 * Called when block operation request @rq from queue @q is merged to another
668 * request queued in the elevator.
670 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq
, block_rq_merge
,
672 TP_PROTO(struct request
*rq
),
676 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0))
678 * block_rq_merge - merge request with another one in the elevator
679 * @q: queue holding operation
680 * @rq: block IO operation operation request
682 * Called when block operation request @rq from queue @q is merged to another
683 * request queued in the elevator.
685 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq
, block_rq_merge
,
687 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
693 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
695 * block_bio_complete - completed all work on the block operation
696 * @q: queue holding the block operation
697 * @bio: block operation completed
698 * @error: io error value
700 * This tracepoint indicates there is no further work to do on this
701 * block IO operation @bio.
703 LTTNG_TRACEPOINT_EVENT(block_bio_complete
,
705 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
710 ctf_integer(dev_t
, dev
, bio_dev(bio
))
711 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
712 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
713 ctf_integer(int, error
, blk_status_to_errno(bio
->bi_status
))
714 blk_rwbs_ctf_integer(unsigned int, rwbs
,
715 lttng_bio_op(bio
), lttng_bio_rw(bio
),
716 bio
->bi_iter
.bi_size
)
719 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
721 * block_bio_complete - completed all work on the block operation
722 * @q: queue holding the block operation
723 * @bio: block operation completed
724 * @error: io error value
726 * This tracepoint indicates there is no further work to do on this
727 * block IO operation @bio.
729 LTTNG_TRACEPOINT_EVENT(block_bio_complete
,
731 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int error
),
733 TP_ARGS(q
, bio
, error
),
736 ctf_integer(dev_t
, dev
, bio_dev(bio
))
737 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
738 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
739 ctf_integer(int, error
, error
)
740 blk_rwbs_ctf_integer(unsigned int, rwbs
,
741 lttng_bio_op(bio
), lttng_bio_rw(bio
),
742 bio
->bi_iter
.bi_size
)
745 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
747 * block_bio_complete - completed all work on the block operation
748 * @q: queue holding the block operation
749 * @bio: block operation completed
750 * @error: io error value
752 * This tracepoint indicates there is no further work to do on this
753 * block IO operation @bio.
755 LTTNG_TRACEPOINT_EVENT(block_bio_complete
,
757 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int error
),
759 TP_ARGS(q
, bio
, error
),
762 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
763 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
764 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
765 ctf_integer(int, error
, error
)
766 blk_rwbs_ctf_integer(unsigned int, rwbs
,
767 lttng_bio_op(bio
), lttng_bio_rw(bio
),
768 bio
->bi_iter
.bi_size
)
773 * block_bio_complete - completed all work on the block operation
774 * @q: queue holding the block operation
775 * @bio: block operation completed
776 * @error: io error value
778 * This tracepoint indicates there is no further work to do on this
779 * block IO operation @bio.
781 LTTNG_TRACEPOINT_EVENT(block_bio_complete
,
783 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int error
),
785 TP_ARGS(q
, bio
, error
),
788 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
789 ctf_integer(sector_t
, sector
, bio
->bi_sector
)
790 ctf_integer(unsigned int, nr_sector
, bio
->bi_size
>> 9)
791 ctf_integer(int, error
, error
)
792 blk_rwbs_ctf_integer(unsigned int, rwbs
,
793 lttng_bio_op(bio
), lttng_bio_rw(bio
), bio
->bi_size
)
798 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
799 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio
,
801 TP_PROTO(struct bio
*bio
),
806 ctf_integer(dev_t
, dev
, bio_dev(bio
))
807 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
808 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
809 blk_rwbs_ctf_integer(unsigned int, rwbs
,
810 lttng_bio_op(bio
), lttng_bio_rw(bio
),
811 bio
->bi_iter
.bi_size
)
812 ctf_integer(pid_t
, tid
, current
->pid
)
813 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
816 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
817 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge
,
819 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
824 ctf_integer(dev_t
, dev
, bio_dev(bio
))
825 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
826 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
827 blk_rwbs_ctf_integer(unsigned int, rwbs
,
828 lttng_bio_op(bio
), lttng_bio_rw(bio
),
829 bio
->bi_iter
.bi_size
)
830 ctf_integer(pid_t
, tid
, current
->pid
)
831 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
834 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
835 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge
,
837 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
842 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
843 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
844 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
845 blk_rwbs_ctf_integer(unsigned int, rwbs
,
846 lttng_bio_op(bio
), lttng_bio_rw(bio
),
847 bio
->bi_iter
.bi_size
)
848 ctf_integer(pid_t
, tid
, current
->pid
)
849 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
852 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
853 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge
,
855 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
860 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
861 ctf_integer(sector_t
, sector
, bio
->bi_sector
)
862 ctf_integer(unsigned int, nr_sector
, bio
->bi_size
>> 9)
863 blk_rwbs_ctf_integer(unsigned int, rwbs
,
864 lttng_bio_op(bio
), lttng_bio_rw(bio
), bio
->bi_size
)
865 ctf_integer(pid_t
, tid
, current
->pid
)
866 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
873 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
875 * block_bio_bounce - used bounce buffer when processing block operation
876 * @bio: block operation
878 * A bounce buffer was used to handle the block operation @bio in @q.
879 * This occurs when hardware limitations prevent a direct transfer of
880 * data between the @bio data memory area and the IO device. Use of a
881 * bounce buffer requires extra copying of data and decreases
884 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio
, block_bio_bounce
,
886 TP_PROTO(struct bio
*bio
),
890 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
892 * block_bio_bounce - used bounce buffer when processing block operation
893 * @q: queue holding the block operation
894 * @bio: block operation
896 * A bounce buffer was used to handle the block operation @bio in @q.
897 * This occurs when hardware limitations prevent a direct transfer of
898 * data between the @bio data memory area and the IO device. Use of a
899 * bounce buffer requires extra copying of data and decreases
902 LTTNG_TRACEPOINT_EVENT(block_bio_bounce
,
904 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
909 ctf_integer(dev_t
, dev
, bio_dev(bio
))
910 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
911 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
912 blk_rwbs_ctf_integer(unsigned int, rwbs
,
913 lttng_bio_op(bio
), lttng_bio_rw(bio
),
914 bio
->bi_iter
.bi_size
)
915 ctf_integer(pid_t
, tid
, current
->pid
)
916 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
919 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
920 LTTNG_TRACEPOINT_EVENT(block_bio_bounce
,
922 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
927 ctf_integer(dev_t
, dev
, bio
->bi_bdev
? bio
->bi_bdev
->bd_dev
: 0)
928 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
929 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
930 blk_rwbs_ctf_integer(unsigned int, rwbs
,
931 lttng_bio_op(bio
), lttng_bio_rw(bio
),
932 bio
->bi_iter
.bi_size
)
933 ctf_integer(pid_t
, tid
, current
->pid
)
934 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
938 LTTNG_TRACEPOINT_EVENT(block_bio_bounce
,
940 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
945 ctf_integer(dev_t
, dev
, bio
->bi_bdev
? bio
->bi_bdev
->bd_dev
: 0)
946 ctf_integer(sector_t
, sector
, bio
->bi_sector
)
947 ctf_integer(unsigned int, nr_sector
, bio
->bi_size
>> 9)
948 blk_rwbs_ctf_integer(unsigned int, rwbs
,
949 lttng_bio_op(bio
), lttng_bio_rw(bio
),
951 ctf_integer(pid_t
, tid
, current
->pid
)
952 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
958 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
960 * block_bio_backmerge - merging block operation to the end of an existing operation
961 * @bio: new block operation to merge
963 * Merging block request @bio to the end of an existing block request.
965 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio
, block_bio_backmerge
,
967 TP_PROTO(struct bio
*bio
),
973 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
974 * @bio: new block operation to merge
976 * Merging block IO operation @bio to the beginning of an existing block request.
978 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio
, block_bio_frontmerge
,
980 TP_PROTO(struct bio
*bio
),
986 * block_bio_queue - putting new block IO operation in queue
987 * @bio: new block operation
989 * About to place the block IO operation @bio into queue @q.
991 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio
, block_bio_queue
,
993 TP_PROTO(struct bio
*bio
),
997 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
999 * block_bio_backmerge - merging block operation to the end of an existing operation
1000 * @q: queue holding operation
1001 * @rq: request bio is being merged into
1002 * @bio: new block operation to merge
1004 * Merging block request @bio to the end of an existing block request
1007 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge
, block_bio_backmerge
,
1009 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
1015 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
1016 * @q: queue holding operation
1017 * @rq: request bio is being merged into
1018 * @bio: new block operation to merge
1020 * Merging block IO operation @bio to the beginning of an existing block
1021 * operation in queue @q.
1023 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge
, block_bio_frontmerge
,
1025 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
1031 * block_bio_queue - putting new block IO operation in queue
1032 * @q: queue holding operation
1033 * @bio: new block operation
1035 * About to place the block IO operation @bio into queue @q.
1037 LTTNG_TRACEPOINT_EVENT(block_bio_queue
,
1039 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
1044 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1045 ctf_integer(dev_t
, dev
, bio_dev(bio
))
1047 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
1049 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
1050 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
1051 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
1052 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1053 lttng_bio_op(bio
), lttng_bio_rw(bio
),
1054 bio
->bi_iter
.bi_size
)
1055 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
1056 ctf_integer(sector_t
, sector
, bio
->bi_sector
)
1057 ctf_integer(unsigned int, nr_sector
, bio
->bi_size
>> 9)
1058 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1059 lttng_bio_op(bio
), lttng_bio_rw(bio
), bio
->bi_size
)
1060 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
1061 ctf_integer(pid_t
, tid
, current
->pid
)
1062 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1065 #else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */
1066 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio
,
1068 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
1073 ctf_integer(dev_t
, dev
, bio
->bi_bdev
? bio
->bi_bdev
->bd_dev
: 0)
1074 ctf_integer(sector_t
, sector
, bio
->bi_sector
)
1075 ctf_integer(unsigned int, nr_sector
, bio
->bi_size
>> 9)
1076 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1077 lttng_bio_op(bio
), lttng_bio_rw(bio
), bio
->bi_size
)
1078 ctf_integer(pid_t
, tid
, current
->pid
)
1079 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1084 * block_bio_backmerge - merging block operation to the end of an existing operation
1085 * @q: queue holding operation
1086 * @bio: new block operation to merge
1088 * Merging block request @bio to the end of an existing block request
1091 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio
, block_bio_backmerge
,
1093 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
1099 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
1100 * @q: queue holding operation
1101 * @bio: new block operation to merge
1103 * Merging block IO operation @bio to the beginning of an existing block
1104 * operation in queue @q.
1106 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio
, block_bio_frontmerge
,
1108 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
1114 * block_bio_queue - putting new block IO operation in queue
1115 * @q: queue holding operation
1116 * @bio: new block operation
1118 * About to place the block IO operation @bio into queue @q.
1120 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio
, block_bio_queue
,
1122 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
1126 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */
1128 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
1130 * block_getrq - get a free request entry in queue for block IO operations
1131 * @bio: pending block IO operation (can be %NULL)
1133 * A request struct has been allocated to handle the block IO operation @bio.
1135 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio
, block_getrq
,
1137 TP_PROTO(struct bio
*bio
),
1142 LTTNG_TRACEPOINT_EVENT_CLASS(block_get_rq
,
1144 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
1146 TP_ARGS(q
, bio
, rw
),
1149 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1150 ctf_integer(dev_t
, dev
, bio
? bio_dev(bio
) : 0)
1152 ctf_integer(dev_t
, dev
, bio
? bio
->bi_bdev
->bd_dev
: 0)
1154 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
1155 ctf_integer(sector_t
, sector
, bio
? bio
->bi_iter
.bi_sector
: 0)
1156 ctf_integer(unsigned int, nr_sector
,
1157 bio
? bio_sectors(bio
) : 0)
1158 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1159 bio
? lttng_bio_op(bio
) : 0,
1160 bio
? lttng_bio_rw(bio
) : 0,
1161 bio
? bio
->bi_iter
.bi_size
: 0)
1162 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
1163 ctf_integer(sector_t
, sector
, bio
? bio
->bi_sector
: 0)
1164 ctf_integer(unsigned int, nr_sector
,
1165 bio
? bio
->bi_size
>> 9 : 0)
1166 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1167 bio
? lttng_bio_op(bio
) : 0,
1168 bio
? lttng_bio_rw(bio
) : 0,
1169 bio
? bio
->bi_size
: 0)
1170 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
1171 ctf_integer(pid_t
, tid
, current
->pid
)
1172 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1177 * block_getrq - get a free request entry in queue for block IO operations
1178 * @q: queue for operations
1179 * @bio: pending block IO operation (can be %NULL)
1180 * @rw: low bit indicates a read (%0) or a write (%1)
1182 * A request struct for queue @q has been allocated to handle the
1183 * block IO operation @bio.
1185 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq
, block_getrq
,
1187 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
1193 * block_sleeprq - waiting to get a free request entry in queue for block IO operation
1194 * @q: queue for operation
1195 * @bio: pending block IO operation (can be %NULL)
1196 * @rw: low bit indicates a read (%0) or a write (%1)
1198 * In the case where a request struct cannot be provided for queue @q
1199 * the process needs to wait for an request struct to become
1200 * available. This tracepoint event is generated each time the
1201 * process goes to sleep waiting for request struct become available.
1203 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq
, block_sleeprq
,
1205 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
1212 * block_plug - keep operations requests in request queue
1213 * @q: request queue to plug
1215 * Plug the request queue @q. Do not allow block operation requests
1216 * to be sent to the device driver. Instead, accumulate requests in
1217 * the queue to improve throughput performance of the block device.
1219 LTTNG_TRACEPOINT_EVENT(block_plug
,
1221 TP_PROTO(struct request_queue
*q
),
1226 ctf_integer(pid_t
, tid
, current
->pid
)
1227 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1231 LTTNG_TRACEPOINT_EVENT_CLASS(block_unplug
,
1233 TP_PROTO(struct request_queue
*q
, unsigned int depth
, bool explicit),
1235 TP_ARGS(q
, depth
, explicit),
1238 ctf_integer(int, nr_rq
, depth
)
1239 ctf_integer(pid_t
, tid
, current
->pid
)
1240 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1245 * block_unplug - release of operations requests in request queue
1246 * @q: request queue to unplug
1247 * @depth: number of requests just added to the queue
1248 * @explicit: whether this was an explicit unplug, or one from schedule()
1250 * Unplug request queue @q because device driver is scheduled to work
1251 * on elements in the request queue.
1253 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_unplug
, block_unplug
,
1255 TP_PROTO(struct request_queue
*q
, unsigned int depth
, bool explicit),
1257 TP_ARGS(q
, depth
, explicit)
1260 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
1262 * block_split - split a single bio struct into two bio structs
1263 * @bio: block operation being split
1264 * @new_sector: The starting sector for the new bio
1266 * The bio request @bio needs to be split into two bio requests. The newly
1267 * created @bio request starts at @new_sector. This split may be required due to
1268 * hardware limitations such as operation crossing device boundaries in a RAID
1271 LTTNG_TRACEPOINT_EVENT(block_split
,
1273 TP_PROTO(struct bio
*bio
, unsigned int new_sector
),
1275 TP_ARGS(bio
, new_sector
),
1278 ctf_integer(dev_t
, dev
, bio_dev(bio
))
1279 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
1280 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1281 lttng_bio_op(bio
), lttng_bio_rw(bio
),
1282 bio
->bi_iter
.bi_size
)
1283 ctf_integer(sector_t
, new_sector
, new_sector
)
1284 ctf_integer(pid_t
, tid
, current
->pid
)
1285 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1289 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1291 * block_split - split a single bio struct into two bio structs
1292 * @q: queue containing the bio
1293 * @bio: block operation being split
1294 * @new_sector: The starting sector for the new bio
1296 * The bio request @bio in request queue @q needs to be split into two
1297 * bio requests. The newly created @bio request starts at
1298 * @new_sector. This split may be required due to hardware limitation
1299 * such as operation crossing device boundaries in a RAID system.
1301 LTTNG_TRACEPOINT_EVENT(block_split
,
1303 TP_PROTO(struct request_queue
*q
, struct bio
*bio
,
1304 unsigned int new_sector
),
1306 TP_ARGS(q
, bio
, new_sector
),
1309 ctf_integer(dev_t
, dev
, bio_dev(bio
))
1310 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
1311 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1312 lttng_bio_op(bio
), lttng_bio_rw(bio
),
1313 bio
->bi_iter
.bi_size
)
1314 ctf_integer(sector_t
, new_sector
, new_sector
)
1315 ctf_integer(pid_t
, tid
, current
->pid
)
1316 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1319 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
1320 LTTNG_TRACEPOINT_EVENT(block_split
,
1322 TP_PROTO(struct request_queue
*q
, struct bio
*bio
,
1323 unsigned int new_sector
),
1325 TP_ARGS(q
, bio
, new_sector
),
1328 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
1329 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
1330 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1331 lttng_bio_op(bio
), lttng_bio_rw(bio
),
1332 bio
->bi_iter
.bi_size
)
1333 ctf_integer(sector_t
, new_sector
, new_sector
)
1334 ctf_integer(pid_t
, tid
, current
->pid
)
1335 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1339 LTTNG_TRACEPOINT_EVENT(block_split
,
1341 TP_PROTO(struct request_queue
*q
, struct bio
*bio
,
1342 unsigned int new_sector
),
1344 TP_ARGS(q
, bio
, new_sector
),
1347 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
1348 ctf_integer(sector_t
, sector
, bio
->bi_sector
)
1349 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1350 lttng_bio_op(bio
), lttng_bio_rw(bio
), bio
->bi_size
)
1351 ctf_integer(sector_t
, new_sector
, new_sector
)
1352 ctf_integer(pid_t
, tid
, current
->pid
)
1353 ctf_array_text(char, comm
, current
->comm
, TASK_COMM_LEN
)
1358 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
1360 * block_bio_remap - map request for a logical device to the raw device
1361 * @bio: revised operation
1362 * @dev: original device for the operation
1363 * @from: original sector for the operation
1365 * An operation for a logical device has been mapped to the
1368 LTTNG_TRACEPOINT_EVENT(block_bio_remap
,
1370 TP_PROTO(struct bio
*bio
, dev_t dev
, sector_t from
),
1372 TP_ARGS(bio
, dev
, from
),
1375 ctf_integer(dev_t
, dev
, bio_dev(bio
))
1376 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
1377 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
1378 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1379 lttng_bio_op(bio
), lttng_bio_rw(bio
),
1380 bio
->bi_iter
.bi_size
)
1381 ctf_integer(dev_t
, old_dev
, dev
)
1382 ctf_integer(sector_t
, old_sector
, from
)
1385 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1387 * block_bio_remap - map request for a logical device to the raw device
1388 * @q: queue holding the operation
1389 * @bio: revised operation
1390 * @dev: device for the operation
1391 * @from: original sector for the operation
1393 * An operation for a logical device has been mapped to the
1396 LTTNG_TRACEPOINT_EVENT(block_bio_remap
,
1398 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, dev_t dev
,
1401 TP_ARGS(q
, bio
, dev
, from
),
1404 ctf_integer(dev_t
, dev
, bio_dev(bio
))
1405 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
1406 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
1407 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1408 lttng_bio_op(bio
), lttng_bio_rw(bio
),
1409 bio
->bi_iter
.bi_size
)
1410 ctf_integer(dev_t
, old_dev
, dev
)
1411 ctf_integer(sector_t
, old_sector
, from
)
1414 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
1415 LTTNG_TRACEPOINT_EVENT(block_bio_remap
,
1417 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, dev_t dev
,
1420 TP_ARGS(q
, bio
, dev
, from
),
1423 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
1424 ctf_integer(sector_t
, sector
, bio
->bi_iter
.bi_sector
)
1425 ctf_integer(unsigned int, nr_sector
, bio_sectors(bio
))
1426 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1427 lttng_bio_op(bio
), lttng_bio_rw(bio
),
1428 bio
->bi_iter
.bi_size
)
1429 ctf_integer(dev_t
, old_dev
, dev
)
1430 ctf_integer(sector_t
, old_sector
, from
)
1434 LTTNG_TRACEPOINT_EVENT(block_bio_remap
,
1436 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, dev_t dev
,
1439 TP_ARGS(q
, bio
, dev
, from
),
1442 ctf_integer(dev_t
, dev
, bio
->bi_bdev
->bd_dev
)
1443 ctf_integer(sector_t
, sector
, bio
->bi_sector
)
1444 ctf_integer(unsigned int, nr_sector
, bio
->bi_size
>> 9)
1445 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1446 lttng_bio_op(bio
), lttng_bio_rw(bio
), bio
->bi_size
)
1447 ctf_integer(dev_t
, old_dev
, dev
)
1448 ctf_integer(sector_t
, old_sector
, from
)
1453 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,11,0))
1455 * block_rq_remap - map request for a block operation request
1456 * @rq: block IO operation request
1457 * @dev: device for the operation
1458 * @from: original sector for the operation
1460 * The block operation request @rq in @q has been remapped. The block
1461 * operation request @rq holds the current information and @from hold
1462 * the original sector.
1464 LTTNG_TRACEPOINT_EVENT(block_rq_remap
,
1466 TP_PROTO(struct request
*rq
, dev_t dev
, sector_t from
),
1468 TP_ARGS(rq
, dev
, from
),
1471 ctf_integer(dev_t
, dev
, disk_devt(rq
->rq_disk
))
1472 ctf_integer(sector_t
, sector
, blk_rq_pos(rq
))
1473 ctf_integer(unsigned int, nr_sector
, blk_rq_sectors(rq
))
1474 ctf_integer(dev_t
, old_dev
, dev
)
1475 ctf_integer(sector_t
, old_sector
, from
)
1476 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1477 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
1482 * block_rq_remap - map request for a block operation request
1483 * @q: queue holding the operation
1484 * @rq: block IO operation request
1485 * @dev: device for the operation
1486 * @from: original sector for the operation
1488 * The block operation request @rq in @q has been remapped. The block
1489 * operation request @rq holds the current information and @from hold
1490 * the original sector.
1492 LTTNG_TRACEPOINT_EVENT(block_rq_remap
,
1494 TP_PROTO(struct request_queue
*q
, struct request
*rq
, dev_t dev
,
1497 TP_ARGS(q
, rq
, dev
, from
),
1500 ctf_integer(dev_t
, dev
, disk_devt(rq
->rq_disk
))
1501 ctf_integer(sector_t
, sector
, blk_rq_pos(rq
))
1502 ctf_integer(unsigned int, nr_sector
, blk_rq_sectors(rq
))
1503 ctf_integer(dev_t
, old_dev
, dev
)
1504 ctf_integer(sector_t
, old_sector
, from
)
1505 blk_rwbs_ctf_integer(unsigned int, rwbs
,
1506 lttng_req_op(rq
), lttng_req_rw(rq
), blk_rq_bytes(rq
))
1511 #undef __print_rwbs_flags
1512 #undef blk_fill_rwbs
1514 #endif /* LTTNG_TRACE_BLOCK_H */
1516 /* This part must be outside protection */
1517 #include <probes/define_trace.h>
This page took 0.075597 seconds and 4 git commands to generate.