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(3,9,0))
317 TP_PROTO(struct bio
*bio
, int error
),
320 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
321 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int error
),
323 TP_ARGS(q
, bio
, error
),
325 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
331 __field( dev_t
, dev
)
332 __field( sector_t
, sector
)
333 __field( unsigned, nr_sector
)
334 __field( int, error
)
335 __field( unsigned int, rwbs
)
339 tp_assign(dev
, bio
->bi_bdev
->bd_dev
)
340 tp_assign(sector
, bio
->bi_sector
)
341 tp_assign(nr_sector
, bio
->bi_size
>> 9)
342 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
343 tp_assign(error
, error
)
347 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
350 TP_printk("%d,%d %s %llu + %u [%d]",
351 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
352 __print_rwbs_flags(__entry
->rwbs
),
353 (unsigned long long)__entry
->sector
,
354 __entry
->nr_sector
, __entry
->error
)
357 DECLARE_EVENT_CLASS(block_bio
,
359 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
364 __field( dev_t
, dev
)
365 __field( sector_t
, sector
)
366 __field( unsigned int, nr_sector
)
367 __field( unsigned int, rwbs
)
368 __array_text( char, comm
, TASK_COMM_LEN
)
372 tp_assign(dev
, bio
->bi_bdev
->bd_dev
)
373 tp_assign(sector
, bio
->bi_sector
)
374 tp_assign(nr_sector
, bio
->bi_size
>> 9)
375 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
376 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
379 TP_printk("%d,%d %s %llu + %u [%s]",
380 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
381 __print_rwbs_flags(__entry
->rwbs
),
382 (unsigned long long)__entry
->sector
,
383 __entry
->nr_sector
, __entry
->comm
)
387 * block_bio_backmerge - merging block operation to the end of an existing operation
388 * @q: queue holding operation
389 * @bio: new block operation to merge
391 * Merging block request @bio to the end of an existing block request
394 DEFINE_EVENT(block_bio
, block_bio_backmerge
,
396 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
397 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
401 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
408 * block_bio_frontmerge - merging block operation to the beginning of an existing operation
409 * @q: queue holding operation
410 * @bio: new block operation to merge
412 * Merging block IO operation @bio to the beginning of an existing block
413 * operation in queue @q.
415 DEFINE_EVENT(block_bio
, block_bio_frontmerge
,
417 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,0))
418 TP_PROTO(struct request_queue
*q
, struct request
*rq
, struct bio
*bio
),
422 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
429 * block_bio_queue - putting new block IO operation in queue
430 * @q: queue holding operation
431 * @bio: new block operation
433 * About to place the block IO operation @bio into queue @q.
435 DEFINE_EVENT(block_bio
, block_bio_queue
,
437 TP_PROTO(struct request_queue
*q
, struct bio
*bio
),
442 DECLARE_EVENT_CLASS(block_get_rq
,
444 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
449 __field( dev_t
, dev
)
450 __field( sector_t
, sector
)
451 __field( unsigned int, nr_sector
)
452 __field( unsigned int, rwbs
)
453 __array_text( char, comm
, TASK_COMM_LEN
)
457 tp_assign(dev
, bio
? bio
->bi_bdev
->bd_dev
: 0)
458 tp_assign(sector
, bio
? bio
->bi_sector
: 0)
459 tp_assign(nr_sector
, bio
? bio
->bi_size
>> 9 : 0)
460 blk_fill_rwbs(rwbs
, bio
? bio
->bi_rw
: 0,
461 bio
? bio
->bi_size
>> 9 : 0)
462 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
465 TP_printk("%d,%d %s %llu + %u [%s]",
466 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
467 __print_rwbs_flags(__entry
->rwbs
),
468 (unsigned long long)__entry
->sector
,
469 __entry
->nr_sector
, __entry
->comm
)
473 * block_getrq - get a free request entry in queue for block IO operations
474 * @q: queue for operations
475 * @bio: pending block IO operation
476 * @rw: low bit indicates a read (%0) or a write (%1)
478 * A request struct for queue @q has been allocated to handle the
479 * block IO operation @bio.
481 DEFINE_EVENT(block_get_rq
, block_getrq
,
483 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
489 * block_sleeprq - waiting to get a free request entry in queue for block IO operation
490 * @q: queue for operation
491 * @bio: pending block IO operation
492 * @rw: low bit indicates a read (%0) or a write (%1)
494 * In the case where a request struct cannot be provided for queue @q
495 * the process needs to wait for an request struct to become
496 * available. This tracepoint event is generated each time the
497 * process goes to sleep waiting for request struct become available.
499 DEFINE_EVENT(block_get_rq
, block_sleeprq
,
501 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, int rw
),
507 * block_plug - keep operations requests in request queue
508 * @q: request queue to plug
510 * Plug the request queue @q. Do not allow block operation requests
511 * to be sent to the device driver. Instead, accumulate requests in
512 * the queue to improve throughput performance of the block device.
514 TRACE_EVENT(block_plug
,
516 TP_PROTO(struct request_queue
*q
),
521 __array_text( char, comm
, TASK_COMM_LEN
)
525 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
528 TP_printk("[%s]", __entry
->comm
)
531 DECLARE_EVENT_CLASS(block_unplug
,
533 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
534 TP_PROTO(struct request_queue
*q
, unsigned int depth
, bool explicit),
536 TP_ARGS(q
, depth
, explicit),
538 TP_PROTO(struct request_queue
*q
),
544 __field( int, nr_rq
)
545 __array_text( char, comm
, TASK_COMM_LEN
)
549 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
550 tp_assign(nr_rq
, depth
)
552 tp_assign(nr_rq
, q
->rq
.count
[READ
] + q
->rq
.count
[WRITE
])
554 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
557 TP_printk("[%s] %d", __entry
->comm
, __entry
->nr_rq
)
560 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39))
562 * block_unplug_timer - timed release of operations requests in queue to device driver
563 * @q: request queue to unplug
565 * Unplug the request queue @q because a timer expired and allow block
566 * operation requests to be sent to the device driver.
568 DEFINE_EVENT(block_unplug
, block_unplug_timer
,
570 TP_PROTO(struct request_queue
*q
),
577 * block_unplug - release of operations requests in request queue
578 * @q: request queue to unplug
579 * @depth: number of requests just added to the queue
580 * @explicit: whether this was an explicit unplug, or one from schedule()
582 * Unplug request queue @q because device driver is scheduled to work
583 * on elements in the request queue.
585 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
586 DEFINE_EVENT(block_unplug
, block_unplug
,
588 DEFINE_EVENT(block_unplug
, block_unplug_io
,
591 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
592 TP_PROTO(struct request_queue
*q
, unsigned int depth
, bool explicit),
594 TP_ARGS(q
, depth
, explicit)
596 TP_PROTO(struct request_queue
*q
),
603 * block_split - split a single bio struct into two bio structs
604 * @q: queue containing the bio
605 * @bio: block operation being split
606 * @new_sector: The starting sector for the new bio
608 * The bio request @bio in request queue @q needs to be split into two
609 * bio requests. The newly created @bio request starts at
610 * @new_sector. This split may be required due to hardware limitation
611 * such as operation crossing device boundaries in a RAID system.
613 TRACE_EVENT(block_split
,
615 TP_PROTO(struct request_queue
*q
, struct bio
*bio
,
616 unsigned int new_sector
),
618 TP_ARGS(q
, bio
, new_sector
),
621 __field( dev_t
, dev
)
622 __field( sector_t
, sector
)
623 __field( sector_t
, new_sector
)
624 __field( unsigned int, rwbs
)
625 __array_text( char, comm
, TASK_COMM_LEN
)
629 tp_assign(dev
, bio
->bi_bdev
->bd_dev
)
630 tp_assign(sector
, bio
->bi_sector
)
631 tp_assign(new_sector
, new_sector
)
632 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
633 tp_memcpy(comm
, current
->comm
, TASK_COMM_LEN
)
636 TP_printk("%d,%d %s %llu / %llu [%s]",
637 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
638 __print_rwbs_flags(__entry
->rwbs
),
639 (unsigned long long)__entry
->sector
,
640 (unsigned long long)__entry
->new_sector
,
645 * block_bio_remap - map request for a logical device to the raw device
646 * @q: queue holding the operation
647 * @bio: revised operation
648 * @dev: device for the operation
649 * @from: original sector for the operation
651 * An operation for a logical device has been mapped to the
654 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38))
655 TRACE_EVENT(block_bio_remap
,
657 TRACE_EVENT(block_remap
,
660 TP_PROTO(struct request_queue
*q
, struct bio
*bio
, dev_t dev
,
663 TP_ARGS(q
, bio
, dev
, from
),
666 __field( dev_t
, dev
)
667 __field( sector_t
, sector
)
668 __field( unsigned int, nr_sector
)
669 __field( dev_t
, old_dev
)
670 __field( sector_t
, old_sector
)
671 __field( unsigned int, rwbs
)
675 tp_assign(dev
, bio
->bi_bdev
->bd_dev
)
676 tp_assign(sector
, bio
->bi_sector
)
677 tp_assign(nr_sector
, bio
->bi_size
>> 9)
678 tp_assign(old_dev
, dev
)
679 tp_assign(old_sector
, from
)
680 blk_fill_rwbs(rwbs
, bio
->bi_rw
, bio
->bi_size
)
683 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
684 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
685 __print_rwbs_flags(__entry
->rwbs
),
686 (unsigned long long)__entry
->sector
,
688 MAJOR(__entry
->old_dev
), MINOR(__entry
->old_dev
),
689 (unsigned long long)__entry
->old_sector
)
692 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32))
694 * block_rq_remap - map request for a block operation request
695 * @q: queue holding the operation
696 * @rq: block IO operation request
697 * @dev: device for the operation
698 * @from: original sector for the operation
700 * The block operation request @rq in @q has been remapped. The block
701 * operation request @rq holds the current information and @from hold
702 * the original sector.
704 TRACE_EVENT(block_rq_remap
,
706 TP_PROTO(struct request_queue
*q
, struct request
*rq
, dev_t dev
,
709 TP_ARGS(q
, rq
, dev
, from
),
712 __field( dev_t
, dev
)
713 __field( sector_t
, sector
)
714 __field( unsigned int, nr_sector
)
715 __field( dev_t
, old_dev
)
716 __field( sector_t
, old_sector
)
717 __field( unsigned int, rwbs
)
721 tp_assign(dev
, disk_devt(rq
->rq_disk
))
722 tp_assign(sector
, blk_rq_pos(rq
))
723 tp_assign(nr_sector
, blk_rq_sectors(rq
))
724 tp_assign(old_dev
, dev
)
725 tp_assign(old_sector
, from
)
726 blk_fill_rwbs(rwbs
, rq
->cmd_flags
, blk_rq_bytes(rq
))
729 TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu",
730 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
731 __print_rwbs_flags(__entry
->rwbs
),
732 (unsigned long long)__entry
->sector
,
734 MAJOR(__entry
->old_dev
), MINOR(__entry
->old_dev
),
735 (unsigned long long)__entry
->old_sector
)
739 #undef __print_rwbs_flags
742 #endif /* _TRACE_BLOCK_H */
744 /* This part must be outside protection */
745 #include "../../../probes/define_trace.h"
This page took 0.047156 seconds and 5 git commands to generate.