1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM ext4
5 #if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/writeback.h>
9 #include <linux/tracepoint.h>
11 struct ext4_allocation_context
;
12 struct ext4_allocation_request
;
14 struct ext4_prealloc_space
;
15 struct ext4_inode_info
;
17 struct ext4_map_blocks
;
21 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
23 #define show_mballoc_flags(flags) __print_flags(flags, "|", \
24 { EXT4_MB_HINT_MERGE, "HINT_MERGE" }, \
25 { EXT4_MB_HINT_RESERVED, "HINT_RESV" }, \
26 { EXT4_MB_HINT_METADATA, "HINT_MDATA" }, \
27 { EXT4_MB_HINT_FIRST, "HINT_FIRST" }, \
28 { EXT4_MB_HINT_BEST, "HINT_BEST" }, \
29 { EXT4_MB_HINT_DATA, "HINT_DATA" }, \
30 { EXT4_MB_HINT_NOPREALLOC, "HINT_NOPREALLOC" }, \
31 { EXT4_MB_HINT_GROUP_ALLOC, "HINT_GRP_ALLOC" }, \
32 { EXT4_MB_HINT_GOAL_ONLY, "HINT_GOAL_ONLY" }, \
33 { EXT4_MB_HINT_TRY_GOAL, "HINT_TRY_GOAL" }, \
34 { EXT4_MB_DELALLOC_RESERVED, "DELALLOC_RESV" }, \
35 { EXT4_MB_STREAM_ALLOC, "STREAM_ALLOC" }, \
36 { EXT4_MB_USE_ROOT_BLOCKS, "USE_ROOT_BLKS" }, \
37 { EXT4_MB_USE_RESERVED, "USE_RESV" })
39 #define show_map_flags(flags) __print_flags(flags, "|", \
40 { EXT4_GET_BLOCKS_CREATE, "CREATE" }, \
41 { EXT4_GET_BLOCKS_UNWRIT_EXT, "UNWRIT" }, \
42 { EXT4_GET_BLOCKS_DELALLOC_RESERVE, "DELALLOC" }, \
43 { EXT4_GET_BLOCKS_PRE_IO, "PRE_IO" }, \
44 { EXT4_GET_BLOCKS_CONVERT, "CONVERT" }, \
45 { EXT4_GET_BLOCKS_METADATA_NOFAIL, "METADATA_NOFAIL" }, \
46 { EXT4_GET_BLOCKS_NO_NORMALIZE, "NO_NORMALIZE" }, \
47 { EXT4_GET_BLOCKS_KEEP_SIZE, "KEEP_SIZE" }, \
48 { EXT4_GET_BLOCKS_ZERO, "ZERO" })
50 #define show_mflags(flags) __print_flags(flags, "", \
51 { EXT4_MAP_NEW, "N" }, \
52 { EXT4_MAP_MAPPED, "M" }, \
53 { EXT4_MAP_UNWRITTEN, "U" }, \
54 { EXT4_MAP_BOUNDARY, "B" })
56 #define show_free_flags(flags) __print_flags(flags, "|", \
57 { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \
58 { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \
59 { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \
60 { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \
61 { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
62 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
64 #define show_extent_status(status) __print_flags(status, "", \
65 { EXTENT_STATUS_WRITTEN, "W" }, \
66 { EXTENT_STATUS_UNWRITTEN, "U" }, \
67 { EXTENT_STATUS_DELAYED, "D" }, \
68 { EXTENT_STATUS_HOLE, "H" })
70 #define show_falloc_mode(mode) __print_flags(mode, "|", \
71 { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
72 { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
73 { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \
74 { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \
75 { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"})
78 TRACE_EVENT(ext4_other_inode_update_time
,
79 TP_PROTO(struct inode
*inode
, ino_t orig_ino
),
81 TP_ARGS(inode
, orig_ino
),
86 __field( ino_t
, orig_ino
)
89 __field( __u16
, mode
)
93 __entry
->orig_ino
= orig_ino
;
94 __entry
->dev
= inode
->i_sb
->s_dev
;
95 __entry
->ino
= inode
->i_ino
;
96 __entry
->uid
= i_uid_read(inode
);
97 __entry
->gid
= i_gid_read(inode
);
98 __entry
->mode
= inode
->i_mode
;
101 TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u",
102 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
103 (unsigned long) __entry
->orig_ino
,
104 (unsigned long) __entry
->ino
, __entry
->mode
,
105 __entry
->uid
, __entry
->gid
)
108 TRACE_EVENT(ext4_free_inode
,
109 TP_PROTO(struct inode
*inode
),
114 __field( dev_t
, dev
)
115 __field( ino_t
, ino
)
116 __field( uid_t
, uid
)
117 __field( gid_t
, gid
)
118 __field( __u64
, blocks
)
119 __field( __u16
, mode
)
123 __entry
->dev
= inode
->i_sb
->s_dev
;
124 __entry
->ino
= inode
->i_ino
;
125 __entry
->uid
= i_uid_read(inode
);
126 __entry
->gid
= i_gid_read(inode
);
127 __entry
->blocks
= inode
->i_blocks
;
128 __entry
->mode
= inode
->i_mode
;
131 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
132 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
133 (unsigned long) __entry
->ino
, __entry
->mode
,
134 __entry
->uid
, __entry
->gid
, __entry
->blocks
)
137 TRACE_EVENT(ext4_request_inode
,
138 TP_PROTO(struct inode
*dir
, int mode
),
143 __field( dev_t
, dev
)
144 __field( ino_t
, dir
)
145 __field( __u16
, mode
)
149 __entry
->dev
= dir
->i_sb
->s_dev
;
150 __entry
->dir
= dir
->i_ino
;
151 __entry
->mode
= mode
;
154 TP_printk("dev %d,%d dir %lu mode 0%o",
155 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
156 (unsigned long) __entry
->dir
, __entry
->mode
)
159 TRACE_EVENT(ext4_allocate_inode
,
160 TP_PROTO(struct inode
*inode
, struct inode
*dir
, int mode
),
162 TP_ARGS(inode
, dir
, mode
),
165 __field( dev_t
, dev
)
166 __field( ino_t
, ino
)
167 __field( ino_t
, dir
)
168 __field( __u16
, mode
)
172 __entry
->dev
= inode
->i_sb
->s_dev
;
173 __entry
->ino
= inode
->i_ino
;
174 __entry
->dir
= dir
->i_ino
;
175 __entry
->mode
= mode
;
178 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
179 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
180 (unsigned long) __entry
->ino
,
181 (unsigned long) __entry
->dir
, __entry
->mode
)
184 TRACE_EVENT(ext4_evict_inode
,
185 TP_PROTO(struct inode
*inode
),
190 __field( dev_t
, dev
)
191 __field( ino_t
, ino
)
192 __field( int, nlink
)
196 __entry
->dev
= inode
->i_sb
->s_dev
;
197 __entry
->ino
= inode
->i_ino
;
198 __entry
->nlink
= inode
->i_nlink
;
201 TP_printk("dev %d,%d ino %lu nlink %d",
202 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
203 (unsigned long) __entry
->ino
, __entry
->nlink
)
206 TRACE_EVENT(ext4_drop_inode
,
207 TP_PROTO(struct inode
*inode
, int drop
),
209 TP_ARGS(inode
, drop
),
212 __field( dev_t
, dev
)
213 __field( ino_t
, ino
)
218 __entry
->dev
= inode
->i_sb
->s_dev
;
219 __entry
->ino
= inode
->i_ino
;
220 __entry
->drop
= drop
;
223 TP_printk("dev %d,%d ino %lu drop %d",
224 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
225 (unsigned long) __entry
->ino
, __entry
->drop
)
228 TRACE_EVENT(ext4_mark_inode_dirty
,
229 TP_PROTO(struct inode
*inode
, unsigned long IP
),
234 __field( dev_t
, dev
)
235 __field( ino_t
, ino
)
236 __field(unsigned long, ip
)
240 __entry
->dev
= inode
->i_sb
->s_dev
;
241 __entry
->ino
= inode
->i_ino
;
245 TP_printk("dev %d,%d ino %lu caller %pS",
246 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
247 (unsigned long) __entry
->ino
, (void *)__entry
->ip
)
250 TRACE_EVENT(ext4_begin_ordered_truncate
,
251 TP_PROTO(struct inode
*inode
, loff_t new_size
),
253 TP_ARGS(inode
, new_size
),
256 __field( dev_t
, dev
)
257 __field( ino_t
, ino
)
258 __field( loff_t
, new_size
)
262 __entry
->dev
= inode
->i_sb
->s_dev
;
263 __entry
->ino
= inode
->i_ino
;
264 __entry
->new_size
= new_size
;
267 TP_printk("dev %d,%d ino %lu new_size %lld",
268 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
269 (unsigned long) __entry
->ino
,
273 DECLARE_EVENT_CLASS(ext4__write_begin
,
275 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
278 TP_ARGS(inode
, pos
, len
, flags
),
281 __field( dev_t
, dev
)
282 __field( ino_t
, ino
)
283 __field( loff_t
, pos
)
284 __field( unsigned int, len
)
285 __field( unsigned int, flags
)
289 __entry
->dev
= inode
->i_sb
->s_dev
;
290 __entry
->ino
= inode
->i_ino
;
293 __entry
->flags
= flags
;
296 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
297 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
298 (unsigned long) __entry
->ino
,
299 __entry
->pos
, __entry
->len
, __entry
->flags
)
302 DEFINE_EVENT(ext4__write_begin
, ext4_write_begin
,
304 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
307 TP_ARGS(inode
, pos
, len
, flags
)
310 DEFINE_EVENT(ext4__write_begin
, ext4_da_write_begin
,
312 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
315 TP_ARGS(inode
, pos
, len
, flags
)
318 DECLARE_EVENT_CLASS(ext4__write_end
,
319 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
320 unsigned int copied
),
322 TP_ARGS(inode
, pos
, len
, copied
),
325 __field( dev_t
, dev
)
326 __field( ino_t
, ino
)
327 __field( loff_t
, pos
)
328 __field( unsigned int, len
)
329 __field( unsigned int, copied
)
333 __entry
->dev
= inode
->i_sb
->s_dev
;
334 __entry
->ino
= inode
->i_ino
;
337 __entry
->copied
= copied
;
340 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
341 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
342 (unsigned long) __entry
->ino
,
343 __entry
->pos
, __entry
->len
, __entry
->copied
)
346 DEFINE_EVENT(ext4__write_end
, ext4_write_end
,
348 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
349 unsigned int copied
),
351 TP_ARGS(inode
, pos
, len
, copied
)
354 DEFINE_EVENT(ext4__write_end
, ext4_journalled_write_end
,
356 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
357 unsigned int copied
),
359 TP_ARGS(inode
, pos
, len
, copied
)
362 DEFINE_EVENT(ext4__write_end
, ext4_da_write_end
,
364 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
365 unsigned int copied
),
367 TP_ARGS(inode
, pos
, len
, copied
)
370 TRACE_EVENT(ext4_writepages
,
371 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
376 __field( dev_t
, dev
)
377 __field( ino_t
, ino
)
378 __field( long, nr_to_write
)
379 __field( long, pages_skipped
)
380 __field( loff_t
, range_start
)
381 __field( loff_t
, range_end
)
382 __field( pgoff_t
, writeback_index
)
383 __field( int, sync_mode
)
384 __field( char, for_kupdate
)
385 __field( char, range_cyclic
)
389 __entry
->dev
= inode
->i_sb
->s_dev
;
390 __entry
->ino
= inode
->i_ino
;
391 __entry
->nr_to_write
= wbc
->nr_to_write
;
392 __entry
->pages_skipped
= wbc
->pages_skipped
;
393 __entry
->range_start
= wbc
->range_start
;
394 __entry
->range_end
= wbc
->range_end
;
395 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
396 __entry
->sync_mode
= wbc
->sync_mode
;
397 __entry
->for_kupdate
= wbc
->for_kupdate
;
398 __entry
->range_cyclic
= wbc
->range_cyclic
;
401 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
402 "range_start %lld range_end %lld sync_mode %d "
403 "for_kupdate %d range_cyclic %d writeback_index %lu",
404 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
405 (unsigned long) __entry
->ino
, __entry
->nr_to_write
,
406 __entry
->pages_skipped
, __entry
->range_start
,
407 __entry
->range_end
, __entry
->sync_mode
,
408 __entry
->for_kupdate
, __entry
->range_cyclic
,
409 (unsigned long) __entry
->writeback_index
)
412 TRACE_EVENT(ext4_da_write_pages
,
413 TP_PROTO(struct inode
*inode
, pgoff_t first_page
,
414 struct writeback_control
*wbc
),
416 TP_ARGS(inode
, first_page
, wbc
),
419 __field( dev_t
, dev
)
420 __field( ino_t
, ino
)
421 __field( pgoff_t
, first_page
)
422 __field( long, nr_to_write
)
423 __field( int, sync_mode
)
427 __entry
->dev
= inode
->i_sb
->s_dev
;
428 __entry
->ino
= inode
->i_ino
;
429 __entry
->first_page
= first_page
;
430 __entry
->nr_to_write
= wbc
->nr_to_write
;
431 __entry
->sync_mode
= wbc
->sync_mode
;
434 TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
436 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
437 (unsigned long) __entry
->ino
, __entry
->first_page
,
438 __entry
->nr_to_write
, __entry
->sync_mode
)
441 TRACE_EVENT(ext4_da_write_pages_extent
,
442 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
),
447 __field( dev_t
, dev
)
448 __field( ino_t
, ino
)
449 __field( __u64
, lblk
)
450 __field( __u32
, len
)
451 __field( __u32
, flags
)
455 __entry
->dev
= inode
->i_sb
->s_dev
;
456 __entry
->ino
= inode
->i_ino
;
457 __entry
->lblk
= map
->m_lblk
;
458 __entry
->len
= map
->m_len
;
459 __entry
->flags
= map
->m_flags
;
462 TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
463 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
464 (unsigned long) __entry
->ino
, __entry
->lblk
, __entry
->len
,
465 show_mflags(__entry
->flags
))
468 TRACE_EVENT(ext4_writepages_result
,
469 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
,
470 int ret
, int pages_written
),
472 TP_ARGS(inode
, wbc
, ret
, pages_written
),
475 __field( dev_t
, dev
)
476 __field( ino_t
, ino
)
478 __field( int, pages_written
)
479 __field( long, pages_skipped
)
480 __field( pgoff_t
, writeback_index
)
481 __field( int, sync_mode
)
485 __entry
->dev
= inode
->i_sb
->s_dev
;
486 __entry
->ino
= inode
->i_ino
;
488 __entry
->pages_written
= pages_written
;
489 __entry
->pages_skipped
= wbc
->pages_skipped
;
490 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
491 __entry
->sync_mode
= wbc
->sync_mode
;
494 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
495 "sync_mode %d writeback_index %lu",
496 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
497 (unsigned long) __entry
->ino
, __entry
->ret
,
498 __entry
->pages_written
, __entry
->pages_skipped
,
500 (unsigned long) __entry
->writeback_index
)
503 DECLARE_EVENT_CLASS(ext4__page_op
,
504 TP_PROTO(struct page
*page
),
509 __field( dev_t
, dev
)
510 __field( ino_t
, ino
)
511 __field( pgoff_t
, index
)
516 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
517 __entry
->ino
= page
->mapping
->host
->i_ino
;
518 __entry
->index
= page
->index
;
521 TP_printk("dev %d,%d ino %lu page_index %lu",
522 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
523 (unsigned long) __entry
->ino
,
524 (unsigned long) __entry
->index
)
527 DEFINE_EVENT(ext4__page_op
, ext4_writepage
,
529 TP_PROTO(struct page
*page
),
534 DEFINE_EVENT(ext4__page_op
, ext4_readpage
,
536 TP_PROTO(struct page
*page
),
541 DEFINE_EVENT(ext4__page_op
, ext4_releasepage
,
543 TP_PROTO(struct page
*page
),
548 DECLARE_EVENT_CLASS(ext4_invalidatepage_op
,
549 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
551 TP_ARGS(page
, offset
, length
),
554 __field( dev_t
, dev
)
555 __field( ino_t
, ino
)
556 __field( pgoff_t
, index
)
557 __field( unsigned int, offset
)
558 __field( unsigned int, length
)
562 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
563 __entry
->ino
= page
->mapping
->host
->i_ino
;
564 __entry
->index
= page
->index
;
565 __entry
->offset
= offset
;
566 __entry
->length
= length
;
569 TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
570 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
571 (unsigned long) __entry
->ino
,
572 (unsigned long) __entry
->index
,
573 __entry
->offset
, __entry
->length
)
576 DEFINE_EVENT(ext4_invalidatepage_op
, ext4_invalidatepage
,
577 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
579 TP_ARGS(page
, offset
, length
)
582 DEFINE_EVENT(ext4_invalidatepage_op
, ext4_journalled_invalidatepage
,
583 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
585 TP_ARGS(page
, offset
, length
)
588 TRACE_EVENT(ext4_discard_blocks
,
589 TP_PROTO(struct super_block
*sb
, unsigned long long blk
,
590 unsigned long long count
),
592 TP_ARGS(sb
, blk
, count
),
595 __field( dev_t
, dev
)
596 __field( __u64
, blk
)
597 __field( __u64
, count
)
602 __entry
->dev
= sb
->s_dev
;
604 __entry
->count
= count
;
607 TP_printk("dev %d,%d blk %llu count %llu",
608 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
609 __entry
->blk
, __entry
->count
)
612 DECLARE_EVENT_CLASS(ext4__mb_new_pa
,
613 TP_PROTO(struct ext4_allocation_context
*ac
,
614 struct ext4_prealloc_space
*pa
),
619 __field( dev_t
, dev
)
620 __field( ino_t
, ino
)
621 __field( __u64
, pa_pstart
)
622 __field( __u64
, pa_lstart
)
623 __field( __u32
, pa_len
)
628 __entry
->dev
= ac
->ac_sb
->s_dev
;
629 __entry
->ino
= ac
->ac_inode
->i_ino
;
630 __entry
->pa_pstart
= pa
->pa_pstart
;
631 __entry
->pa_lstart
= pa
->pa_lstart
;
632 __entry
->pa_len
= pa
->pa_len
;
635 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
636 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
637 (unsigned long) __entry
->ino
,
638 __entry
->pa_pstart
, __entry
->pa_len
, __entry
->pa_lstart
)
641 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_inode_pa
,
643 TP_PROTO(struct ext4_allocation_context
*ac
,
644 struct ext4_prealloc_space
*pa
),
649 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_group_pa
,
651 TP_PROTO(struct ext4_allocation_context
*ac
,
652 struct ext4_prealloc_space
*pa
),
657 TRACE_EVENT(ext4_mb_release_inode_pa
,
658 TP_PROTO(struct ext4_prealloc_space
*pa
,
659 unsigned long long block
, unsigned int count
),
661 TP_ARGS(pa
, block
, count
),
664 __field( dev_t
, dev
)
665 __field( ino_t
, ino
)
666 __field( __u64
, block
)
667 __field( __u32
, count
)
672 __entry
->dev
= pa
->pa_inode
->i_sb
->s_dev
;
673 __entry
->ino
= pa
->pa_inode
->i_ino
;
674 __entry
->block
= block
;
675 __entry
->count
= count
;
678 TP_printk("dev %d,%d ino %lu block %llu count %u",
679 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
680 (unsigned long) __entry
->ino
,
681 __entry
->block
, __entry
->count
)
684 TRACE_EVENT(ext4_mb_release_group_pa
,
685 TP_PROTO(struct super_block
*sb
, struct ext4_prealloc_space
*pa
),
690 __field( dev_t
, dev
)
691 __field( __u64
, pa_pstart
)
692 __field( __u32
, pa_len
)
697 __entry
->dev
= sb
->s_dev
;
698 __entry
->pa_pstart
= pa
->pa_pstart
;
699 __entry
->pa_len
= pa
->pa_len
;
702 TP_printk("dev %d,%d pstart %llu len %u",
703 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
704 __entry
->pa_pstart
, __entry
->pa_len
)
707 TRACE_EVENT(ext4_discard_preallocations
,
708 TP_PROTO(struct inode
*inode
),
713 __field( dev_t
, dev
)
714 __field( ino_t
, ino
)
719 __entry
->dev
= inode
->i_sb
->s_dev
;
720 __entry
->ino
= inode
->i_ino
;
723 TP_printk("dev %d,%d ino %lu",
724 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
725 (unsigned long) __entry
->ino
)
728 TRACE_EVENT(ext4_mb_discard_preallocations
,
729 TP_PROTO(struct super_block
*sb
, int needed
),
734 __field( dev_t
, dev
)
735 __field( int, needed
)
740 __entry
->dev
= sb
->s_dev
;
741 __entry
->needed
= needed
;
744 TP_printk("dev %d,%d needed %d",
745 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
749 TRACE_EVENT(ext4_request_blocks
,
750 TP_PROTO(struct ext4_allocation_request
*ar
),
755 __field( dev_t
, dev
)
756 __field( ino_t
, ino
)
757 __field( unsigned int, len
)
758 __field( __u32
, logical
)
759 __field( __u32
, lleft
)
760 __field( __u32
, lright
)
761 __field( __u64
, goal
)
762 __field( __u64
, pleft
)
763 __field( __u64
, pright
)
764 __field( unsigned int, flags
)
768 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
769 __entry
->ino
= ar
->inode
->i_ino
;
770 __entry
->len
= ar
->len
;
771 __entry
->logical
= ar
->logical
;
772 __entry
->goal
= ar
->goal
;
773 __entry
->lleft
= ar
->lleft
;
774 __entry
->lright
= ar
->lright
;
775 __entry
->pleft
= ar
->pleft
;
776 __entry
->pright
= ar
->pright
;
777 __entry
->flags
= ar
->flags
;
780 TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
781 "lleft %u lright %u pleft %llu pright %llu ",
782 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
783 (unsigned long) __entry
->ino
, show_mballoc_flags(__entry
->flags
),
784 __entry
->len
, __entry
->logical
, __entry
->goal
,
785 __entry
->lleft
, __entry
->lright
, __entry
->pleft
,
789 TRACE_EVENT(ext4_allocate_blocks
,
790 TP_PROTO(struct ext4_allocation_request
*ar
, unsigned long long block
),
795 __field( dev_t
, dev
)
796 __field( ino_t
, ino
)
797 __field( __u64
, block
)
798 __field( unsigned int, len
)
799 __field( __u32
, logical
)
800 __field( __u32
, lleft
)
801 __field( __u32
, lright
)
802 __field( __u64
, goal
)
803 __field( __u64
, pleft
)
804 __field( __u64
, pright
)
805 __field( unsigned int, flags
)
809 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
810 __entry
->ino
= ar
->inode
->i_ino
;
811 __entry
->block
= block
;
812 __entry
->len
= ar
->len
;
813 __entry
->logical
= ar
->logical
;
814 __entry
->goal
= ar
->goal
;
815 __entry
->lleft
= ar
->lleft
;
816 __entry
->lright
= ar
->lright
;
817 __entry
->pleft
= ar
->pleft
;
818 __entry
->pright
= ar
->pright
;
819 __entry
->flags
= ar
->flags
;
822 TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
823 "goal %llu lleft %u lright %u pleft %llu pright %llu",
824 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
825 (unsigned long) __entry
->ino
, show_mballoc_flags(__entry
->flags
),
826 __entry
->len
, __entry
->block
, __entry
->logical
,
827 __entry
->goal
, __entry
->lleft
, __entry
->lright
,
828 __entry
->pleft
, __entry
->pright
)
831 TRACE_EVENT(ext4_free_blocks
,
832 TP_PROTO(struct inode
*inode
, __u64 block
, unsigned long count
,
835 TP_ARGS(inode
, block
, count
, flags
),
838 __field( dev_t
, dev
)
839 __field( ino_t
, ino
)
840 __field( __u64
, block
)
841 __field( unsigned long, count
)
842 __field( int, flags
)
843 __field( __u16
, mode
)
847 __entry
->dev
= inode
->i_sb
->s_dev
;
848 __entry
->ino
= inode
->i_ino
;
849 __entry
->block
= block
;
850 __entry
->count
= count
;
851 __entry
->flags
= flags
;
852 __entry
->mode
= inode
->i_mode
;
855 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
856 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
857 (unsigned long) __entry
->ino
,
858 __entry
->mode
, __entry
->block
, __entry
->count
,
859 show_free_flags(__entry
->flags
))
862 TRACE_EVENT(ext4_sync_file_enter
,
863 TP_PROTO(struct file
*file
, int datasync
),
865 TP_ARGS(file
, datasync
),
868 __field( dev_t
, dev
)
869 __field( ino_t
, ino
)
870 __field( ino_t
, parent
)
871 __field( int, datasync
)
875 struct dentry
*dentry
= file
->f_path
.dentry
;
877 __entry
->dev
= dentry
->d_sb
->s_dev
;
878 __entry
->ino
= d_inode(dentry
)->i_ino
;
879 __entry
->datasync
= datasync
;
880 __entry
->parent
= d_inode(dentry
->d_parent
)->i_ino
;
883 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
884 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
885 (unsigned long) __entry
->ino
,
886 (unsigned long) __entry
->parent
, __entry
->datasync
)
889 TRACE_EVENT(ext4_sync_file_exit
,
890 TP_PROTO(struct inode
*inode
, int ret
),
895 __field( dev_t
, dev
)
896 __field( ino_t
, ino
)
901 __entry
->dev
= inode
->i_sb
->s_dev
;
902 __entry
->ino
= inode
->i_ino
;
906 TP_printk("dev %d,%d ino %lu ret %d",
907 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
908 (unsigned long) __entry
->ino
,
912 TRACE_EVENT(ext4_sync_fs
,
913 TP_PROTO(struct super_block
*sb
, int wait
),
918 __field( dev_t
, dev
)
924 __entry
->dev
= sb
->s_dev
;
925 __entry
->wait
= wait
;
928 TP_printk("dev %d,%d wait %d",
929 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
933 TRACE_EVENT(ext4_alloc_da_blocks
,
934 TP_PROTO(struct inode
*inode
),
939 __field( dev_t
, dev
)
940 __field( ino_t
, ino
)
941 __field( unsigned int, data_blocks
)
945 __entry
->dev
= inode
->i_sb
->s_dev
;
946 __entry
->ino
= inode
->i_ino
;
947 __entry
->data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
950 TP_printk("dev %d,%d ino %lu reserved_data_blocks %u",
951 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
952 (unsigned long) __entry
->ino
,
953 __entry
->data_blocks
)
956 TRACE_EVENT(ext4_mballoc_alloc
,
957 TP_PROTO(struct ext4_allocation_context
*ac
),
962 __field( dev_t
, dev
)
963 __field( ino_t
, ino
)
964 __field( __u32
, orig_logical
)
965 __field( int, orig_start
)
966 __field( __u32
, orig_group
)
967 __field( int, orig_len
)
968 __field( __u32
, goal_logical
)
969 __field( int, goal_start
)
970 __field( __u32
, goal_group
)
971 __field( int, goal_len
)
972 __field( __u32
, result_logical
)
973 __field( int, result_start
)
974 __field( __u32
, result_group
)
975 __field( int, result_len
)
976 __field( __u16
, found
)
977 __field( __u16
, groups
)
978 __field( __u16
, buddy
)
979 __field( __u16
, flags
)
980 __field( __u16
, tail
)
985 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
986 __entry
->ino
= ac
->ac_inode
->i_ino
;
987 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
988 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
989 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
990 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
991 __entry
->goal_logical
= ac
->ac_g_ex
.fe_logical
;
992 __entry
->goal_start
= ac
->ac_g_ex
.fe_start
;
993 __entry
->goal_group
= ac
->ac_g_ex
.fe_group
;
994 __entry
->goal_len
= ac
->ac_g_ex
.fe_len
;
995 __entry
->result_logical
= ac
->ac_f_ex
.fe_logical
;
996 __entry
->result_start
= ac
->ac_f_ex
.fe_start
;
997 __entry
->result_group
= ac
->ac_f_ex
.fe_group
;
998 __entry
->result_len
= ac
->ac_f_ex
.fe_len
;
999 __entry
->found
= ac
->ac_found
;
1000 __entry
->flags
= ac
->ac_flags
;
1001 __entry
->groups
= ac
->ac_groups_scanned
;
1002 __entry
->buddy
= ac
->ac_buddy
;
1003 __entry
->tail
= ac
->ac_tail
;
1004 __entry
->cr
= ac
->ac_criteria
;
1007 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
1008 "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
1009 "tail %u broken %u",
1010 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1011 (unsigned long) __entry
->ino
,
1012 __entry
->orig_group
, __entry
->orig_start
,
1013 __entry
->orig_len
, __entry
->orig_logical
,
1014 __entry
->goal_group
, __entry
->goal_start
,
1015 __entry
->goal_len
, __entry
->goal_logical
,
1016 __entry
->result_group
, __entry
->result_start
,
1017 __entry
->result_len
, __entry
->result_logical
,
1018 __entry
->found
, __entry
->groups
, __entry
->cr
,
1019 show_mballoc_flags(__entry
->flags
), __entry
->tail
,
1020 __entry
->buddy
? 1 << __entry
->buddy
: 0)
1023 TRACE_EVENT(ext4_mballoc_prealloc
,
1024 TP_PROTO(struct ext4_allocation_context
*ac
),
1029 __field( dev_t
, dev
)
1030 __field( ino_t
, ino
)
1031 __field( __u32
, orig_logical
)
1032 __field( int, orig_start
)
1033 __field( __u32
, orig_group
)
1034 __field( int, orig_len
)
1035 __field( __u32
, result_logical
)
1036 __field( int, result_start
)
1037 __field( __u32
, result_group
)
1038 __field( int, result_len
)
1042 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
1043 __entry
->ino
= ac
->ac_inode
->i_ino
;
1044 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
1045 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
1046 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
1047 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
1048 __entry
->result_logical
= ac
->ac_b_ex
.fe_logical
;
1049 __entry
->result_start
= ac
->ac_b_ex
.fe_start
;
1050 __entry
->result_group
= ac
->ac_b_ex
.fe_group
;
1051 __entry
->result_len
= ac
->ac_b_ex
.fe_len
;
1054 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
1055 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1056 (unsigned long) __entry
->ino
,
1057 __entry
->orig_group
, __entry
->orig_start
,
1058 __entry
->orig_len
, __entry
->orig_logical
,
1059 __entry
->result_group
, __entry
->result_start
,
1060 __entry
->result_len
, __entry
->result_logical
)
1063 DECLARE_EVENT_CLASS(ext4__mballoc
,
1064 TP_PROTO(struct super_block
*sb
,
1065 struct inode
*inode
,
1067 ext4_grpblk_t start
,
1070 TP_ARGS(sb
, inode
, group
, start
, len
),
1073 __field( dev_t
, dev
)
1074 __field( ino_t
, ino
)
1075 __field( int, result_start
)
1076 __field( __u32
, result_group
)
1077 __field( int, result_len
)
1081 __entry
->dev
= sb
->s_dev
;
1082 __entry
->ino
= inode
? inode
->i_ino
: 0;
1083 __entry
->result_start
= start
;
1084 __entry
->result_group
= group
;
1085 __entry
->result_len
= len
;
1088 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
1089 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1090 (unsigned long) __entry
->ino
,
1091 __entry
->result_group
, __entry
->result_start
,
1092 __entry
->result_len
)
1095 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_discard
,
1097 TP_PROTO(struct super_block
*sb
,
1098 struct inode
*inode
,
1100 ext4_grpblk_t start
,
1103 TP_ARGS(sb
, inode
, group
, start
, len
)
1106 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_free
,
1108 TP_PROTO(struct super_block
*sb
,
1109 struct inode
*inode
,
1111 ext4_grpblk_t start
,
1114 TP_ARGS(sb
, inode
, group
, start
, len
)
1117 TRACE_EVENT(ext4_forget
,
1118 TP_PROTO(struct inode
*inode
, int is_metadata
, __u64 block
),
1120 TP_ARGS(inode
, is_metadata
, block
),
1123 __field( dev_t
, dev
)
1124 __field( ino_t
, ino
)
1125 __field( __u64
, block
)
1126 __field( int, is_metadata
)
1127 __field( __u16
, mode
)
1131 __entry
->dev
= inode
->i_sb
->s_dev
;
1132 __entry
->ino
= inode
->i_ino
;
1133 __entry
->block
= block
;
1134 __entry
->is_metadata
= is_metadata
;
1135 __entry
->mode
= inode
->i_mode
;
1138 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
1139 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1140 (unsigned long) __entry
->ino
,
1141 __entry
->mode
, __entry
->is_metadata
, __entry
->block
)
1144 TRACE_EVENT(ext4_da_update_reserve_space
,
1145 TP_PROTO(struct inode
*inode
, int used_blocks
, int quota_claim
),
1147 TP_ARGS(inode
, used_blocks
, quota_claim
),
1150 __field( dev_t
, dev
)
1151 __field( ino_t
, ino
)
1152 __field( __u64
, i_blocks
)
1153 __field( int, used_blocks
)
1154 __field( int, reserved_data_blocks
)
1155 __field( int, quota_claim
)
1156 __field( __u16
, mode
)
1160 __entry
->dev
= inode
->i_sb
->s_dev
;
1161 __entry
->ino
= inode
->i_ino
;
1162 __entry
->i_blocks
= inode
->i_blocks
;
1163 __entry
->used_blocks
= used_blocks
;
1164 __entry
->reserved_data_blocks
=
1165 EXT4_I(inode
)->i_reserved_data_blocks
;
1166 __entry
->quota_claim
= quota_claim
;
1167 __entry
->mode
= inode
->i_mode
;
1170 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1171 "reserved_data_blocks %d quota_claim %d",
1172 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1173 (unsigned long) __entry
->ino
,
1174 __entry
->mode
, __entry
->i_blocks
,
1175 __entry
->used_blocks
, __entry
->reserved_data_blocks
,
1176 __entry
->quota_claim
)
1179 TRACE_EVENT(ext4_da_reserve_space
,
1180 TP_PROTO(struct inode
*inode
),
1185 __field( dev_t
, dev
)
1186 __field( ino_t
, ino
)
1187 __field( __u64
, i_blocks
)
1188 __field( int, reserved_data_blocks
)
1189 __field( __u16
, mode
)
1193 __entry
->dev
= inode
->i_sb
->s_dev
;
1194 __entry
->ino
= inode
->i_ino
;
1195 __entry
->i_blocks
= inode
->i_blocks
;
1196 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
1197 __entry
->mode
= inode
->i_mode
;
1200 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu "
1201 "reserved_data_blocks %d",
1202 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1203 (unsigned long) __entry
->ino
,
1204 __entry
->mode
, __entry
->i_blocks
,
1205 __entry
->reserved_data_blocks
)
1208 TRACE_EVENT(ext4_da_release_space
,
1209 TP_PROTO(struct inode
*inode
, int freed_blocks
),
1211 TP_ARGS(inode
, freed_blocks
),
1214 __field( dev_t
, dev
)
1215 __field( ino_t
, ino
)
1216 __field( __u64
, i_blocks
)
1217 __field( int, freed_blocks
)
1218 __field( int, reserved_data_blocks
)
1219 __field( __u16
, mode
)
1223 __entry
->dev
= inode
->i_sb
->s_dev
;
1224 __entry
->ino
= inode
->i_ino
;
1225 __entry
->i_blocks
= inode
->i_blocks
;
1226 __entry
->freed_blocks
= freed_blocks
;
1227 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
1228 __entry
->mode
= inode
->i_mode
;
1231 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1232 "reserved_data_blocks %d",
1233 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1234 (unsigned long) __entry
->ino
,
1235 __entry
->mode
, __entry
->i_blocks
,
1236 __entry
->freed_blocks
, __entry
->reserved_data_blocks
)
1239 DECLARE_EVENT_CLASS(ext4__bitmap_load
,
1240 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1245 __field( dev_t
, dev
)
1246 __field( __u32
, group
)
1251 __entry
->dev
= sb
->s_dev
;
1252 __entry
->group
= group
;
1255 TP_printk("dev %d,%d group %u",
1256 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1260 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_bitmap_load
,
1262 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1267 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_buddy_bitmap_load
,
1269 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1274 DEFINE_EVENT(ext4__bitmap_load
, ext4_read_block_bitmap_load
,
1276 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1281 DEFINE_EVENT(ext4__bitmap_load
, ext4_load_inode_bitmap
,
1283 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1288 TRACE_EVENT(ext4_direct_IO_enter
,
1289 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
, int rw
),
1291 TP_ARGS(inode
, offset
, len
, rw
),
1294 __field( dev_t
, dev
)
1295 __field( ino_t
, ino
)
1296 __field( loff_t
, pos
)
1297 __field( unsigned long, len
)
1302 __entry
->dev
= inode
->i_sb
->s_dev
;
1303 __entry
->ino
= inode
->i_ino
;
1304 __entry
->pos
= offset
;
1309 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
1310 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1311 (unsigned long) __entry
->ino
,
1312 __entry
->pos
, __entry
->len
, __entry
->rw
)
1315 TRACE_EVENT(ext4_direct_IO_exit
,
1316 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
,
1319 TP_ARGS(inode
, offset
, len
, rw
, ret
),
1322 __field( dev_t
, dev
)
1323 __field( ino_t
, ino
)
1324 __field( loff_t
, pos
)
1325 __field( unsigned long, len
)
1331 __entry
->dev
= inode
->i_sb
->s_dev
;
1332 __entry
->ino
= inode
->i_ino
;
1333 __entry
->pos
= offset
;
1339 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
1340 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1341 (unsigned long) __entry
->ino
,
1342 __entry
->pos
, __entry
->len
,
1343 __entry
->rw
, __entry
->ret
)
1346 DECLARE_EVENT_CLASS(ext4__fallocate_mode
,
1347 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1349 TP_ARGS(inode
, offset
, len
, mode
),
1352 __field( dev_t
, dev
)
1353 __field( ino_t
, ino
)
1354 __field( loff_t
, offset
)
1355 __field( loff_t
, len
)
1356 __field( int, mode
)
1360 __entry
->dev
= inode
->i_sb
->s_dev
;
1361 __entry
->ino
= inode
->i_ino
;
1362 __entry
->offset
= offset
;
1364 __entry
->mode
= mode
;
1367 TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
1368 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1369 (unsigned long) __entry
->ino
,
1370 __entry
->offset
, __entry
->len
,
1371 show_falloc_mode(__entry
->mode
))
1374 DEFINE_EVENT(ext4__fallocate_mode
, ext4_fallocate_enter
,
1376 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1378 TP_ARGS(inode
, offset
, len
, mode
)
1381 DEFINE_EVENT(ext4__fallocate_mode
, ext4_punch_hole
,
1383 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1385 TP_ARGS(inode
, offset
, len
, mode
)
1388 DEFINE_EVENT(ext4__fallocate_mode
, ext4_zero_range
,
1390 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1392 TP_ARGS(inode
, offset
, len
, mode
)
1395 TRACE_EVENT(ext4_fallocate_exit
,
1396 TP_PROTO(struct inode
*inode
, loff_t offset
,
1397 unsigned int max_blocks
, int ret
),
1399 TP_ARGS(inode
, offset
, max_blocks
, ret
),
1402 __field( dev_t
, dev
)
1403 __field( ino_t
, ino
)
1404 __field( loff_t
, pos
)
1405 __field( unsigned int, blocks
)
1410 __entry
->dev
= inode
->i_sb
->s_dev
;
1411 __entry
->ino
= inode
->i_ino
;
1412 __entry
->pos
= offset
;
1413 __entry
->blocks
= max_blocks
;
1417 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
1418 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1419 (unsigned long) __entry
->ino
,
1420 __entry
->pos
, __entry
->blocks
,
1424 TRACE_EVENT(ext4_unlink_enter
,
1425 TP_PROTO(struct inode
*parent
, struct dentry
*dentry
),
1427 TP_ARGS(parent
, dentry
),
1430 __field( dev_t
, dev
)
1431 __field( ino_t
, ino
)
1432 __field( ino_t
, parent
)
1433 __field( loff_t
, size
)
1437 __entry
->dev
= dentry
->d_sb
->s_dev
;
1438 __entry
->ino
= d_inode(dentry
)->i_ino
;
1439 __entry
->parent
= parent
->i_ino
;
1440 __entry
->size
= d_inode(dentry
)->i_size
;
1443 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
1444 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1445 (unsigned long) __entry
->ino
, __entry
->size
,
1446 (unsigned long) __entry
->parent
)
1449 TRACE_EVENT(ext4_unlink_exit
,
1450 TP_PROTO(struct dentry
*dentry
, int ret
),
1452 TP_ARGS(dentry
, ret
),
1455 __field( dev_t
, dev
)
1456 __field( ino_t
, ino
)
1461 __entry
->dev
= dentry
->d_sb
->s_dev
;
1462 __entry
->ino
= d_inode(dentry
)->i_ino
;
1466 TP_printk("dev %d,%d ino %lu ret %d",
1467 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1468 (unsigned long) __entry
->ino
,
1472 DECLARE_EVENT_CLASS(ext4__truncate
,
1473 TP_PROTO(struct inode
*inode
),
1478 __field( dev_t
, dev
)
1479 __field( ino_t
, ino
)
1480 __field( __u64
, blocks
)
1484 __entry
->dev
= inode
->i_sb
->s_dev
;
1485 __entry
->ino
= inode
->i_ino
;
1486 __entry
->blocks
= inode
->i_blocks
;
1489 TP_printk("dev %d,%d ino %lu blocks %llu",
1490 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1491 (unsigned long) __entry
->ino
, __entry
->blocks
)
1494 DEFINE_EVENT(ext4__truncate
, ext4_truncate_enter
,
1496 TP_PROTO(struct inode
*inode
),
1501 DEFINE_EVENT(ext4__truncate
, ext4_truncate_exit
,
1503 TP_PROTO(struct inode
*inode
),
1508 /* 'ux' is the unwritten extent. */
1509 TRACE_EVENT(ext4_ext_convert_to_initialized_enter
,
1510 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
,
1511 struct ext4_extent
*ux
),
1513 TP_ARGS(inode
, map
, ux
),
1516 __field( dev_t
, dev
)
1517 __field( ino_t
, ino
)
1518 __field( ext4_lblk_t
, m_lblk
)
1519 __field( unsigned, m_len
)
1520 __field( ext4_lblk_t
, u_lblk
)
1521 __field( unsigned, u_len
)
1522 __field( ext4_fsblk_t
, u_pblk
)
1526 __entry
->dev
= inode
->i_sb
->s_dev
;
1527 __entry
->ino
= inode
->i_ino
;
1528 __entry
->m_lblk
= map
->m_lblk
;
1529 __entry
->m_len
= map
->m_len
;
1530 __entry
->u_lblk
= le32_to_cpu(ux
->ee_block
);
1531 __entry
->u_len
= ext4_ext_get_actual_len(ux
);
1532 __entry
->u_pblk
= ext4_ext_pblock(ux
);
1535 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1537 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1538 (unsigned long) __entry
->ino
,
1539 __entry
->m_lblk
, __entry
->m_len
,
1540 __entry
->u_lblk
, __entry
->u_len
, __entry
->u_pblk
)
1544 * 'ux' is the unwritten extent.
1545 * 'ix' is the initialized extent to which blocks are transferred.
1547 TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath
,
1548 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
,
1549 struct ext4_extent
*ux
, struct ext4_extent
*ix
),
1551 TP_ARGS(inode
, map
, ux
, ix
),
1554 __field( dev_t
, dev
)
1555 __field( ino_t
, ino
)
1556 __field( ext4_lblk_t
, m_lblk
)
1557 __field( unsigned, m_len
)
1558 __field( ext4_lblk_t
, u_lblk
)
1559 __field( unsigned, u_len
)
1560 __field( ext4_fsblk_t
, u_pblk
)
1561 __field( ext4_lblk_t
, i_lblk
)
1562 __field( unsigned, i_len
)
1563 __field( ext4_fsblk_t
, i_pblk
)
1567 __entry
->dev
= inode
->i_sb
->s_dev
;
1568 __entry
->ino
= inode
->i_ino
;
1569 __entry
->m_lblk
= map
->m_lblk
;
1570 __entry
->m_len
= map
->m_len
;
1571 __entry
->u_lblk
= le32_to_cpu(ux
->ee_block
);
1572 __entry
->u_len
= ext4_ext_get_actual_len(ux
);
1573 __entry
->u_pblk
= ext4_ext_pblock(ux
);
1574 __entry
->i_lblk
= le32_to_cpu(ix
->ee_block
);
1575 __entry
->i_len
= ext4_ext_get_actual_len(ix
);
1576 __entry
->i_pblk
= ext4_ext_pblock(ix
);
1579 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1580 "u_lblk %u u_len %u u_pblk %llu "
1581 "i_lblk %u i_len %u i_pblk %llu ",
1582 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1583 (unsigned long) __entry
->ino
,
1584 __entry
->m_lblk
, __entry
->m_len
,
1585 __entry
->u_lblk
, __entry
->u_len
, __entry
->u_pblk
,
1586 __entry
->i_lblk
, __entry
->i_len
, __entry
->i_pblk
)
1589 DECLARE_EVENT_CLASS(ext4__map_blocks_enter
,
1590 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1591 unsigned int len
, unsigned int flags
),
1593 TP_ARGS(inode
, lblk
, len
, flags
),
1596 __field( dev_t
, dev
)
1597 __field( ino_t
, ino
)
1598 __field( ext4_lblk_t
, lblk
)
1599 __field( unsigned int, len
)
1600 __field( unsigned int, flags
)
1604 __entry
->dev
= inode
->i_sb
->s_dev
;
1605 __entry
->ino
= inode
->i_ino
;
1606 __entry
->lblk
= lblk
;
1608 __entry
->flags
= flags
;
1611 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
1612 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1613 (unsigned long) __entry
->ino
,
1614 __entry
->lblk
, __entry
->len
, show_map_flags(__entry
->flags
))
1617 DEFINE_EVENT(ext4__map_blocks_enter
, ext4_ext_map_blocks_enter
,
1618 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1619 unsigned len
, unsigned flags
),
1621 TP_ARGS(inode
, lblk
, len
, flags
)
1624 DEFINE_EVENT(ext4__map_blocks_enter
, ext4_ind_map_blocks_enter
,
1625 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1626 unsigned len
, unsigned flags
),
1628 TP_ARGS(inode
, lblk
, len
, flags
)
1631 DECLARE_EVENT_CLASS(ext4__map_blocks_exit
,
1632 TP_PROTO(struct inode
*inode
, unsigned flags
, struct ext4_map_blocks
*map
,
1635 TP_ARGS(inode
, flags
, map
, ret
),
1638 __field( dev_t
, dev
)
1639 __field( ino_t
, ino
)
1640 __field( unsigned int, flags
)
1641 __field( ext4_fsblk_t
, pblk
)
1642 __field( ext4_lblk_t
, lblk
)
1643 __field( unsigned int, len
)
1644 __field( unsigned int, mflags
)
1649 __entry
->dev
= inode
->i_sb
->s_dev
;
1650 __entry
->ino
= inode
->i_ino
;
1651 __entry
->flags
= flags
;
1652 __entry
->pblk
= map
->m_pblk
;
1653 __entry
->lblk
= map
->m_lblk
;
1654 __entry
->len
= map
->m_len
;
1655 __entry
->mflags
= map
->m_flags
;
1659 TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
1661 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1662 (unsigned long) __entry
->ino
,
1663 show_map_flags(__entry
->flags
), __entry
->lblk
, __entry
->pblk
,
1664 __entry
->len
, show_mflags(__entry
->mflags
), __entry
->ret
)
1667 DEFINE_EVENT(ext4__map_blocks_exit
, ext4_ext_map_blocks_exit
,
1668 TP_PROTO(struct inode
*inode
, unsigned flags
,
1669 struct ext4_map_blocks
*map
, int ret
),
1671 TP_ARGS(inode
, flags
, map
, ret
)
1674 DEFINE_EVENT(ext4__map_blocks_exit
, ext4_ind_map_blocks_exit
,
1675 TP_PROTO(struct inode
*inode
, unsigned flags
,
1676 struct ext4_map_blocks
*map
, int ret
),
1678 TP_ARGS(inode
, flags
, map
, ret
)
1681 TRACE_EVENT(ext4_ext_load_extent
,
1682 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_fsblk_t pblk
),
1684 TP_ARGS(inode
, lblk
, pblk
),
1687 __field( dev_t
, dev
)
1688 __field( ino_t
, ino
)
1689 __field( ext4_fsblk_t
, pblk
)
1690 __field( ext4_lblk_t
, lblk
)
1694 __entry
->dev
= inode
->i_sb
->s_dev
;
1695 __entry
->ino
= inode
->i_ino
;
1696 __entry
->pblk
= pblk
;
1697 __entry
->lblk
= lblk
;
1700 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1701 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1702 (unsigned long) __entry
->ino
,
1703 __entry
->lblk
, __entry
->pblk
)
1706 TRACE_EVENT(ext4_load_inode
,
1707 TP_PROTO(struct inode
*inode
),
1712 __field( dev_t
, dev
)
1713 __field( ino_t
, ino
)
1717 __entry
->dev
= inode
->i_sb
->s_dev
;
1718 __entry
->ino
= inode
->i_ino
;
1721 TP_printk("dev %d,%d ino %ld",
1722 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1723 (unsigned long) __entry
->ino
)
1726 TRACE_EVENT(ext4_journal_start
,
1727 TP_PROTO(struct super_block
*sb
, int blocks
, int rsv_blocks
,
1730 TP_ARGS(sb
, blocks
, rsv_blocks
, IP
),
1733 __field( dev_t
, dev
)
1734 __field(unsigned long, ip
)
1735 __field( int, blocks
)
1736 __field( int, rsv_blocks
)
1740 __entry
->dev
= sb
->s_dev
;
1742 __entry
->blocks
= blocks
;
1743 __entry
->rsv_blocks
= rsv_blocks
;
1746 TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pS",
1747 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1748 __entry
->blocks
, __entry
->rsv_blocks
, (void *)__entry
->ip
)
1751 TRACE_EVENT(ext4_journal_start_reserved
,
1752 TP_PROTO(struct super_block
*sb
, int blocks
, unsigned long IP
),
1754 TP_ARGS(sb
, blocks
, IP
),
1757 __field( dev_t
, dev
)
1758 __field(unsigned long, ip
)
1759 __field( int, blocks
)
1763 __entry
->dev
= sb
->s_dev
;
1765 __entry
->blocks
= blocks
;
1768 TP_printk("dev %d,%d blocks, %d caller %pS",
1769 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1770 __entry
->blocks
, (void *)__entry
->ip
)
1773 DECLARE_EVENT_CLASS(ext4__trim
,
1774 TP_PROTO(struct super_block
*sb
,
1776 ext4_grpblk_t start
,
1779 TP_ARGS(sb
, group
, start
, len
),
1782 __field( int, dev_major
)
1783 __field( int, dev_minor
)
1784 __field( __u32
, group
)
1785 __field( int, start
)
1790 __entry
->dev_major
= MAJOR(sb
->s_dev
);
1791 __entry
->dev_minor
= MINOR(sb
->s_dev
);
1792 __entry
->group
= group
;
1793 __entry
->start
= start
;
1797 TP_printk("dev %d,%d group %u, start %d, len %d",
1798 __entry
->dev_major
, __entry
->dev_minor
,
1799 __entry
->group
, __entry
->start
, __entry
->len
)
1802 DEFINE_EVENT(ext4__trim
, ext4_trim_extent
,
1804 TP_PROTO(struct super_block
*sb
,
1806 ext4_grpblk_t start
,
1809 TP_ARGS(sb
, group
, start
, len
)
1812 DEFINE_EVENT(ext4__trim
, ext4_trim_all_free
,
1814 TP_PROTO(struct super_block
*sb
,
1816 ext4_grpblk_t start
,
1819 TP_ARGS(sb
, group
, start
, len
)
1822 TRACE_EVENT(ext4_ext_handle_unwritten_extents
,
1823 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
, int flags
,
1824 unsigned int allocated
, ext4_fsblk_t newblock
),
1826 TP_ARGS(inode
, map
, flags
, allocated
, newblock
),
1829 __field( dev_t
, dev
)
1830 __field( ino_t
, ino
)
1831 __field( int, flags
)
1832 __field( ext4_lblk_t
, lblk
)
1833 __field( ext4_fsblk_t
, pblk
)
1834 __field( unsigned int, len
)
1835 __field( unsigned int, allocated
)
1836 __field( ext4_fsblk_t
, newblk
)
1840 __entry
->dev
= inode
->i_sb
->s_dev
;
1841 __entry
->ino
= inode
->i_ino
;
1842 __entry
->flags
= flags
;
1843 __entry
->lblk
= map
->m_lblk
;
1844 __entry
->pblk
= map
->m_pblk
;
1845 __entry
->len
= map
->m_len
;
1846 __entry
->allocated
= allocated
;
1847 __entry
->newblk
= newblock
;
1850 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %s "
1851 "allocated %d newblock %llu",
1852 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1853 (unsigned long) __entry
->ino
,
1854 (unsigned) __entry
->lblk
, (unsigned long long) __entry
->pblk
,
1855 __entry
->len
, show_map_flags(__entry
->flags
),
1856 (unsigned int) __entry
->allocated
,
1857 (unsigned long long) __entry
->newblk
)
1860 TRACE_EVENT(ext4_get_implied_cluster_alloc_exit
,
1861 TP_PROTO(struct super_block
*sb
, struct ext4_map_blocks
*map
, int ret
),
1863 TP_ARGS(sb
, map
, ret
),
1866 __field( dev_t
, dev
)
1867 __field( unsigned int, flags
)
1868 __field( ext4_lblk_t
, lblk
)
1869 __field( ext4_fsblk_t
, pblk
)
1870 __field( unsigned int, len
)
1875 __entry
->dev
= sb
->s_dev
;
1876 __entry
->flags
= map
->m_flags
;
1877 __entry
->lblk
= map
->m_lblk
;
1878 __entry
->pblk
= map
->m_pblk
;
1879 __entry
->len
= map
->m_len
;
1883 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %s ret %d",
1884 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1885 __entry
->lblk
, (unsigned long long) __entry
->pblk
,
1886 __entry
->len
, show_mflags(__entry
->flags
), __entry
->ret
)
1889 TRACE_EVENT(ext4_ext_put_in_cache
,
1890 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, unsigned int len
,
1891 ext4_fsblk_t start
),
1893 TP_ARGS(inode
, lblk
, len
, start
),
1896 __field( dev_t
, dev
)
1897 __field( ino_t
, ino
)
1898 __field( ext4_lblk_t
, lblk
)
1899 __field( unsigned int, len
)
1900 __field( ext4_fsblk_t
, start
)
1904 __entry
->dev
= inode
->i_sb
->s_dev
;
1905 __entry
->ino
= inode
->i_ino
;
1906 __entry
->lblk
= lblk
;
1908 __entry
->start
= start
;
1911 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1912 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1913 (unsigned long) __entry
->ino
,
1914 (unsigned) __entry
->lblk
,
1916 (unsigned long long) __entry
->start
)
1919 TRACE_EVENT(ext4_ext_in_cache
,
1920 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, int ret
),
1922 TP_ARGS(inode
, lblk
, ret
),
1925 __field( dev_t
, dev
)
1926 __field( ino_t
, ino
)
1927 __field( ext4_lblk_t
, lblk
)
1932 __entry
->dev
= inode
->i_sb
->s_dev
;
1933 __entry
->ino
= inode
->i_ino
;
1934 __entry
->lblk
= lblk
;
1938 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1939 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1940 (unsigned long) __entry
->ino
,
1941 (unsigned) __entry
->lblk
,
1946 TRACE_EVENT(ext4_find_delalloc_range
,
1947 TP_PROTO(struct inode
*inode
, ext4_lblk_t from
, ext4_lblk_t to
,
1948 int reverse
, int found
, ext4_lblk_t found_blk
),
1950 TP_ARGS(inode
, from
, to
, reverse
, found
, found_blk
),
1953 __field( dev_t
, dev
)
1954 __field( ino_t
, ino
)
1955 __field( ext4_lblk_t
, from
)
1956 __field( ext4_lblk_t
, to
)
1957 __field( int, reverse
)
1958 __field( int, found
)
1959 __field( ext4_lblk_t
, found_blk
)
1963 __entry
->dev
= inode
->i_sb
->s_dev
;
1964 __entry
->ino
= inode
->i_ino
;
1965 __entry
->from
= from
;
1967 __entry
->reverse
= reverse
;
1968 __entry
->found
= found
;
1969 __entry
->found_blk
= found_blk
;
1972 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1974 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1975 (unsigned long) __entry
->ino
,
1976 (unsigned) __entry
->from
, (unsigned) __entry
->to
,
1977 __entry
->reverse
, __entry
->found
,
1978 (unsigned) __entry
->found_blk
)
1981 TRACE_EVENT(ext4_get_reserved_cluster_alloc
,
1982 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, unsigned int len
),
1984 TP_ARGS(inode
, lblk
, len
),
1987 __field( dev_t
, dev
)
1988 __field( ino_t
, ino
)
1989 __field( ext4_lblk_t
, lblk
)
1990 __field( unsigned int, len
)
1994 __entry
->dev
= inode
->i_sb
->s_dev
;
1995 __entry
->ino
= inode
->i_ino
;
1996 __entry
->lblk
= lblk
;
2000 TP_printk("dev %d,%d ino %lu lblk %u len %u",
2001 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2002 (unsigned long) __entry
->ino
,
2003 (unsigned) __entry
->lblk
,
2007 TRACE_EVENT(ext4_ext_show_extent
,
2008 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_fsblk_t pblk
,
2009 unsigned short len
),
2011 TP_ARGS(inode
, lblk
, pblk
, len
),
2014 __field( dev_t
, dev
)
2015 __field( ino_t
, ino
)
2016 __field( ext4_fsblk_t
, pblk
)
2017 __field( ext4_lblk_t
, lblk
)
2018 __field( unsigned short, len
)
2022 __entry
->dev
= inode
->i_sb
->s_dev
;
2023 __entry
->ino
= inode
->i_ino
;
2024 __entry
->pblk
= pblk
;
2025 __entry
->lblk
= lblk
;
2029 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
2030 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2031 (unsigned long) __entry
->ino
,
2032 (unsigned) __entry
->lblk
,
2033 (unsigned long long) __entry
->pblk
,
2034 (unsigned short) __entry
->len
)
2037 TRACE_EVENT(ext4_remove_blocks
,
2038 TP_PROTO(struct inode
*inode
, struct ext4_extent
*ex
,
2039 ext4_lblk_t from
, ext4_fsblk_t to
,
2040 long long partial_cluster
),
2042 TP_ARGS(inode
, ex
, from
, to
, partial_cluster
),
2045 __field( dev_t
, dev
)
2046 __field( ino_t
, ino
)
2047 __field( ext4_lblk_t
, from
)
2048 __field( ext4_lblk_t
, to
)
2049 __field( long long, partial
)
2050 __field( ext4_fsblk_t
, ee_pblk
)
2051 __field( ext4_lblk_t
, ee_lblk
)
2052 __field( unsigned short, ee_len
)
2056 __entry
->dev
= inode
->i_sb
->s_dev
;
2057 __entry
->ino
= inode
->i_ino
;
2058 __entry
->from
= from
;
2060 __entry
->partial
= partial_cluster
;
2061 __entry
->ee_pblk
= ext4_ext_pblock(ex
);
2062 __entry
->ee_lblk
= le32_to_cpu(ex
->ee_block
);
2063 __entry
->ee_len
= ext4_ext_get_actual_len(ex
);
2066 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
2067 "from %u to %u partial_cluster %lld",
2068 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2069 (unsigned long) __entry
->ino
,
2070 (unsigned) __entry
->ee_lblk
,
2071 (unsigned long long) __entry
->ee_pblk
,
2072 (unsigned short) __entry
->ee_len
,
2073 (unsigned) __entry
->from
,
2074 (unsigned) __entry
->to
,
2075 (long long) __entry
->partial
)
2078 TRACE_EVENT(ext4_ext_rm_leaf
,
2079 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
,
2080 struct ext4_extent
*ex
,
2081 long long partial_cluster
),
2083 TP_ARGS(inode
, start
, ex
, partial_cluster
),
2086 __field( dev_t
, dev
)
2087 __field( ino_t
, ino
)
2088 __field( long long, partial
)
2089 __field( ext4_lblk_t
, start
)
2090 __field( ext4_lblk_t
, ee_lblk
)
2091 __field( ext4_fsblk_t
, ee_pblk
)
2092 __field( short, ee_len
)
2096 __entry
->dev
= inode
->i_sb
->s_dev
;
2097 __entry
->ino
= inode
->i_ino
;
2098 __entry
->partial
= partial_cluster
;
2099 __entry
->start
= start
;
2100 __entry
->ee_lblk
= le32_to_cpu(ex
->ee_block
);
2101 __entry
->ee_pblk
= ext4_ext_pblock(ex
);
2102 __entry
->ee_len
= ext4_ext_get_actual_len(ex
);
2105 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
2106 "partial_cluster %lld",
2107 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2108 (unsigned long) __entry
->ino
,
2109 (unsigned) __entry
->start
,
2110 (unsigned) __entry
->ee_lblk
,
2111 (unsigned long long) __entry
->ee_pblk
,
2112 (unsigned short) __entry
->ee_len
,
2113 (long long) __entry
->partial
)
2116 TRACE_EVENT(ext4_ext_rm_idx
,
2117 TP_PROTO(struct inode
*inode
, ext4_fsblk_t pblk
),
2119 TP_ARGS(inode
, pblk
),
2122 __field( dev_t
, dev
)
2123 __field( ino_t
, ino
)
2124 __field( ext4_fsblk_t
, pblk
)
2128 __entry
->dev
= inode
->i_sb
->s_dev
;
2129 __entry
->ino
= inode
->i_ino
;
2130 __entry
->pblk
= pblk
;
2133 TP_printk("dev %d,%d ino %lu index_pblk %llu",
2134 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2135 (unsigned long) __entry
->ino
,
2136 (unsigned long long) __entry
->pblk
)
2139 TRACE_EVENT(ext4_ext_remove_space
,
2140 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
,
2141 ext4_lblk_t end
, int depth
),
2143 TP_ARGS(inode
, start
, end
, depth
),
2146 __field( dev_t
, dev
)
2147 __field( ino_t
, ino
)
2148 __field( ext4_lblk_t
, start
)
2149 __field( ext4_lblk_t
, end
)
2150 __field( int, depth
)
2154 __entry
->dev
= inode
->i_sb
->s_dev
;
2155 __entry
->ino
= inode
->i_ino
;
2156 __entry
->start
= start
;
2158 __entry
->depth
= depth
;
2161 TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
2162 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2163 (unsigned long) __entry
->ino
,
2164 (unsigned) __entry
->start
,
2165 (unsigned) __entry
->end
,
2169 TRACE_EVENT(ext4_ext_remove_space_done
,
2170 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
, ext4_lblk_t end
,
2171 int depth
, long long partial
, __le16 eh_entries
),
2173 TP_ARGS(inode
, start
, end
, depth
, partial
, eh_entries
),
2176 __field( dev_t
, dev
)
2177 __field( ino_t
, ino
)
2178 __field( ext4_lblk_t
, start
)
2179 __field( ext4_lblk_t
, end
)
2180 __field( int, depth
)
2181 __field( long long, partial
)
2182 __field( unsigned short, eh_entries
)
2186 __entry
->dev
= inode
->i_sb
->s_dev
;
2187 __entry
->ino
= inode
->i_ino
;
2188 __entry
->start
= start
;
2190 __entry
->depth
= depth
;
2191 __entry
->partial
= partial
;
2192 __entry
->eh_entries
= le16_to_cpu(eh_entries
);
2195 TP_printk("dev %d,%d ino %lu since %u end %u depth %d partial %lld "
2196 "remaining_entries %u",
2197 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2198 (unsigned long) __entry
->ino
,
2199 (unsigned) __entry
->start
,
2200 (unsigned) __entry
->end
,
2202 (long long) __entry
->partial
,
2203 (unsigned short) __entry
->eh_entries
)
2206 DECLARE_EVENT_CLASS(ext4__es_extent
,
2207 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2212 __field( dev_t
, dev
)
2213 __field( ino_t
, ino
)
2214 __field( ext4_lblk_t
, lblk
)
2215 __field( ext4_lblk_t
, len
)
2216 __field( ext4_fsblk_t
, pblk
)
2217 __field( char, status
)
2221 __entry
->dev
= inode
->i_sb
->s_dev
;
2222 __entry
->ino
= inode
->i_ino
;
2223 __entry
->lblk
= es
->es_lblk
;
2224 __entry
->len
= es
->es_len
;
2225 __entry
->pblk
= ext4_es_pblock(es
);
2226 __entry
->status
= ext4_es_status(es
);
2229 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
2230 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2231 (unsigned long) __entry
->ino
,
2232 __entry
->lblk
, __entry
->len
,
2233 __entry
->pblk
, show_extent_status(__entry
->status
))
2236 DEFINE_EVENT(ext4__es_extent
, ext4_es_insert_extent
,
2237 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2242 DEFINE_EVENT(ext4__es_extent
, ext4_es_cache_extent
,
2243 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2248 TRACE_EVENT(ext4_es_remove_extent
,
2249 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_lblk_t len
),
2251 TP_ARGS(inode
, lblk
, len
),
2254 __field( dev_t
, dev
)
2255 __field( ino_t
, ino
)
2256 __field( loff_t
, lblk
)
2257 __field( loff_t
, len
)
2261 __entry
->dev
= inode
->i_sb
->s_dev
;
2262 __entry
->ino
= inode
->i_ino
;
2263 __entry
->lblk
= lblk
;
2267 TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
2268 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2269 (unsigned long) __entry
->ino
,
2270 __entry
->lblk
, __entry
->len
)
2273 TRACE_EVENT(ext4_es_find_delayed_extent_range_enter
,
2274 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
),
2276 TP_ARGS(inode
, lblk
),
2279 __field( dev_t
, dev
)
2280 __field( ino_t
, ino
)
2281 __field( ext4_lblk_t
, lblk
)
2285 __entry
->dev
= inode
->i_sb
->s_dev
;
2286 __entry
->ino
= inode
->i_ino
;
2287 __entry
->lblk
= lblk
;
2290 TP_printk("dev %d,%d ino %lu lblk %u",
2291 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2292 (unsigned long) __entry
->ino
, __entry
->lblk
)
2295 TRACE_EVENT(ext4_es_find_delayed_extent_range_exit
,
2296 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2301 __field( dev_t
, dev
)
2302 __field( ino_t
, ino
)
2303 __field( ext4_lblk_t
, lblk
)
2304 __field( ext4_lblk_t
, len
)
2305 __field( ext4_fsblk_t
, pblk
)
2306 __field( char, status
)
2310 __entry
->dev
= inode
->i_sb
->s_dev
;
2311 __entry
->ino
= inode
->i_ino
;
2312 __entry
->lblk
= es
->es_lblk
;
2313 __entry
->len
= es
->es_len
;
2314 __entry
->pblk
= ext4_es_pblock(es
);
2315 __entry
->status
= ext4_es_status(es
);
2318 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
2319 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2320 (unsigned long) __entry
->ino
,
2321 __entry
->lblk
, __entry
->len
,
2322 __entry
->pblk
, show_extent_status(__entry
->status
))
2325 TRACE_EVENT(ext4_es_lookup_extent_enter
,
2326 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
),
2328 TP_ARGS(inode
, lblk
),
2331 __field( dev_t
, dev
)
2332 __field( ino_t
, ino
)
2333 __field( ext4_lblk_t
, lblk
)
2337 __entry
->dev
= inode
->i_sb
->s_dev
;
2338 __entry
->ino
= inode
->i_ino
;
2339 __entry
->lblk
= lblk
;
2342 TP_printk("dev %d,%d ino %lu lblk %u",
2343 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2344 (unsigned long) __entry
->ino
, __entry
->lblk
)
2347 TRACE_EVENT(ext4_es_lookup_extent_exit
,
2348 TP_PROTO(struct inode
*inode
, struct extent_status
*es
,
2351 TP_ARGS(inode
, es
, found
),
2354 __field( dev_t
, dev
)
2355 __field( ino_t
, ino
)
2356 __field( ext4_lblk_t
, lblk
)
2357 __field( ext4_lblk_t
, len
)
2358 __field( ext4_fsblk_t
, pblk
)
2359 __field( char, status
)
2360 __field( int, found
)
2364 __entry
->dev
= inode
->i_sb
->s_dev
;
2365 __entry
->ino
= inode
->i_ino
;
2366 __entry
->lblk
= es
->es_lblk
;
2367 __entry
->len
= es
->es_len
;
2368 __entry
->pblk
= ext4_es_pblock(es
);
2369 __entry
->status
= ext4_es_status(es
);
2370 __entry
->found
= found
;
2373 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
2374 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2375 (unsigned long) __entry
->ino
, __entry
->found
,
2376 __entry
->lblk
, __entry
->len
,
2377 __entry
->found
? __entry
->pblk
: 0,
2378 show_extent_status(__entry
->found
? __entry
->status
: 0))
2381 DECLARE_EVENT_CLASS(ext4__es_shrink_enter
,
2382 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2384 TP_ARGS(sb
, nr_to_scan
, cache_cnt
),
2387 __field( dev_t
, dev
)
2388 __field( int, nr_to_scan
)
2389 __field( int, cache_cnt
)
2393 __entry
->dev
= sb
->s_dev
;
2394 __entry
->nr_to_scan
= nr_to_scan
;
2395 __entry
->cache_cnt
= cache_cnt
;
2398 TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
2399 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2400 __entry
->nr_to_scan
, __entry
->cache_cnt
)
2403 DEFINE_EVENT(ext4__es_shrink_enter
, ext4_es_shrink_count
,
2404 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2406 TP_ARGS(sb
, nr_to_scan
, cache_cnt
)
2409 DEFINE_EVENT(ext4__es_shrink_enter
, ext4_es_shrink_scan_enter
,
2410 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2412 TP_ARGS(sb
, nr_to_scan
, cache_cnt
)
2415 TRACE_EVENT(ext4_es_shrink_scan_exit
,
2416 TP_PROTO(struct super_block
*sb
, int nr_shrunk
, int cache_cnt
),
2418 TP_ARGS(sb
, nr_shrunk
, cache_cnt
),
2421 __field( dev_t
, dev
)
2422 __field( int, nr_shrunk
)
2423 __field( int, cache_cnt
)
2427 __entry
->dev
= sb
->s_dev
;
2428 __entry
->nr_shrunk
= nr_shrunk
;
2429 __entry
->cache_cnt
= cache_cnt
;
2432 TP_printk("dev %d,%d nr_shrunk %d cache_cnt %d",
2433 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2434 __entry
->nr_shrunk
, __entry
->cache_cnt
)
2437 TRACE_EVENT(ext4_collapse_range
,
2438 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
),
2440 TP_ARGS(inode
, offset
, len
),
2445 __field(loff_t
, offset
)
2446 __field(loff_t
, len
)
2450 __entry
->dev
= inode
->i_sb
->s_dev
;
2451 __entry
->ino
= inode
->i_ino
;
2452 __entry
->offset
= offset
;
2456 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2457 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2458 (unsigned long) __entry
->ino
,
2459 __entry
->offset
, __entry
->len
)
2462 TRACE_EVENT(ext4_insert_range
,
2463 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
),
2465 TP_ARGS(inode
, offset
, len
),
2470 __field(loff_t
, offset
)
2471 __field(loff_t
, len
)
2475 __entry
->dev
= inode
->i_sb
->s_dev
;
2476 __entry
->ino
= inode
->i_ino
;
2477 __entry
->offset
= offset
;
2481 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2482 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2483 (unsigned long) __entry
->ino
,
2484 __entry
->offset
, __entry
->len
)
2487 TRACE_EVENT(ext4_es_shrink
,
2488 TP_PROTO(struct super_block
*sb
, int nr_shrunk
, u64 scan_time
,
2489 int nr_skipped
, int retried
),
2491 TP_ARGS(sb
, nr_shrunk
, scan_time
, nr_skipped
, retried
),
2494 __field( dev_t
, dev
)
2495 __field( int, nr_shrunk
)
2496 __field( unsigned long long, scan_time
)
2497 __field( int, nr_skipped
)
2498 __field( int, retried
)
2502 __entry
->dev
= sb
->s_dev
;
2503 __entry
->nr_shrunk
= nr_shrunk
;
2504 __entry
->scan_time
= div_u64(scan_time
, 1000);
2505 __entry
->nr_skipped
= nr_skipped
;
2506 __entry
->retried
= retried
;
2509 TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu "
2510 "nr_skipped %d retried %d",
2511 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->nr_shrunk
,
2512 __entry
->scan_time
, __entry
->nr_skipped
, __entry
->retried
)
2516 DECLARE_EVENT_CLASS(ext4_fsmap_class
,
2517 TP_PROTO(struct super_block
*sb
, u32 keydev
, u32 agno
, u64 bno
, u64 len
,
2519 TP_ARGS(sb
, keydev
, agno
, bno
, len
, owner
),
2522 __field(dev_t
, keydev
)
2529 __entry
->dev
= sb
->s_bdev
->bd_dev
;
2530 __entry
->keydev
= new_decode_dev(keydev
);
2531 __entry
->agno
= agno
;
2534 __entry
->owner
= owner
;
2536 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld\n",
2537 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2538 MAJOR(__entry
->keydev
), MINOR(__entry
->keydev
),
2544 #define DEFINE_FSMAP_EVENT(name) \
2545 DEFINE_EVENT(ext4_fsmap_class, name, \
2546 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len, \
2548 TP_ARGS(sb, keydev, agno, bno, len, owner))
2549 DEFINE_FSMAP_EVENT(ext4_fsmap_low_key
);
2550 DEFINE_FSMAP_EVENT(ext4_fsmap_high_key
);
2551 DEFINE_FSMAP_EVENT(ext4_fsmap_mapping
);
2553 DECLARE_EVENT_CLASS(ext4_getfsmap_class
,
2554 TP_PROTO(struct super_block
*sb
, struct ext4_fsmap
*fsmap
),
2558 __field(dev_t
, keydev
)
2565 __entry
->dev
= sb
->s_bdev
->bd_dev
;
2566 __entry
->keydev
= new_decode_dev(fsmap
->fmr_device
);
2567 __entry
->block
= fsmap
->fmr_physical
;
2568 __entry
->len
= fsmap
->fmr_length
;
2569 __entry
->owner
= fsmap
->fmr_owner
;
2570 __entry
->flags
= fsmap
->fmr_flags
;
2572 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld flags 0x%llx\n",
2573 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2574 MAJOR(__entry
->keydev
), MINOR(__entry
->keydev
),
2580 #define DEFINE_GETFSMAP_EVENT(name) \
2581 DEFINE_EVENT(ext4_getfsmap_class, name, \
2582 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap), \
2584 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_low_key
);
2585 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_high_key
);
2586 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_mapping
);
2588 #endif /* _TRACE_EXT4_H */
2590 /* This part must be outside protection */
2591 #include <trace/define_trace.h>