2 #define TRACE_SYSTEM block
4 #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/blktrace_api.h>
8 #include <linux/blkdev.h>
9 #include <linux/tracepoint.h>
10 #include <linux/trace_seq.h>
11 #include <linux/version.h>
15 #ifndef _TRACE_BLOCK_DEF_
16 #define _TRACE_BLOCK_DEF_
18 #define __blk_dump_cmd(cmd, len) "<unknown>"
21 RWBS_FLAG_WRITE
= (1 << 0),
22 RWBS_FLAG_DISCARD
= (1 << 1),
23 RWBS_FLAG_READ
= (1 << 2),
24 RWBS_FLAG_RAHEAD
= (1 << 3),
25 RWBS_FLAG_BARRIER
= (1 << 4),
26 RWBS_FLAG_SYNC
= (1 << 5),
27 RWBS_FLAG_META
= (1 << 6),
28 RWBS_FLAG_SECURE
= (1 << 7),
29 RWBS_FLAG_FLUSH
= (1 << 8),
30 RWBS_FLAG_FUA
= (1 << 9),
33 #endif /* _TRACE_BLOCK_DEF_ */
35 #define __print_rwbs_flags(rwbs) \
36 __print_flags(rwbs, "", \
37 { RWBS_FLAG_FLUSH, "F" }, \
38 { RWBS_FLAG_WRITE, "W" }, \
39 { RWBS_FLAG_DISCARD, "D" }, \
40 { RWBS_FLAG_READ, "R" }, \
41 { RWBS_FLAG_FUA, "F" }, \
42 { RWBS_FLAG_RAHEAD, "A" }, \
43 { RWBS_FLAG_BARRIER, "B" }, \
44 { RWBS_FLAG_SYNC, "S" }, \
45 { RWBS_FLAG_META, "M" }, \
46 { RWBS_FLAG_SECURE, "E" })
48 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
50 #define blk_fill_rwbs(rwbs, rw, bytes) \
51 tp_assign(rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
52 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
53 ( (bytes) ? RWBS_FLAG_READ : \
55 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
56 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
57 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
58 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0) \
59 | ((rw) & REQ_FLUSH ? RWBS_FLAG_FLUSH : 0) \
60 | ((rw) & REQ_FUA ? RWBS_FLAG_FUA : 0))
62 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
64 #define blk_fill_rwbs(rwbs, rw, bytes) \
65 tp_assign(rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
66 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
67 ( (bytes) ? RWBS_FLAG_READ : \
69 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
70 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
71 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
72 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0))
74 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
76 #define blk_fill_rwbs(rwbs, rw, bytes) \
77 tp_assign(rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
78 ( (rw) & REQ_DISCARD ? RWBS_FLAG_DISCARD : \
79 ( (bytes) ? RWBS_FLAG_READ : \
81 | ((rw) & REQ_RAHEAD ? RWBS_FLAG_RAHEAD : 0) \
82 | ((rw) & REQ_HARDBARRIER ? RWBS_FLAG_BARRIER : 0) \
83 | ((rw) & REQ_SYNC ? RWBS_FLAG_SYNC : 0) \
84 | ((rw) & REQ_META ? RWBS_FLAG_META : 0) \
85 | ((rw) & REQ_SECURE ? RWBS_FLAG_SECURE : 0))
89 #define blk_fill_rwbs(rwbs, rw, bytes) \
90 tp_assign(rwbs, ((rw) & WRITE ? RWBS_FLAG_WRITE : \
91 ( (rw) & (1 << BIO_RW_DISCARD) ? RWBS_FLAG_DISCARD : \
92 ( (bytes) ? RWBS_FLAG_READ : \
94 | ((rw) & (1 << BIO_RW_AHEAD) ? RWBS_FLAG_RAHEAD : 0) \
95 | ((rw) & (1 << BIO_RW_SYNCIO) ? RWBS_FLAG_SYNC : 0) \
96 | ((rw) & (1 << BIO_RW_META) ? RWBS_FLAG_META : 0) \
97 | ((rw) & (1 << BIO_RW_BARRIER) ? RWBS_FLAG_BARRIER : 0))
101 DECLARE_EVENT_CLASS(block_rq_with_error
,
103 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
108 __field( dev_t
, dev
)
109 __field( sector_t
, sector
)
110 __field( unsigned int, nr_sector
)
111 __field( int, errors
)
112 __field( unsigned int, rwbs
)
113 __dynamic_array_hex( unsigned char, cmd
,
114 (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
119 tp_assign(dev
, rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
120 tp_assign(sector
, (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
122 tp_assign(nr_sector
, (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
123 0 : blk_rq_sectors(rq
))
124 tp_assign(errors
, rq
->errors
)
125 blk_fill_rwbs(rwbs
, rq
->cmd_flags
, blk_rq_bytes(rq
))
126 tp_memcpy_dyn(cmd
, (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
130 TP_printk("%d,%d %s (%s) %llu + %u [%d]",
131 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
132 __print_rwbs_flags(__entry
->rwbs
),
133 __blk_dump_cmd(__get_dynamic_array(cmd
),
134 __get_dynamic_array_len(cmd
)),
135 (unsigned long long)__entry
->sector
,
136 __entry
->nr_sector
, __entry
->errors
)
140 * block_rq_abort - abort block operation request
141 * @q: queue containing the block operation request
142 * @rq: block IO operation request
144 * Called immediately after pending block IO operation request @rq in
145 * queue @q is aborted. The fields in the operation request @rq
146 * can be examined to determine which device and sectors the pending
147 * operation would access.
149 DEFINE_EVENT(block_rq_with_error
, block_rq_abort
,
151 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
157 * block_rq_requeue - place block IO request back on a queue
158 * @q: queue holding operation
159 * @rq: block IO operation request
161 * The block operation request @rq is being placed back into queue
162 * @q. For some reason the request was not completed and needs to be
163 * put back in the queue.
165 DEFINE_EVENT(block_rq_with_error
, block_rq_requeue
,
167 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
173 * block_rq_complete - block IO operation completed by device driver
174 * @q: queue containing the block operation request
175 * @rq: block operations request
177 * The block_rq_complete tracepoint event indicates that some portion
178 * of operation request has been completed by the device driver. If
179 * the @rq->bio is %NULL, then there is absolutely no additional work to
180 * do for the request. If @rq->bio is non-NULL then there is
181 * additional work required to complete the request.
183 DEFINE_EVENT(block_rq_with_error
, block_rq_complete
,
185 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
190 DECLARE_EVENT_CLASS(block_rq
,
192 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
197 __field( dev_t
, dev
)
198 __field( sector_t
, sector
)
199 __field( unsigned int, nr_sector
)
200 __field( unsigned int, bytes
)
201 __field( unsigned int, rwbs
)
202 __array_text( char, comm
, TASK_COMM_LEN
)
203 __dynamic_array_hex( unsigned char, cmd
,
204 (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
209 tp_assign(dev
, rq
->rq_disk
? disk_devt(rq
->rq_disk
) : 0)
210 tp_assign(sector
, (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
212 tp_assign(nr_sector
, (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
213 0 : blk_rq_sectors(rq
))
214 tp_assign(bytes
, (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
215 blk_rq_bytes(rq
) : 0)
216 blk_fill_rwbs(rwbs
, rq
->cmd_flags
, blk_rq_bytes(rq
))
217 tp_memcpy_dyn(cmd
, (rq
->cmd_type
== REQ_TYPE_BLOCK_PC
) ?
219 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
222 TP_printk("%d,%d %s %u (%s) %llu + %u [%s]",
223 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
224 __print_rwbs_flags(__entry
->rwbs
),
226 __blk_dump_cmd(__get_dynamic_array(cmd
),
227 __get_dynamic_array_len(cmd
)),
228 (unsigned long long)__entry
->sector
,
229 __entry
->nr_sector
, __entry
->comm
)
233 * block_rq_insert - insert block operation request into queue
235 * @rq: block IO operation request
237 * Called immediately before block operation request @rq is inserted
238 * into queue @q. The fields in the operation request @rq struct can
239 * be examined to determine which device and sectors the pending
240 * operation would access.
242 DEFINE_EVENT(block_rq
, block_rq_insert
,
244 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
250 * block_rq_issue - issue pending block IO request operation to device driver
251 * @q: queue holding operation
252 * @rq: block IO operation operation request
254 * Called when block operation request @rq from queue @q is sent to a
255 * device driver for processing.
257 DEFINE_EVENT(block_rq
, block_rq_issue
,
259 TP_PROTO(struct request_queue
*q
, struct request
*rq
),
265 * block_bio_bounce - used bounce buffer when processing block operation
266 * @q: queue holding the block operation
267 * @bio: block operation
269 * A bounce buffer was used to handle the block operation @bio in @q.
270 * This occurs when hardware limitations prevent a direct transfer of
271 * data between the @bio data memory area and the IO device. Use of a
272 * bounce buffer requires extra copying of data and decreases
275 TRACE_EVENT(block_bio_bounce
,
277 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
282 __field( dev_t
, dev
)
283 __field( sector_t
, sector
)
284 __field( unsigned int, nr_sector
)
285 __field( unsigned int, rwbs
)
286 __array_text( char, comm
, TASK_COMM_LEN
)
290 tp_assign(dev
, bio
->bi_bdev
?
291 bio
->bi_bdev
->bd_dev
: 0)
292 tp_assign(sector
, bio
->bi_sector
)
293 tp_assign(nr_sector
, bio
->bi_size
>> 9)
294 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
295 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
298 TP_printk("%d,%d %s %llu + %u [%s]",
299 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
300 __print_rwbs_flags(__entry
->rwbs
),
301 (unsigned long long)__entry
->sector
,
302 __entry
->nr_sector
, __entry
->comm
)
306 * block_bio_complete - completed all work on the block operation
307 * @q: queue holding the block operation
308 * @bio: block operation completed
309 * @error: io error value
311 * This tracepoint indicates there is no further work to do on this
312 * block IO operation @bio.
314 TRACE_EVENT(block_bio_complete
,
316 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
317 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int error
),
319 TP_ARGS(q
, bio
, error
),
321 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
327 __field( dev_t
, dev
)
328 __field( sector_t
, sector
)
329 __field( unsigned, nr_sector
)
330 __field( int, error
)
331 __field( unsigned int, rwbs
)
335 tp_assign(dev
, bio
->bi_bdev
->bd_dev
)
336 tp_assign(sector
, bio
->bi_sector
)
337 tp_assign(nr_sector
, bio
->bi_size
>> 9)
338 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
339 tp_assign(error
, error
)
343 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
346 TP_printk("%d,%d %s %llu + %u [%d]",
347 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
348 __print_rwbs_flags(__entry
->rwbs
),
349 (unsigned long long)__entry
->sector
,
350 __entry
->nr_sector
, __entry
->error
)
353 DECLARE_EVENT_CLASS(block_bio
,
355 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
360 __field( dev_t
, dev
)
361 __field( sector_t
, sector
)
362 __field( unsigned int, nr_sector
)
363 __field( unsigned int, rwbs
)
364 __array_text( char, comm
, TASK_COMM_LEN
)
368 tp_assign(dev
, bio
->bi_bdev
->bd_dev
)
369 tp_assign(sector
, bio
->bi_sector
)
370 tp_assign(nr_sector
, bio
->bi_size
>> 9)
371 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
372 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
375 TP_printk("%d,%d %s %llu + %u [%s]",
376 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
377 __print_rwbs_flags(__entry
->rwbs
),
378 (unsigned long long)__entry
->sector
,
379 __entry
->nr_sector
, __entry
->comm
)
383 * block_bio_backmerge - merging block operation to the end of an existing operation
384 * @q: queue holding operation
385 * @bio: new block operation to merge
387 * Merging block request @bio to the end of an existing block request
390 DEFINE_EVENT(block_bio
, block_bio_backmerge
,
392 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
393 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
397 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
404 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
405 * @q: queue holding operation
406 * @bio: new block operation to merge
408 * Merging block IO operation @bio to the beginning of an existing block
409 * operation in queue @q.
411 DEFINE_EVENT(block_bio
, block_bio_frontmerge
,
413 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
414 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
418 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
425 * block_bio_queue - putting new block IO operation in queue
426 * @q: queue holding operation
427 * @bio: new block operation
429 * About to place the block IO operation @bio into queue @q.
431 DEFINE_EVENT(block_bio
, block_bio_queue
,
433 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
438 DECLARE_EVENT_CLASS(block_get_rq
,
440 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
445 __field( dev_t
, dev
)
446 __field( sector_t
, sector
)
447 __field( unsigned int, nr_sector
)
448 __field( unsigned int, rwbs
)
449 __array_text( char, comm
, TASK_COMM_LEN
)
453 tp_assign(dev
, bio
? bio
->bi_bdev
->bd_dev
: 0)
454 tp_assign(sector
, bio
? bio
->bi_sector
: 0)
455 tp_assign(nr_sector
, bio
? bio
->bi_size
>> 9 : 0)
456 blk_fill_rwbs(rwbs
, bio
? bio
->bi_rw
: 0,
457 bio
? bio
->bi_size
>> 9 : 0)
458 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
461 TP_printk("%d,%d %s %llu + %u [%s]",
462 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
463 __print_rwbs_flags(__entry
->rwbs
),
464 (unsigned long long)__entry
->sector
,
465 __entry
->nr_sector
, __entry
->comm
)
469 * block_getrq - get a free request entry in queue for block IO operations
470 * @q: queue for operations
471 * @bio: pending block IO operation
472 * @rw: low bit indicates a read (%0) or a write (%1)
474 * A request struct for queue @q has been allocated to handle the
475 * block IO operation @bio.
477 DEFINE_EVENT(block_get_rq
, block_getrq
,
479 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
485 * block_sleeprq - waiting to get a free request entry in queue for block IO operation
486 * @q: queue for operation
487 * @bio: pending block IO operation
488 * @rw: low bit indicates a read (%0) or a write (%1)
490 * In the case where a request struct cannot be provided for queue @q
491 * the process needs to wait for an request struct to become
492 * available. This tracepoint event is generated each time the
493 * process goes to sleep waiting for request struct become available.
495 DEFINE_EVENT(block_get_rq
, block_sleeprq
,
497 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
503 * block_plug - keep operations requests in request queue
504 * @q: request queue to plug
506 * Plug the request queue @q. Do not allow block operation requests
507 * to be sent to the device driver. Instead, accumulate requests in
508 * the queue to improve throughput performance of the block device.
510 TRACE_EVENT(block_plug
,
512 TP_PROTO(struct request_queue
*q
),
517 __array_text( char, comm
, TASK_COMM_LEN
)
521 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
524 TP_printk("[%s]", __entry
->comm
)
527 DECLARE_EVENT_CLASS(block_unplug
,
529 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
530 TP_PROTO(struct request_queue
*q
, unsigned int depth
, bool explicit),
532 TP_ARGS(q
, depth
, explicit),
534 TP_PROTO(struct request_queue
*q
),
540 __field( int, nr_rq
)
541 __array_text( char, comm
, TASK_COMM_LEN
)
545 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
546 tp_assign(nr_rq
, depth
)
548 tp_assign(nr_rq
, q
->rq
.count
[READ
] + q
->rq
.count
[WRITE
])
550 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
553 TP_printk("[%s] %d", __entry
->comm
, __entry
->nr_rq
)
556 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
558 * block_unplug_timer - timed release of operations requests in queue to device driver
559 * @q: request queue to unplug
561 * Unplug the request queue @q because a timer expired and allow block
562 * operation requests to be sent to the device driver.
564 DEFINE_EVENT(block_unplug
, block_unplug_timer
,
566 TP_PROTO(struct request_queue
*q
),
573 * block_unplug - release of operations requests in request queue
574 * @q: request queue to unplug
575 * @depth: number of requests just added to the queue
576 * @explicit: whether this was an explicit unplug, or one from schedule()
578 * Unplug request queue @q because device driver is scheduled to work
579 * on elements in the request queue.
581 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
582 DEFINE_EVENT(block_unplug
, block_unplug
,
584 DEFINE_EVENT(block_unplug
, block_unplug_io
,
587 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
588 TP_PROTO(struct request_queue
*q
, unsigned int depth
, bool explicit),
590 TP_ARGS(q
, depth
, explicit)
592 TP_PROTO(struct request_queue
*q
),
599 * block_split - split a single bio struct into two bio structs
600 * @q: queue containing the bio
601 * @bio: block operation being split
602 * @new_sector: The starting sector for the new bio
604 * The bio request @bio in request queue @q needs to be split into two
605 * bio requests. The newly created @bio request starts at
606 * @new_sector. This split may be required due to hardware limitation
607 * such as operation crossing device boundaries in a RAID system.
609 TRACE_EVENT(block_split
,
611 TP_PROTO(struct request_queue
*q
, struct bio
*bio
,
612 unsigned int new_sector
),
614 TP_ARGS(q
, bio
, new_sector
),
617 __field( dev_t
, dev
)
618 __field( sector_t
, sector
)
619 __field( sector_t
, new_sector
)
620 __field( unsigned int, rwbs
)
621 __array_text( char, comm
, TASK_COMM_LEN
)
625 tp_assign(dev
, bio
->bi_bdev
->bd_dev
)
626 tp_assign(sector
, bio
->bi_sector
)
627 tp_assign(new_sector
, new_sector
)
628 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
629 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
632 TP_printk("%d,%d %s %llu / %llu [%s]",
633 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
634 __print_rwbs_flags(__entry
->rwbs
),
635 (unsigned long long)__entry
->sector
,
636 (unsigned long long)__entry
->new_sector
,
641 * block_bio_remap - map request for a logical device to the raw device
642 * @q: queue holding the operation
643 * @bio: revised operation
644 * @dev: device for the operation
645 * @from: original sector for the operation
647 * An operation for a logical device has been mapped to the
650 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
651 TRACE_EVENT(block_bio_remap
,
653 TRACE_EVENT(block_remap
,
656 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, dev_t dev
,
659 TP_ARGS(q
, bio
, dev
, from
),
662 __field( dev_t
, dev
)
663 __field( sector_t
, sector
)
664 __field( unsigned int, nr_sector
)
665 __field( dev_t
, old_dev
)
666 __field( sector_t
, old_sector
)
667 __field( unsigned int, rwbs
)
671 tp_assign(dev
, bio
->bi_bdev
->bd_dev
)
672 tp_assign(sector
, bio
->bi_sector
)
673 tp_assign(nr_sector
, bio
->bi_size
>> 9)
674 tp_assign(old_dev
, dev
)
675 tp_assign(old_sector
, from
)
676 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
679 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
680 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
681 __print_rwbs_flags(__entry
->rwbs
),
682 (unsigned long long)__entry
->sector
,
684 MAJOR(__entry
->old_dev
), MINOR(__entry
->old_dev
),
685 (unsigned long long)__entry
->old_sector
)
688 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
690 * block_rq_remap - map request for a block operation request
691 * @q: queue holding the operation
692 * @rq: block IO operation request
693 * @dev: device for the operation
694 * @from: original sector for the operation
696 * The block operation request @rq in @q has been remapped. The block
697 * operation request @rq holds the current information and @from hold
698 * the original sector.
700 TRACE_EVENT(block_rq_remap
,
702 TP_PROTO(struct request_queue
*q
, struct request
*rq
, dev_t dev
,
705 TP_ARGS(q
, rq
, dev
, from
),
708 __field( dev_t
, dev
)
709 __field( sector_t
, sector
)
710 __field( unsigned int, nr_sector
)
711 __field( dev_t
, old_dev
)
712 __field( sector_t
, old_sector
)
713 __field( unsigned int, rwbs
)
717 tp_assign(dev
, disk_devt(rq
->rq_disk
))
718 tp_assign(sector
, blk_rq_pos(rq
))
719 tp_assign(nr_sector
, blk_rq_sectors(rq
))
720 tp_assign(old_dev
, dev
)
721 tp_assign(old_sector
, from
)
722 blk_fill_rwbs(rwbs
, rq
->cmd_flags
, blk_rq_bytes(rq
))
725 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
726 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
727 __print_rwbs_flags(__entry
->rwbs
),
728 (unsigned long long)__entry
->sector
,
730 MAJOR(__entry
->old_dev
), MINOR(__entry
->old_dev
),
731 (unsigned long long)__entry
->old_sector
)
735 #undef __print_rwbs_flags
738 #endif /* _TRACE_BLOCK_H */
740 /* This part must be outside protection */
741 #include "../../../probes/define_trace.h"
This page took 0.066968 seconds and 4 git commands to generate.