d632b92eb187c50809c343f34a4f8d1dc6acd5e3
[lttng-modules.git] / instrumentation / events / lttng-module / block.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM block
4
5 #if !defined(LTTNG_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_BLOCK_H
7
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/blktrace_api.h>
10 #include <linux/blkdev.h>
11 #include <linux/trace_seq.h>
12 #include <linux/version.h>
13
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)) */
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 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0) || \
38 LTTNG_SLE_KERNEL_RANGE(4,4,73,5,0,0, 4,4,103,92,0,0))
39
40 #define lttng_req_op(rq) req_op(rq)
41 #define lttng_req_rw(rq) ((rq)->cmd_flags)
42 #define lttng_bio_op(bio) bio_op(bio)
43 #define lttng_bio_rw(bio) ((bio)->bi_opf)
44
45 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
46 ctf_integer(type, rwbs, \
47 (((op) == REQ_OP_WRITE || (op) == REQ_OP_WRITE_SAME) ? RWBS_FLAG_WRITE : \
48 ( (op) == REQ_OP_DISCARD ? RWBS_FLAG_DISCARD : \
49 ( (op) == REQ_OP_SECURE_ERASE ? (RWBS_FLAG_DISCARD | RWBS_FLAG_SECURE) : \
50 ( (op) == REQ_OP_FLUSH ? RWBS_FLAG_FLUSH : \
51 ( (op) == REQ_OP_READ ? RWBS_FLAG_READ : \
52 ( 0 )))))) \
53 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
54 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
55 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
56 | ((rw) & REQ_PREFLUSH ? RWBS_FLAG_PREFLUSH : 0) \
57 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
58
59 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
60
61 #define lttng_req_op(rq)
62 #define lttng_req_rw(rq) ((rq)->cmd_flags)
63 #define lttng_bio_op(bio)
64 #define lttng_bio_rw(bio) ((bio)->bi_rw)
65
66 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
67 ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
68 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
69 ( (bytes) ? RWBS_FLAG_READ : \
70 ( 0 )))) \
71 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
72 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
73 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
74 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0) \
75 | ((rw) & REQ_FLUSH ? RWBS_FLAG_FLUSH : 0) \
76 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
77
78 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
79
80 #define lttng_req_op(rq)
81 #define lttng_req_rw(rq) ((rq)->cmd_flags)
82 #define lttng_bio_op(bio)
83 #define lttng_bio_rw(bio) ((bio)->bi_rw)
84
85 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
86 ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
87 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
88 ( (bytes) ? RWBS_FLAG_READ : \
89 ( 0 )))) \
90 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
91 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
92 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
93 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0))
94
95 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
96
97 #define lttng_req_op(rq)
98 #define lttng_req_rw(rq) ((rq)->cmd_flags)
99 #define lttng_bio_op(bio)
100 #define lttng_bio_rw(bio) ((bio)->bi_rw)
101
102 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
103 ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
104 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
105 ( (bytes) ? RWBS_FLAG_READ : \
106 ( 0 )))) \
107 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
108 | ((rw) & REQ_HARDBARRIER ? RWBS_FLAG_BARRIER : 0) \
109 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
110 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
111 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0))
112
113 #else
114
115 #define lttng_req_op(rq)
116 #define lttng_req_rw(rq) ((rq)->cmd_flags)
117 #define lttng_bio_op(bio)
118 #define lttng_bio_rw(bio) ((bio)->bi_rw)
119
120 #define blk_rwbs_ctf_integer(type, rwbs, op, rw, bytes) \
121 ctf_integer(type, rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
122 ( (rw) & (1 << BIO_RW_DISCARD) ? RWBS_FLAG_DISCARD : \
123 ( (bytes) ? RWBS_FLAG_READ : \
124 ( 0 )))) \
125 | ((rw) & (1 << BIO_RW_AHEAD) ? RWBS_FLAG_RAHEAD : 0) \
126 | ((rw) & (1 << BIO_RW_SYNCIO) ? RWBS_FLAG_SYNC : 0) \
127 | ((rw) & (1 << BIO_RW_META) ? RWBS_FLAG_META : 0) \
128 | ((rw) & (1 << BIO_RW_BARRIER) ? RWBS_FLAG_BARRIER : 0))
129
130 #endif
131
132 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
133 LTTNG_TRACEPOINT_EVENT_CLASS(block_buffer,
134
135 TP_PROTO(struct buffer_head *bh),
136
137 TP_ARGS(bh),
138
139 TP_FIELDS (
140 ctf_integer(dev_t, dev, bh->b_bdev->bd_dev)
141 ctf_integer(sector_t, sector, bh->b_blocknr)
142 ctf_integer(size_t, size, bh->b_size)
143 )
144 )
145
146 /**
147 * block_touch_buffer - mark a buffer accessed
148 * @bh: buffer_head being touched
149 *
150 * Called from touch_buffer().
151 */
152 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer, block_touch_buffer,
153
154 TP_PROTO(struct buffer_head *bh),
155
156 TP_ARGS(bh)
157 )
158
159 /**
160 * block_dirty_buffer - mark a buffer dirty
161 * @bh: buffer_head being dirtied
162 *
163 * Called from mark_buffer_dirty().
164 */
165 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_buffer, block_dirty_buffer,
166
167 TP_PROTO(struct buffer_head *bh),
168
169 TP_ARGS(bh)
170 )
171 #endif
172
173 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
174 /* block_rq_with_error event class removed in kernel 4.12 */
175 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
176 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error,
177
178 TP_PROTO(struct request_queue *q, struct request *rq),
179
180 TP_ARGS(q, rq),
181
182 TP_locvar(
183 sector_t sector;
184 unsigned int nr_sector;
185 unsigned char *cmd;
186 size_t cmd_len;
187 ),
188
189 TP_code_pre(
190 if (blk_rq_is_scsi(rq)) {
191 struct scsi_request *scsi_rq = scsi_req(rq);
192 tp_locvar->sector = 0;
193 tp_locvar->nr_sector = 0;
194 tp_locvar->cmd = scsi_rq->cmd;
195 tp_locvar->cmd_len = scsi_rq->cmd_len;
196 } else {
197 tp_locvar->sector = blk_rq_pos(rq);
198 tp_locvar->nr_sector = blk_rq_sectors(rq);
199 tp_locvar->cmd = NULL;
200 tp_locvar->cmd_len = 0;
201 }
202 ),
203
204 TP_FIELDS(
205 ctf_integer(dev_t, dev,
206 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
207 ctf_integer(sector_t, sector, tp_locvar->sector)
208 ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector)
209 ctf_integer(int, errors, rq->errors)
210 blk_rwbs_ctf_integer(unsigned int, rwbs,
211 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
212 ctf_sequence_hex(unsigned char, cmd,
213 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
214 ),
215
216 TP_code_post()
217 )
218 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
219 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq_with_error,
220
221 TP_PROTO(struct request_queue *q, struct request *rq),
222
223 TP_ARGS(q, rq),
224
225 TP_locvar(
226 sector_t sector;
227 unsigned int nr_sector;
228 unsigned char *cmd;
229 size_t cmd_len;
230 ),
231
232 TP_code_pre(
233
234 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
235 tp_locvar->sector = 0;
236 tp_locvar->nr_sector = 0;
237 tp_locvar->cmd = rq->cmd;
238 tp_locvar->cmd_len = rq->cmd_len;
239 } else {
240 tp_locvar->sector = blk_rq_pos(rq);
241 tp_locvar->nr_sector = blk_rq_sectors(rq);
242 tp_locvar->cmd = NULL;
243 tp_locvar->cmd_len = 0;
244 }
245 ),
246
247 TP_FIELDS(
248 ctf_integer(dev_t, dev,
249 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
250 ctf_integer(sector_t, sector, tp_locvar->sector)
251 ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector)
252 ctf_integer(int, errors, rq->errors)
253 blk_rwbs_ctf_integer(unsigned int, rwbs,
254 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
255 ctf_sequence_hex(unsigned char, cmd,
256 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
257 ),
258
259 TP_code_post()
260 )
261 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
262
263 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,12,0))
264 /**
265 * block_rq_abort - abort block operation request
266 * @q: queue containing the block operation request
267 * @rq: block IO operation request
268 *
269 * Called immediately after pending block IO operation request @rq in
270 * queue @q is aborted. The fields in the operation request @rq
271 * can be examined to determine which device and sectors the pending
272 * operation would access.
273 */
274 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_abort,
275
276 TP_PROTO(struct request_queue *q, struct request *rq),
277
278 TP_ARGS(q, rq)
279 )
280 #endif
281
282 /**
283 * block_rq_requeue - place block IO request back on a queue
284 * @q: queue holding operation
285 * @rq: block IO operation request
286 *
287 * The block operation request @rq is being placed back into queue
288 * @q. For some reason the request was not completed and needs to be
289 * put back in the queue.
290 */
291 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
292 LTTNG_TRACEPOINT_EVENT(block_rq_requeue,
293
294 TP_PROTO(struct request_queue *q, struct request *rq),
295
296 TP_ARGS(q, rq),
297
298 TP_FIELDS(
299 ctf_integer(dev_t, dev,
300 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
301 ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
302 ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
303 blk_rwbs_ctf_integer(unsigned int, rwbs,
304 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
305 )
306 )
307 #else
308 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_requeue,
309
310 TP_PROTO(struct request_queue *q, struct request *rq),
311
312 TP_ARGS(q, rq)
313 )
314 #endif
315
316 /**
317 * block_rq_complete - block IO operation completed by device driver
318 * @q: queue containing the block operation request
319 * @rq: block operations request
320 * @nr_bytes: number of completed bytes
321 *
322 * The block_rq_complete tracepoint event indicates that some portion
323 * of operation request has been completed by the device driver. If
324 * the @rq->bio is %NULL, then there is absolutely no additional work to
325 * do for the request. If @rq->bio is non-NULL then there is
326 * additional work required to complete the request.
327 */
328 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
329 LTTNG_TRACEPOINT_EVENT(block_rq_complete,
330
331 TP_PROTO(struct request *rq, int error, unsigned int nr_bytes),
332
333 TP_ARGS(rq, error, nr_bytes),
334
335 TP_FIELDS(
336 ctf_integer(dev_t, dev,
337 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
338 ctf_integer(sector_t, sector, blk_rq_pos(rq))
339 ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
340 ctf_integer(int, error, error)
341 blk_rwbs_ctf_integer(unsigned int, rwbs,
342 lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
343 )
344 )
345 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
346 LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete,
347
348 TP_PROTO(struct request_queue *q, struct request *rq,
349 unsigned int nr_bytes),
350
351 TP_ARGS(q, rq, nr_bytes),
352
353 TP_locvar(
354 unsigned char *cmd;
355 size_t cmd_len;
356 ),
357
358 TP_code_pre(
359 if (blk_rq_is_scsi(rq)) {
360 struct scsi_request *scsi_rq = scsi_req(rq);
361 tp_locvar->cmd = scsi_rq->cmd;
362 tp_locvar->cmd_len = scsi_rq->cmd_len;
363 } else {
364 tp_locvar->cmd = NULL;
365 tp_locvar->cmd_len = 0;
366 }
367 ),
368
369 TP_FIELDS(
370 ctf_integer(dev_t, dev,
371 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
372 ctf_integer(sector_t, sector, blk_rq_pos(rq))
373 ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
374 ctf_integer(int, errors, rq->errors)
375 blk_rwbs_ctf_integer(unsigned int, rwbs,
376 lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
377 ctf_sequence_hex(unsigned char, cmd,
378 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
379 ),
380
381 TP_code_post()
382 )
383 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,5) \
384 || LTTNG_KERNEL_RANGE(3,12,21, 3,13,0) \
385 || LTTNG_KERNEL_RANGE(3,10,41, 3,11,0) \
386 || LTTNG_KERNEL_RANGE(3,4,91, 3,5,0) \
387 || LTTNG_KERNEL_RANGE(3,2,58, 3,3,0) \
388 || LTTNG_UBUNTU_KERNEL_RANGE(3,13,11,28, 3,14,0,0) \
389 || LTTNG_RHEL_KERNEL_RANGE(3,10,0,229,0,0, 3,11,0,0,0,0))
390
391 LTTNG_TRACEPOINT_EVENT_CODE(block_rq_complete,
392
393 TP_PROTO(struct request_queue *q, struct request *rq,
394 unsigned int nr_bytes),
395
396 TP_ARGS(q, rq, nr_bytes),
397
398 TP_locvar(
399 unsigned char *cmd;
400 size_t cmd_len;
401 ),
402
403 TP_code_pre(
404 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
405 tp_locvar->cmd = rq->cmd;
406 tp_locvar->cmd_len = rq->cmd_len;
407 } else {
408 tp_locvar->cmd = NULL;
409 tp_locvar->cmd_len = 0;
410 }
411 ),
412
413 TP_FIELDS(
414 ctf_integer(dev_t, dev,
415 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
416 ctf_integer(sector_t, sector, blk_rq_pos(rq))
417 ctf_integer(unsigned int, nr_sector, nr_bytes >> 9)
418 ctf_integer(int, errors, rq->errors)
419 blk_rwbs_ctf_integer(unsigned int, rwbs,
420 lttng_req_op(rq), lttng_req_rw(rq), nr_bytes)
421 ctf_sequence_hex(unsigned char, cmd,
422 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
423 ),
424
425 TP_code_post()
426 )
427
428 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
429
430 /**
431 * block_rq_complete - block IO operation completed by device driver
432 * @q: queue containing the block operation request
433 * @rq: block operations request
434 *
435 * The block_rq_complete tracepoint event indicates that some portion
436 * of operation request has been completed by the device driver. If
437 * the @rq->bio is %NULL, then there is absolutely no additional work to
438 * do for the request. If @rq->bio is non-NULL then there is
439 * additional work required to complete the request.
440 */
441 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq_with_error, block_rq_complete,
442
443 TP_PROTO(struct request_queue *q, struct request *rq),
444
445 TP_ARGS(q, rq)
446 )
447
448 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)) */
449
450 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0))
451 LTTNG_TRACEPOINT_EVENT_CLASS(block_rq,
452
453 TP_PROTO(struct request_queue *q, struct request *rq),
454
455 TP_ARGS(q, rq),
456
457 TP_FIELDS(
458 ctf_integer(dev_t, dev,
459 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
460 ctf_integer(sector_t, sector, blk_rq_trace_sector(rq))
461 ctf_integer(unsigned int, nr_sector, blk_rq_trace_nr_sectors(rq))
462 ctf_integer(unsigned int, bytes, blk_rq_bytes(rq))
463 ctf_integer(pid_t, tid, current->pid)
464 blk_rwbs_ctf_integer(unsigned int, rwbs,
465 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
466 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
467 )
468 )
469 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0))
470 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq,
471
472 TP_PROTO(struct request_queue *q, struct request *rq),
473
474 TP_ARGS(q, rq),
475
476 TP_locvar(
477 sector_t sector;
478 unsigned int nr_sector;
479 unsigned int bytes;
480 unsigned char *cmd;
481 size_t cmd_len;
482 ),
483
484 TP_code_pre(
485 if (blk_rq_is_scsi(rq)) {
486 struct scsi_request *scsi_rq = scsi_req(rq);
487 tp_locvar->sector = 0;
488 tp_locvar->nr_sector = 0;
489 tp_locvar->bytes = scsi_rq->resid_len;
490 tp_locvar->cmd = scsi_rq->cmd;
491 tp_locvar->cmd_len = scsi_rq->cmd_len;
492 } else {
493 tp_locvar->sector = blk_rq_pos(rq);
494 tp_locvar->nr_sector = blk_rq_sectors(rq);
495 tp_locvar->bytes = 0;
496 tp_locvar->cmd = NULL;
497 tp_locvar->cmd_len = 0;
498 }
499 ),
500
501 TP_FIELDS(
502 ctf_integer(dev_t, dev,
503 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
504 ctf_integer(sector_t, sector, tp_locvar->sector)
505 ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector)
506 ctf_integer(unsigned int, bytes, tp_locvar->bytes)
507 ctf_integer(pid_t, tid, current->pid)
508 blk_rwbs_ctf_integer(unsigned int, rwbs,
509 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
510 ctf_sequence_hex(unsigned char, cmd,
511 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
512 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
513 ),
514
515 TP_code_post()
516 )
517 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
518 LTTNG_TRACEPOINT_EVENT_CLASS_CODE(block_rq,
519
520 TP_PROTO(struct request_queue *q, struct request *rq),
521
522 TP_ARGS(q, rq),
523
524 TP_locvar(
525 sector_t sector;
526 unsigned int nr_sector;
527 unsigned int bytes;
528 unsigned char *cmd;
529 size_t cmd_len;
530 ),
531
532 TP_code_pre(
533 if (rq->cmd_type == REQ_TYPE_BLOCK_PC) {
534 tp_locvar->sector = 0;
535 tp_locvar->nr_sector = 0;
536 tp_locvar->bytes = blk_rq_bytes(rq);
537 tp_locvar->cmd = rq->cmd;
538 tp_locvar->cmd_len = rq->cmd_len;
539 } else {
540 tp_locvar->sector = blk_rq_pos(rq);
541 tp_locvar->nr_sector = blk_rq_sectors(rq);
542 tp_locvar->bytes = 0;
543 tp_locvar->cmd = NULL;
544 tp_locvar->cmd_len = 0;
545 }
546 ),
547
548 TP_FIELDS(
549 ctf_integer(dev_t, dev,
550 rq->rq_disk ? disk_devt(rq->rq_disk) : 0)
551 ctf_integer(sector_t, sector, tp_locvar->sector)
552 ctf_integer(unsigned int, nr_sector, tp_locvar->nr_sector)
553 ctf_integer(unsigned int, bytes, tp_locvar->bytes)
554 ctf_integer(pid_t, tid, current->pid)
555 blk_rwbs_ctf_integer(unsigned int, rwbs,
556 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
557 ctf_sequence_hex(unsigned char, cmd,
558 tp_locvar->cmd, size_t, tp_locvar->cmd_len)
559 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
560 ),
561
562 TP_code_post()
563 )
564 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
565
566 /**
567 * block_rq_insert - insert block operation request into queue
568 * @q: target queue
569 * @rq: block IO operation request
570 *
571 * Called immediately before block operation request @rq is inserted
572 * into queue @q. The fields in the operation request @rq struct can
573 * be examined to determine which device and sectors the pending
574 * operation would access.
575 */
576 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_insert,
577
578 TP_PROTO(struct request_queue *q, struct request *rq),
579
580 TP_ARGS(q, rq)
581 )
582
583 /**
584 * block_rq_issue - issue pending block IO request operation to device driver
585 * @q: queue holding operation
586 * @rq: block IO operation operation request
587 *
588 * Called when block operation request @rq from queue @q is sent to a
589 * device driver for processing.
590 */
591 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_rq, block_rq_issue,
592
593 TP_PROTO(struct request_queue *q, struct request *rq),
594
595 TP_ARGS(q, rq)
596 )
597
598 /**
599 * block_bio_bounce - used bounce buffer when processing block operation
600 * @q: queue holding the block operation
601 * @bio: block operation
602 *
603 * A bounce buffer was used to handle the block operation @bio in @q.
604 * This occurs when hardware limitations prevent a direct transfer of
605 * data between the @bio data memory area and the IO device. Use of a
606 * bounce buffer requires extra copying of data and decreases
607 * performance.
608 */
609 LTTNG_TRACEPOINT_EVENT(block_bio_bounce,
610
611 TP_PROTO(struct request_queue *q, struct bio *bio),
612
613 TP_ARGS(q, bio),
614
615 TP_FIELDS(
616 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
617 ctf_integer(dev_t, dev, bio_dev(bio))
618 #else
619 ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
620 #endif
621 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
622 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
623 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
624 blk_rwbs_ctf_integer(unsigned int, rwbs,
625 lttng_bio_op(bio), lttng_bio_rw(bio),
626 bio->bi_iter.bi_size)
627 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
628 ctf_integer(sector_t, sector, bio->bi_sector)
629 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
630 blk_rwbs_ctf_integer(unsigned int, rwbs,
631 lttng_bio_op(bio), lttng_bio_rw(bio),
632 bio->bi_size)
633 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
634 ctf_integer(pid_t, tid, current->pid)
635 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
636 )
637 )
638
639 /**
640 * block_bio_complete - completed all work on the block operation
641 * @q: queue holding the block operation
642 * @bio: block operation completed
643 * @error: io error value
644 *
645 * This tracepoint indicates there is no further work to do on this
646 * block IO operation @bio.
647 */
648 LTTNG_TRACEPOINT_EVENT(block_bio_complete,
649
650 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
651 TP_PROTO(struct request_queue *q, struct bio *bio, int error),
652
653 TP_ARGS(q, bio, error),
654 #else
655 TP_PROTO(struct request_queue *q, struct bio *bio),
656
657 TP_ARGS(q, bio),
658 #endif
659
660 TP_FIELDS(
661 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
662 ctf_integer(dev_t, dev, bio_dev(bio))
663 #else
664 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
665 #endif
666 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
667 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
668 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
669 ctf_integer(int, error, error)
670 blk_rwbs_ctf_integer(unsigned int, rwbs,
671 lttng_bio_op(bio), lttng_bio_rw(bio),
672 bio->bi_iter.bi_size)
673 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
674 ctf_integer(sector_t, sector, bio->bi_sector)
675 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
676 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
677 ctf_integer(int, error, error)
678 #else
679 ctf_integer(int, error, 0)
680 #endif
681 blk_rwbs_ctf_integer(unsigned int, rwbs,
682 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
683 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
684 )
685 )
686
687 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
688 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio_merge,
689
690 TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
691
692 TP_ARGS(q, rq, bio),
693
694 TP_FIELDS(
695 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
696 ctf_integer(dev_t, dev, bio_dev(bio))
697 #else
698 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
699 #endif
700 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
701 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
702 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
703 blk_rwbs_ctf_integer(unsigned int, rwbs,
704 lttng_bio_op(bio), lttng_bio_rw(bio),
705 bio->bi_iter.bi_size)
706 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
707 ctf_integer(sector_t, sector, bio->bi_sector)
708 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
709 blk_rwbs_ctf_integer(unsigned int, rwbs,
710 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
711 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
712 ctf_integer(pid_t, tid, current->pid)
713 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
714 )
715 )
716
717 /**
718 * block_bio_backmerge - merging block operation to the end of an existing operation
719 * @q: queue holding operation
720 * @bio: new block operation to merge
721 *
722 * Merging block request @bio to the end of an existing block request
723 * in queue @q.
724 */
725 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_backmerge,
726
727 TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
728
729 TP_ARGS(q, rq, bio)
730 )
731
732 /**
733 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
734 * @q: queue holding operation
735 * @bio: new block operation to merge
736 *
737 * Merging block IO operation @bio to the beginning of an existing block
738 * operation in queue @q.
739 */
740 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio_merge, block_bio_frontmerge,
741
742 TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio),
743
744 TP_ARGS(q, rq, bio)
745 )
746
747 /**
748 * block_bio_queue - putting new block IO operation in queue
749 * @q: queue holding operation
750 * @bio: new block operation
751 *
752 * About to place the block IO operation @bio into queue @q.
753 */
754 LTTNG_TRACEPOINT_EVENT(block_bio_queue,
755
756 TP_PROTO(struct request_queue *q, struct bio *bio),
757
758 TP_ARGS(q, bio),
759
760 TP_FIELDS(
761 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
762 ctf_integer(dev_t, dev, bio_dev(bio))
763 #else
764 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
765 #endif
766 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
767 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
768 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
769 blk_rwbs_ctf_integer(unsigned int, rwbs,
770 lttng_bio_op(bio), lttng_bio_rw(bio),
771 bio->bi_iter.bi_size)
772 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
773 ctf_integer(sector_t, sector, bio->bi_sector)
774 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
775 blk_rwbs_ctf_integer(unsigned int, rwbs,
776 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
777 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
778 ctf_integer(pid_t, tid, current->pid)
779 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
780 )
781 )
782 #else /* if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */
783 LTTNG_TRACEPOINT_EVENT_CLASS(block_bio,
784
785 TP_PROTO(struct request_queue *q, struct bio *bio),
786
787 TP_ARGS(q, bio),
788
789 TP_FIELDS(
790 ctf_integer(dev_t, dev, bio->bi_bdev ? bio->bi_bdev->bd_dev : 0)
791 ctf_integer(sector_t, sector, bio->bi_sector)
792 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
793 blk_rwbs_ctf_integer(unsigned int, rwbs,
794 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
795 ctf_integer(pid_t, tid, current->pid)
796 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
797 )
798 )
799
800 /**
801 * block_bio_backmerge - merging block operation to the end of an existing operation
802 * @q: queue holding operation
803 * @bio: new block operation to merge
804 *
805 * Merging block request @bio to the end of an existing block request
806 * in queue @q.
807 */
808 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_backmerge,
809
810 TP_PROTO(struct request_queue *q, struct bio *bio),
811
812 TP_ARGS(q, bio)
813 )
814
815 /**
816 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
817 * @q: queue holding operation
818 * @bio: new block operation to merge
819 *
820 * Merging block IO operation @bio to the beginning of an existing block
821 * operation in queue @q.
822 */
823 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_frontmerge,
824
825 TP_PROTO(struct request_queue *q, struct bio *bio),
826
827 TP_ARGS(q, bio)
828 )
829
830 /**
831 * block_bio_queue - putting new block IO operation in queue
832 * @q: queue holding operation
833 * @bio: new block operation
834 *
835 * About to place the block IO operation @bio into queue @q.
836 */
837 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_bio, block_bio_queue,
838
839 TP_PROTO(struct request_queue *q, struct bio *bio),
840
841 TP_ARGS(q, bio)
842 )
843 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0)) */
844
845 LTTNG_TRACEPOINT_EVENT_CLASS(block_get_rq,
846
847 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
848
849 TP_ARGS(q, bio, rw),
850
851 TP_FIELDS(
852 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
853 ctf_integer(dev_t, dev, bio ? bio_dev(bio) : 0)
854 #else
855 ctf_integer(dev_t, dev, bio ? bio->bi_bdev->bd_dev : 0)
856 #endif
857 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
858 ctf_integer(sector_t, sector, bio ? bio->bi_iter.bi_sector : 0)
859 ctf_integer(unsigned int, nr_sector,
860 bio ? bio_sectors(bio) : 0)
861 blk_rwbs_ctf_integer(unsigned int, rwbs,
862 bio ? lttng_bio_op(bio) : 0,
863 bio ? lttng_bio_rw(bio) : 0,
864 bio ? bio->bi_iter.bi_size : 0)
865 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
866 ctf_integer(sector_t, sector, bio ? bio->bi_sector : 0)
867 ctf_integer(unsigned int, nr_sector,
868 bio ? bio->bi_size >> 9 : 0)
869 blk_rwbs_ctf_integer(unsigned int, rwbs,
870 bio ? lttng_bio_op(bio) : 0,
871 bio ? lttng_bio_rw(bio) : 0,
872 bio ? bio->bi_size : 0)
873 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
874 ctf_integer(pid_t, tid, current->pid)
875 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
876 )
877 )
878
879 /**
880 * block_getrq - get a free request entry in queue for block IO operations
881 * @q: queue for operations
882 * @bio: pending block IO operation (can be %NULL)
883 * @rw: low bit indicates a read (%0) or a write (%1)
884 *
885 * A request struct for queue @q has been allocated to handle the
886 * block IO operation @bio.
887 */
888 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq, block_getrq,
889
890 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
891
892 TP_ARGS(q, bio, rw)
893 )
894
895 /**
896 * block_sleeprq - waiting to get a free request entry in queue for block IO operation
897 * @q: queue for operation
898 * @bio: pending block IO operation (can be %NULL)
899 * @rw: low bit indicates a read (%0) or a write (%1)
900 *
901 * In the case where a request struct cannot be provided for queue @q
902 * the process needs to wait for an request struct to become
903 * available. This tracepoint event is generated each time the
904 * process goes to sleep waiting for request struct become available.
905 */
906 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_get_rq, block_sleeprq,
907
908 TP_PROTO(struct request_queue *q, struct bio *bio, int rw),
909
910 TP_ARGS(q, bio, rw)
911 )
912
913 /**
914 * block_plug - keep operations requests in request queue
915 * @q: request queue to plug
916 *
917 * Plug the request queue @q. Do not allow block operation requests
918 * to be sent to the device driver. Instead, accumulate requests in
919 * the queue to improve throughput performance of the block device.
920 */
921 LTTNG_TRACEPOINT_EVENT(block_plug,
922
923 TP_PROTO(struct request_queue *q),
924
925 TP_ARGS(q),
926
927 TP_FIELDS(
928 ctf_integer(pid_t, tid, current->pid)
929 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
930 )
931 )
932
933 LTTNG_TRACEPOINT_EVENT_CLASS(block_unplug,
934
935 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
936 TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
937
938 TP_ARGS(q, depth, explicit),
939 #else
940 TP_PROTO(struct request_queue *q),
941
942 TP_ARGS(q),
943 #endif
944
945 TP_FIELDS(
946 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
947 ctf_integer(int, nr_rq, depth)
948 #else
949 ctf_integer(int, nr_rq, q->rq.count[READ] + q->rq.count[WRITE])
950 #endif
951 ctf_integer(pid_t, tid, current->pid)
952 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
953 )
954 )
955
956 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
957 /**
958 * block_unplug_timer - timed release of operations requests in queue to device driver
959 * @q: request queue to unplug
960 *
961 * Unplug the request queue @q because a timer expired and allow block
962 * operation requests to be sent to the device driver.
963 */
964 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_unplug, block_unplug_timer,
965
966 TP_PROTO(struct request_queue *q),
967
968 TP_ARGS(q)
969 )
970 #endif
971
972 /**
973 * block_unplug - release of operations requests in request queue
974 * @q: request queue to unplug
975 * @depth: number of requests just added to the queue
976 * @explicit: whether this was an explicit unplug, or one from schedule()
977 *
978 * Unplug request queue @q because device driver is scheduled to work
979 * on elements in the request queue.
980 */
981 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
982 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_unplug, block_unplug,
983 #else
984 LTTNG_TRACEPOINT_EVENT_INSTANCE(block_unplug, block_unplug_io,
985 #endif
986
987 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
988 TP_PROTO(struct request_queue *q, unsigned int depth, bool explicit),
989
990 TP_ARGS(q, depth, explicit)
991 #else
992 TP_PROTO(struct request_queue *q),
993
994 TP_ARGS(q)
995 #endif
996 )
997
998 /**
999 * block_split - split a single bio struct into two bio structs
1000 * @q: queue containing the bio
1001 * @bio: block operation being split
1002 * @new_sector: The starting sector for the new bio
1003 *
1004 * The bio request @bio in request queue @q needs to be split into two
1005 * bio requests. The newly created @bio request starts at
1006 * @new_sector. This split may be required due to hardware limitation
1007 * such as operation crossing device boundaries in a RAID system.
1008 */
1009 LTTNG_TRACEPOINT_EVENT(block_split,
1010
1011 TP_PROTO(struct request_queue *q, struct bio *bio,
1012 unsigned int new_sector),
1013
1014 TP_ARGS(q, bio, new_sector),
1015
1016 TP_FIELDS(
1017 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1018 ctf_integer(dev_t, dev, bio_dev(bio))
1019 #else
1020 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1021 #endif
1022 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
1023 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1024 blk_rwbs_ctf_integer(unsigned int, rwbs,
1025 lttng_bio_op(bio), lttng_bio_rw(bio),
1026 bio->bi_iter.bi_size)
1027 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
1028 ctf_integer(sector_t, sector, bio->bi_sector)
1029 blk_rwbs_ctf_integer(unsigned int, rwbs,
1030 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
1031 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
1032 ctf_integer(sector_t, new_sector, new_sector)
1033 ctf_integer(pid_t, tid, current->pid)
1034 ctf_array_text(char, comm, current->comm, TASK_COMM_LEN)
1035 )
1036 )
1037
1038 /**
1039 * block_bio_remap - map request for a logical device to the raw device
1040 * @q: queue holding the operation
1041 * @bio: revised operation
1042 * @dev: device for the operation
1043 * @from: original sector for the operation
1044 *
1045 * An operation for a logical device has been mapped to the
1046 * raw block device.
1047 */
1048 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
1049 LTTNG_TRACEPOINT_EVENT(block_bio_remap,
1050 #else
1051 LTTNG_TRACEPOINT_EVENT(block_remap,
1052 #endif
1053
1054 TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev,
1055 sector_t from),
1056
1057 TP_ARGS(q, bio, dev, from),
1058
1059 TP_FIELDS(
1060 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,14,0))
1061 ctf_integer(dev_t, dev, bio_dev(bio))
1062 #else
1063 ctf_integer(dev_t, dev, bio->bi_bdev->bd_dev)
1064 #endif
1065 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0))
1066 ctf_integer(sector_t, sector, bio->bi_iter.bi_sector)
1067 ctf_integer(unsigned int, nr_sector, bio_sectors(bio))
1068 blk_rwbs_ctf_integer(unsigned int, rwbs,
1069 lttng_bio_op(bio), lttng_bio_rw(bio),
1070 bio->bi_iter.bi_size)
1071 #else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
1072 ctf_integer(sector_t, sector, bio->bi_sector)
1073 ctf_integer(unsigned int, nr_sector, bio->bi_size >> 9)
1074 blk_rwbs_ctf_integer(unsigned int, rwbs,
1075 lttng_bio_op(bio), lttng_bio_rw(bio), bio->bi_size)
1076 #endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)) */
1077 ctf_integer(dev_t, old_dev, dev)
1078 ctf_integer(sector_t, old_sector, from)
1079 )
1080 )
1081
1082 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
1083 /**
1084 * block_rq_remap - map request for a block operation request
1085 * @q: queue holding the operation
1086 * @rq: block IO operation request
1087 * @dev: device for the operation
1088 * @from: original sector for the operation
1089 *
1090 * The block operation request @rq in @q has been remapped. The block
1091 * operation request @rq holds the current information and @from hold
1092 * the original sector.
1093 */
1094 LTTNG_TRACEPOINT_EVENT(block_rq_remap,
1095
1096 TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev,
1097 sector_t from),
1098
1099 TP_ARGS(q, rq, dev, from),
1100
1101 TP_FIELDS(
1102 ctf_integer(dev_t, dev, disk_devt(rq->rq_disk))
1103 ctf_integer(sector_t, sector, blk_rq_pos(rq))
1104 ctf_integer(unsigned int, nr_sector, blk_rq_sectors(rq))
1105 ctf_integer(dev_t, old_dev, dev)
1106 ctf_integer(sector_t, old_sector, from)
1107 blk_rwbs_ctf_integer(unsigned int, rwbs,
1108 lttng_req_op(rq), lttng_req_rw(rq), blk_rq_bytes(rq))
1109 )
1110 )
1111 #endif
1112
1113 #undef __print_rwbs_flags
1114 #undef blk_fill_rwbs
1115
1116 #endif /* LTTNG_TRACE_BLOCK_H */
1117
1118 /* This part must be outside protection */
1119 #include <probes/define_trace.h>
This page took 0.061853 seconds and 3 git commands to generate.