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
;
20 struct partial_cluster
;
22 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
24 #define show_mballoc_flags(flags) __print_flags(flags, "|", \
25 { EXT4_MB_HINT_MERGE, "HINT_MERGE" }, \
26 { EXT4_MB_HINT_RESERVED, "HINT_RESV" }, \
27 { EXT4_MB_HINT_METADATA, "HINT_MDATA" }, \
28 { EXT4_MB_HINT_FIRST, "HINT_FIRST" }, \
29 { EXT4_MB_HINT_BEST, "HINT_BEST" }, \
30 { EXT4_MB_HINT_DATA, "HINT_DATA" }, \
31 { EXT4_MB_HINT_NOPREALLOC, "HINT_NOPREALLOC" }, \
32 { EXT4_MB_HINT_GROUP_ALLOC, "HINT_GRP_ALLOC" }, \
33 { EXT4_MB_HINT_GOAL_ONLY, "HINT_GOAL_ONLY" }, \
34 { EXT4_MB_HINT_TRY_GOAL, "HINT_TRY_GOAL" }, \
35 { EXT4_MB_DELALLOC_RESERVED, "DELALLOC_RESV" }, \
36 { EXT4_MB_STREAM_ALLOC, "STREAM_ALLOC" }, \
37 { EXT4_MB_USE_ROOT_BLOCKS, "USE_ROOT_BLKS" }, \
38 { EXT4_MB_USE_RESERVED, "USE_RESV" })
40 #define show_map_flags(flags) __print_flags(flags, "|", \
41 { EXT4_GET_BLOCKS_CREATE, "CREATE" }, \
42 { EXT4_GET_BLOCKS_UNWRIT_EXT, "UNWRIT" }, \
43 { EXT4_GET_BLOCKS_DELALLOC_RESERVE, "DELALLOC" }, \
44 { EXT4_GET_BLOCKS_PRE_IO, "PRE_IO" }, \
45 { EXT4_GET_BLOCKS_CONVERT, "CONVERT" }, \
46 { EXT4_GET_BLOCKS_METADATA_NOFAIL, "METADATA_NOFAIL" }, \
47 { EXT4_GET_BLOCKS_NO_NORMALIZE, "NO_NORMALIZE" }, \
48 { EXT4_GET_BLOCKS_KEEP_SIZE, "KEEP_SIZE" }, \
49 { EXT4_GET_BLOCKS_ZERO, "ZERO" })
52 * __print_flags() requires that all enum values be wrapped in the
53 * TRACE_DEFINE_ENUM macro so that the enum value can be encoded in the ftrace
56 TRACE_DEFINE_ENUM(BH_New
);
57 TRACE_DEFINE_ENUM(BH_Mapped
);
58 TRACE_DEFINE_ENUM(BH_Unwritten
);
59 TRACE_DEFINE_ENUM(BH_Boundary
);
61 #define show_mflags(flags) __print_flags(flags, "", \
62 { EXT4_MAP_NEW, "N" }, \
63 { EXT4_MAP_MAPPED, "M" }, \
64 { EXT4_MAP_UNWRITTEN, "U" }, \
65 { EXT4_MAP_BOUNDARY, "B" })
67 #define show_free_flags(flags) __print_flags(flags, "|", \
68 { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \
69 { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \
70 { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \
71 { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \
72 { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
73 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
75 TRACE_DEFINE_ENUM(ES_WRITTEN_B
);
76 TRACE_DEFINE_ENUM(ES_UNWRITTEN_B
);
77 TRACE_DEFINE_ENUM(ES_DELAYED_B
);
78 TRACE_DEFINE_ENUM(ES_HOLE_B
);
79 TRACE_DEFINE_ENUM(ES_REFERENCED_B
);
81 #define show_extent_status(status) __print_flags(status, "", \
82 { EXTENT_STATUS_WRITTEN, "W" }, \
83 { EXTENT_STATUS_UNWRITTEN, "U" }, \
84 { EXTENT_STATUS_DELAYED, "D" }, \
85 { EXTENT_STATUS_HOLE, "H" }, \
86 { EXTENT_STATUS_REFERENCED, "R" })
88 #define show_falloc_mode(mode) __print_flags(mode, "|", \
89 { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
90 { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
91 { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \
92 { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \
93 { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"})
96 TRACE_EVENT(ext4_other_inode_update_time
,
97 TP_PROTO(struct inode
*inode
, ino_t orig_ino
),
99 TP_ARGS(inode
, orig_ino
),
102 __field( dev_t
, dev
)
103 __field( ino_t
, ino
)
104 __field( ino_t
, orig_ino
)
105 __field( uid_t
, uid
)
106 __field( gid_t
, gid
)
107 __field( __u16
, mode
)
111 __entry
->orig_ino
= orig_ino
;
112 __entry
->dev
= inode
->i_sb
->s_dev
;
113 __entry
->ino
= inode
->i_ino
;
114 __entry
->uid
= i_uid_read(inode
);
115 __entry
->gid
= i_gid_read(inode
);
116 __entry
->mode
= inode
->i_mode
;
119 TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u",
120 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
121 (unsigned long) __entry
->orig_ino
,
122 (unsigned long) __entry
->ino
, __entry
->mode
,
123 __entry
->uid
, __entry
->gid
)
126 TRACE_EVENT(ext4_free_inode
,
127 TP_PROTO(struct inode
*inode
),
132 __field( dev_t
, dev
)
133 __field( ino_t
, ino
)
134 __field( uid_t
, uid
)
135 __field( gid_t
, gid
)
136 __field( __u64
, blocks
)
137 __field( __u16
, mode
)
141 __entry
->dev
= inode
->i_sb
->s_dev
;
142 __entry
->ino
= inode
->i_ino
;
143 __entry
->uid
= i_uid_read(inode
);
144 __entry
->gid
= i_gid_read(inode
);
145 __entry
->blocks
= inode
->i_blocks
;
146 __entry
->mode
= inode
->i_mode
;
149 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
150 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
151 (unsigned long) __entry
->ino
, __entry
->mode
,
152 __entry
->uid
, __entry
->gid
, __entry
->blocks
)
155 TRACE_EVENT(ext4_request_inode
,
156 TP_PROTO(struct inode
*dir
, int mode
),
161 __field( dev_t
, dev
)
162 __field( ino_t
, dir
)
163 __field( __u16
, mode
)
167 __entry
->dev
= dir
->i_sb
->s_dev
;
168 __entry
->dir
= dir
->i_ino
;
169 __entry
->mode
= mode
;
172 TP_printk("dev %d,%d dir %lu mode 0%o",
173 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
174 (unsigned long) __entry
->dir
, __entry
->mode
)
177 TRACE_EVENT(ext4_allocate_inode
,
178 TP_PROTO(struct inode
*inode
, struct inode
*dir
, int mode
),
180 TP_ARGS(inode
, dir
, mode
),
183 __field( dev_t
, dev
)
184 __field( ino_t
, ino
)
185 __field( ino_t
, dir
)
186 __field( __u16
, mode
)
190 __entry
->dev
= inode
->i_sb
->s_dev
;
191 __entry
->ino
= inode
->i_ino
;
192 __entry
->dir
= dir
->i_ino
;
193 __entry
->mode
= mode
;
196 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
197 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
198 (unsigned long) __entry
->ino
,
199 (unsigned long) __entry
->dir
, __entry
->mode
)
202 TRACE_EVENT(ext4_evict_inode
,
203 TP_PROTO(struct inode
*inode
),
208 __field( dev_t
, dev
)
209 __field( ino_t
, ino
)
210 __field( int, nlink
)
214 __entry
->dev
= inode
->i_sb
->s_dev
;
215 __entry
->ino
= inode
->i_ino
;
216 __entry
->nlink
= inode
->i_nlink
;
219 TP_printk("dev %d,%d ino %lu nlink %d",
220 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
221 (unsigned long) __entry
->ino
, __entry
->nlink
)
224 TRACE_EVENT(ext4_drop_inode
,
225 TP_PROTO(struct inode
*inode
, int drop
),
227 TP_ARGS(inode
, drop
),
230 __field( dev_t
, dev
)
231 __field( ino_t
, ino
)
236 __entry
->dev
= inode
->i_sb
->s_dev
;
237 __entry
->ino
= inode
->i_ino
;
238 __entry
->drop
= drop
;
241 TP_printk("dev %d,%d ino %lu drop %d",
242 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
243 (unsigned long) __entry
->ino
, __entry
->drop
)
246 TRACE_EVENT(ext4_nfs_commit_metadata
,
247 TP_PROTO(struct inode
*inode
),
252 __field( dev_t
, dev
)
253 __field( ino_t
, ino
)
257 __entry
->dev
= inode
->i_sb
->s_dev
;
258 __entry
->ino
= inode
->i_ino
;
261 TP_printk("dev %d,%d ino %lu",
262 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
263 (unsigned long) __entry
->ino
)
266 TRACE_EVENT(ext4_mark_inode_dirty
,
267 TP_PROTO(struct inode
*inode
, unsigned long IP
),
272 __field( dev_t
, dev
)
273 __field( ino_t
, ino
)
274 __field(unsigned long, ip
)
278 __entry
->dev
= inode
->i_sb
->s_dev
;
279 __entry
->ino
= inode
->i_ino
;
283 TP_printk("dev %d,%d ino %lu caller %pS",
284 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
285 (unsigned long) __entry
->ino
, (void *)__entry
->ip
)
288 TRACE_EVENT(ext4_begin_ordered_truncate
,
289 TP_PROTO(struct inode
*inode
, loff_t new_size
),
291 TP_ARGS(inode
, new_size
),
294 __field( dev_t
, dev
)
295 __field( ino_t
, ino
)
296 __field( loff_t
, new_size
)
300 __entry
->dev
= inode
->i_sb
->s_dev
;
301 __entry
->ino
= inode
->i_ino
;
302 __entry
->new_size
= new_size
;
305 TP_printk("dev %d,%d ino %lu new_size %lld",
306 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
307 (unsigned long) __entry
->ino
,
311 DECLARE_EVENT_CLASS(ext4__write_begin
,
313 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
316 TP_ARGS(inode
, pos
, len
, flags
),
319 __field( dev_t
, dev
)
320 __field( ino_t
, ino
)
321 __field( loff_t
, pos
)
322 __field( unsigned int, len
)
323 __field( unsigned int, flags
)
327 __entry
->dev
= inode
->i_sb
->s_dev
;
328 __entry
->ino
= inode
->i_ino
;
331 __entry
->flags
= flags
;
334 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
335 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
336 (unsigned long) __entry
->ino
,
337 __entry
->pos
, __entry
->len
, __entry
->flags
)
340 DEFINE_EVENT(ext4__write_begin
, ext4_write_begin
,
342 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
345 TP_ARGS(inode
, pos
, len
, flags
)
348 DEFINE_EVENT(ext4__write_begin
, ext4_da_write_begin
,
350 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
353 TP_ARGS(inode
, pos
, len
, flags
)
356 DECLARE_EVENT_CLASS(ext4__write_end
,
357 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
358 unsigned int copied
),
360 TP_ARGS(inode
, pos
, len
, copied
),
363 __field( dev_t
, dev
)
364 __field( ino_t
, ino
)
365 __field( loff_t
, pos
)
366 __field( unsigned int, len
)
367 __field( unsigned int, copied
)
371 __entry
->dev
= inode
->i_sb
->s_dev
;
372 __entry
->ino
= inode
->i_ino
;
375 __entry
->copied
= copied
;
378 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
379 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
380 (unsigned long) __entry
->ino
,
381 __entry
->pos
, __entry
->len
, __entry
->copied
)
384 DEFINE_EVENT(ext4__write_end
, ext4_write_end
,
386 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
387 unsigned int copied
),
389 TP_ARGS(inode
, pos
, len
, copied
)
392 DEFINE_EVENT(ext4__write_end
, ext4_journalled_write_end
,
394 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
395 unsigned int copied
),
397 TP_ARGS(inode
, pos
, len
, copied
)
400 DEFINE_EVENT(ext4__write_end
, ext4_da_write_end
,
402 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
403 unsigned int copied
),
405 TP_ARGS(inode
, pos
, len
, copied
)
408 TRACE_EVENT(ext4_writepages
,
409 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
414 __field( dev_t
, dev
)
415 __field( ino_t
, ino
)
416 __field( long, nr_to_write
)
417 __field( long, pages_skipped
)
418 __field( loff_t
, range_start
)
419 __field( loff_t
, range_end
)
420 __field( pgoff_t
, writeback_index
)
421 __field( int, sync_mode
)
422 __field( char, for_kupdate
)
423 __field( char, range_cyclic
)
427 __entry
->dev
= inode
->i_sb
->s_dev
;
428 __entry
->ino
= inode
->i_ino
;
429 __entry
->nr_to_write
= wbc
->nr_to_write
;
430 __entry
->pages_skipped
= wbc
->pages_skipped
;
431 __entry
->range_start
= wbc
->range_start
;
432 __entry
->range_end
= wbc
->range_end
;
433 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
434 __entry
->sync_mode
= wbc
->sync_mode
;
435 __entry
->for_kupdate
= wbc
->for_kupdate
;
436 __entry
->range_cyclic
= wbc
->range_cyclic
;
439 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
440 "range_start %lld range_end %lld sync_mode %d "
441 "for_kupdate %d range_cyclic %d writeback_index %lu",
442 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
443 (unsigned long) __entry
->ino
, __entry
->nr_to_write
,
444 __entry
->pages_skipped
, __entry
->range_start
,
445 __entry
->range_end
, __entry
->sync_mode
,
446 __entry
->for_kupdate
, __entry
->range_cyclic
,
447 (unsigned long) __entry
->writeback_index
)
450 TRACE_EVENT(ext4_da_write_pages
,
451 TP_PROTO(struct inode
*inode
, pgoff_t first_page
,
452 struct writeback_control
*wbc
),
454 TP_ARGS(inode
, first_page
, wbc
),
457 __field( dev_t
, dev
)
458 __field( ino_t
, ino
)
459 __field( pgoff_t
, first_page
)
460 __field( long, nr_to_write
)
461 __field( int, sync_mode
)
465 __entry
->dev
= inode
->i_sb
->s_dev
;
466 __entry
->ino
= inode
->i_ino
;
467 __entry
->first_page
= first_page
;
468 __entry
->nr_to_write
= wbc
->nr_to_write
;
469 __entry
->sync_mode
= wbc
->sync_mode
;
472 TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
474 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
475 (unsigned long) __entry
->ino
, __entry
->first_page
,
476 __entry
->nr_to_write
, __entry
->sync_mode
)
479 TRACE_EVENT(ext4_da_write_pages_extent
,
480 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
),
485 __field( dev_t
, dev
)
486 __field( ino_t
, ino
)
487 __field( __u64
, lblk
)
488 __field( __u32
, len
)
489 __field( __u32
, flags
)
493 __entry
->dev
= inode
->i_sb
->s_dev
;
494 __entry
->ino
= inode
->i_ino
;
495 __entry
->lblk
= map
->m_lblk
;
496 __entry
->len
= map
->m_len
;
497 __entry
->flags
= map
->m_flags
;
500 TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
501 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
502 (unsigned long) __entry
->ino
, __entry
->lblk
, __entry
->len
,
503 show_mflags(__entry
->flags
))
506 TRACE_EVENT(ext4_writepages_result
,
507 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
,
508 int ret
, int pages_written
),
510 TP_ARGS(inode
, wbc
, ret
, pages_written
),
513 __field( dev_t
, dev
)
514 __field( ino_t
, ino
)
516 __field( int, pages_written
)
517 __field( long, pages_skipped
)
518 __field( pgoff_t
, writeback_index
)
519 __field( int, sync_mode
)
523 __entry
->dev
= inode
->i_sb
->s_dev
;
524 __entry
->ino
= inode
->i_ino
;
526 __entry
->pages_written
= pages_written
;
527 __entry
->pages_skipped
= wbc
->pages_skipped
;
528 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
529 __entry
->sync_mode
= wbc
->sync_mode
;
532 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
533 "sync_mode %d writeback_index %lu",
534 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
535 (unsigned long) __entry
->ino
, __entry
->ret
,
536 __entry
->pages_written
, __entry
->pages_skipped
,
538 (unsigned long) __entry
->writeback_index
)
541 DECLARE_EVENT_CLASS(ext4__page_op
,
542 TP_PROTO(struct page
*page
),
547 __field( dev_t
, dev
)
548 __field( ino_t
, ino
)
549 __field( pgoff_t
, index
)
554 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
555 __entry
->ino
= page
->mapping
->host
->i_ino
;
556 __entry
->index
= page
->index
;
559 TP_printk("dev %d,%d ino %lu page_index %lu",
560 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
561 (unsigned long) __entry
->ino
,
562 (unsigned long) __entry
->index
)
565 DEFINE_EVENT(ext4__page_op
, ext4_writepage
,
567 TP_PROTO(struct page
*page
),
572 DEFINE_EVENT(ext4__page_op
, ext4_readpage
,
574 TP_PROTO(struct page
*page
),
579 DEFINE_EVENT(ext4__page_op
, ext4_releasepage
,
581 TP_PROTO(struct page
*page
),
586 DECLARE_EVENT_CLASS(ext4_invalidatepage_op
,
587 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
589 TP_ARGS(page
, offset
, length
),
592 __field( dev_t
, dev
)
593 __field( ino_t
, ino
)
594 __field( pgoff_t
, index
)
595 __field( unsigned int, offset
)
596 __field( unsigned int, length
)
600 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
601 __entry
->ino
= page
->mapping
->host
->i_ino
;
602 __entry
->index
= page
->index
;
603 __entry
->offset
= offset
;
604 __entry
->length
= length
;
607 TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
608 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
609 (unsigned long) __entry
->ino
,
610 (unsigned long) __entry
->index
,
611 __entry
->offset
, __entry
->length
)
614 DEFINE_EVENT(ext4_invalidatepage_op
, ext4_invalidatepage
,
615 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
617 TP_ARGS(page
, offset
, length
)
620 DEFINE_EVENT(ext4_invalidatepage_op
, ext4_journalled_invalidatepage
,
621 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
623 TP_ARGS(page
, offset
, length
)
626 TRACE_EVENT(ext4_discard_blocks
,
627 TP_PROTO(struct super_block
*sb
, unsigned long long blk
,
628 unsigned long long count
),
630 TP_ARGS(sb
, blk
, count
),
633 __field( dev_t
, dev
)
634 __field( __u64
, blk
)
635 __field( __u64
, count
)
640 __entry
->dev
= sb
->s_dev
;
642 __entry
->count
= count
;
645 TP_printk("dev %d,%d blk %llu count %llu",
646 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
647 __entry
->blk
, __entry
->count
)
650 DECLARE_EVENT_CLASS(ext4__mb_new_pa
,
651 TP_PROTO(struct ext4_allocation_context
*ac
,
652 struct ext4_prealloc_space
*pa
),
657 __field( dev_t
, dev
)
658 __field( ino_t
, ino
)
659 __field( __u64
, pa_pstart
)
660 __field( __u64
, pa_lstart
)
661 __field( __u32
, pa_len
)
666 __entry
->dev
= ac
->ac_sb
->s_dev
;
667 __entry
->ino
= ac
->ac_inode
->i_ino
;
668 __entry
->pa_pstart
= pa
->pa_pstart
;
669 __entry
->pa_lstart
= pa
->pa_lstart
;
670 __entry
->pa_len
= pa
->pa_len
;
673 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
674 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
675 (unsigned long) __entry
->ino
,
676 __entry
->pa_pstart
, __entry
->pa_len
, __entry
->pa_lstart
)
679 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_inode_pa
,
681 TP_PROTO(struct ext4_allocation_context
*ac
,
682 struct ext4_prealloc_space
*pa
),
687 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_group_pa
,
689 TP_PROTO(struct ext4_allocation_context
*ac
,
690 struct ext4_prealloc_space
*pa
),
695 TRACE_EVENT(ext4_mb_release_inode_pa
,
696 TP_PROTO(struct ext4_prealloc_space
*pa
,
697 unsigned long long block
, unsigned int count
),
699 TP_ARGS(pa
, block
, count
),
702 __field( dev_t
, dev
)
703 __field( ino_t
, ino
)
704 __field( __u64
, block
)
705 __field( __u32
, count
)
710 __entry
->dev
= pa
->pa_inode
->i_sb
->s_dev
;
711 __entry
->ino
= pa
->pa_inode
->i_ino
;
712 __entry
->block
= block
;
713 __entry
->count
= count
;
716 TP_printk("dev %d,%d ino %lu block %llu count %u",
717 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
718 (unsigned long) __entry
->ino
,
719 __entry
->block
, __entry
->count
)
722 TRACE_EVENT(ext4_mb_release_group_pa
,
723 TP_PROTO(struct super_block
*sb
, struct ext4_prealloc_space
*pa
),
728 __field( dev_t
, dev
)
729 __field( __u64
, pa_pstart
)
730 __field( __u32
, pa_len
)
735 __entry
->dev
= sb
->s_dev
;
736 __entry
->pa_pstart
= pa
->pa_pstart
;
737 __entry
->pa_len
= pa
->pa_len
;
740 TP_printk("dev %d,%d pstart %llu len %u",
741 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
742 __entry
->pa_pstart
, __entry
->pa_len
)
745 TRACE_EVENT(ext4_discard_preallocations
,
746 TP_PROTO(struct inode
*inode
),
751 __field( dev_t
, dev
)
752 __field( ino_t
, ino
)
757 __entry
->dev
= inode
->i_sb
->s_dev
;
758 __entry
->ino
= inode
->i_ino
;
761 TP_printk("dev %d,%d ino %lu",
762 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
763 (unsigned long) __entry
->ino
)
766 TRACE_EVENT(ext4_mb_discard_preallocations
,
767 TP_PROTO(struct super_block
*sb
, int needed
),
772 __field( dev_t
, dev
)
773 __field( int, needed
)
778 __entry
->dev
= sb
->s_dev
;
779 __entry
->needed
= needed
;
782 TP_printk("dev %d,%d needed %d",
783 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
787 TRACE_EVENT(ext4_request_blocks
,
788 TP_PROTO(struct ext4_allocation_request
*ar
),
793 __field( dev_t
, dev
)
794 __field( ino_t
, ino
)
795 __field( unsigned int, len
)
796 __field( __u32
, logical
)
797 __field( __u32
, lleft
)
798 __field( __u32
, lright
)
799 __field( __u64
, goal
)
800 __field( __u64
, pleft
)
801 __field( __u64
, pright
)
802 __field( unsigned int, flags
)
806 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
807 __entry
->ino
= ar
->inode
->i_ino
;
808 __entry
->len
= ar
->len
;
809 __entry
->logical
= ar
->logical
;
810 __entry
->goal
= ar
->goal
;
811 __entry
->lleft
= ar
->lleft
;
812 __entry
->lright
= ar
->lright
;
813 __entry
->pleft
= ar
->pleft
;
814 __entry
->pright
= ar
->pright
;
815 __entry
->flags
= ar
->flags
;
818 TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
819 "lleft %u lright %u pleft %llu pright %llu ",
820 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
821 (unsigned long) __entry
->ino
, show_mballoc_flags(__entry
->flags
),
822 __entry
->len
, __entry
->logical
, __entry
->goal
,
823 __entry
->lleft
, __entry
->lright
, __entry
->pleft
,
827 TRACE_EVENT(ext4_allocate_blocks
,
828 TP_PROTO(struct ext4_allocation_request
*ar
, unsigned long long block
),
833 __field( dev_t
, dev
)
834 __field( ino_t
, ino
)
835 __field( __u64
, block
)
836 __field( unsigned int, len
)
837 __field( __u32
, logical
)
838 __field( __u32
, lleft
)
839 __field( __u32
, lright
)
840 __field( __u64
, goal
)
841 __field( __u64
, pleft
)
842 __field( __u64
, pright
)
843 __field( unsigned int, flags
)
847 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
848 __entry
->ino
= ar
->inode
->i_ino
;
849 __entry
->block
= block
;
850 __entry
->len
= ar
->len
;
851 __entry
->logical
= ar
->logical
;
852 __entry
->goal
= ar
->goal
;
853 __entry
->lleft
= ar
->lleft
;
854 __entry
->lright
= ar
->lright
;
855 __entry
->pleft
= ar
->pleft
;
856 __entry
->pright
= ar
->pright
;
857 __entry
->flags
= ar
->flags
;
860 TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
861 "goal %llu lleft %u lright %u pleft %llu pright %llu",
862 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
863 (unsigned long) __entry
->ino
, show_mballoc_flags(__entry
->flags
),
864 __entry
->len
, __entry
->block
, __entry
->logical
,
865 __entry
->goal
, __entry
->lleft
, __entry
->lright
,
866 __entry
->pleft
, __entry
->pright
)
869 TRACE_EVENT(ext4_free_blocks
,
870 TP_PROTO(struct inode
*inode
, __u64 block
, unsigned long count
,
873 TP_ARGS(inode
, block
, count
, flags
),
876 __field( dev_t
, dev
)
877 __field( ino_t
, ino
)
878 __field( __u64
, block
)
879 __field( unsigned long, count
)
880 __field( int, flags
)
881 __field( __u16
, mode
)
885 __entry
->dev
= inode
->i_sb
->s_dev
;
886 __entry
->ino
= inode
->i_ino
;
887 __entry
->block
= block
;
888 __entry
->count
= count
;
889 __entry
->flags
= flags
;
890 __entry
->mode
= inode
->i_mode
;
893 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
894 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
895 (unsigned long) __entry
->ino
,
896 __entry
->mode
, __entry
->block
, __entry
->count
,
897 show_free_flags(__entry
->flags
))
900 TRACE_EVENT(ext4_sync_file_enter
,
901 TP_PROTO(struct file
*file
, int datasync
),
903 TP_ARGS(file
, datasync
),
906 __field( dev_t
, dev
)
907 __field( ino_t
, ino
)
908 __field( ino_t
, parent
)
909 __field( int, datasync
)
913 struct dentry
*dentry
= file
->f_path
.dentry
;
915 __entry
->dev
= dentry
->d_sb
->s_dev
;
916 __entry
->ino
= d_inode(dentry
)->i_ino
;
917 __entry
->datasync
= datasync
;
918 __entry
->parent
= d_inode(dentry
->d_parent
)->i_ino
;
921 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
922 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
923 (unsigned long) __entry
->ino
,
924 (unsigned long) __entry
->parent
, __entry
->datasync
)
927 TRACE_EVENT(ext4_sync_file_exit
,
928 TP_PROTO(struct inode
*inode
, int ret
),
933 __field( dev_t
, dev
)
934 __field( ino_t
, ino
)
939 __entry
->dev
= inode
->i_sb
->s_dev
;
940 __entry
->ino
= inode
->i_ino
;
944 TP_printk("dev %d,%d ino %lu ret %d",
945 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
946 (unsigned long) __entry
->ino
,
950 TRACE_EVENT(ext4_sync_fs
,
951 TP_PROTO(struct super_block
*sb
, int wait
),
956 __field( dev_t
, dev
)
962 __entry
->dev
= sb
->s_dev
;
963 __entry
->wait
= wait
;
966 TP_printk("dev %d,%d wait %d",
967 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
971 TRACE_EVENT(ext4_alloc_da_blocks
,
972 TP_PROTO(struct inode
*inode
),
977 __field( dev_t
, dev
)
978 __field( ino_t
, ino
)
979 __field( unsigned int, data_blocks
)
983 __entry
->dev
= inode
->i_sb
->s_dev
;
984 __entry
->ino
= inode
->i_ino
;
985 __entry
->data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
988 TP_printk("dev %d,%d ino %lu reserved_data_blocks %u",
989 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
990 (unsigned long) __entry
->ino
,
991 __entry
->data_blocks
)
994 TRACE_EVENT(ext4_mballoc_alloc
,
995 TP_PROTO(struct ext4_allocation_context
*ac
),
1000 __field( dev_t
, dev
)
1001 __field( ino_t
, ino
)
1002 __field( __u32
, orig_logical
)
1003 __field( int, orig_start
)
1004 __field( __u32
, orig_group
)
1005 __field( int, orig_len
)
1006 __field( __u32
, goal_logical
)
1007 __field( int, goal_start
)
1008 __field( __u32
, goal_group
)
1009 __field( int, goal_len
)
1010 __field( __u32
, result_logical
)
1011 __field( int, result_start
)
1012 __field( __u32
, result_group
)
1013 __field( int, result_len
)
1014 __field( __u16
, found
)
1015 __field( __u16
, groups
)
1016 __field( __u16
, buddy
)
1017 __field( __u16
, flags
)
1018 __field( __u16
, tail
)
1023 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
1024 __entry
->ino
= ac
->ac_inode
->i_ino
;
1025 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
1026 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
1027 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
1028 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
1029 __entry
->goal_logical
= ac
->ac_g_ex
.fe_logical
;
1030 __entry
->goal_start
= ac
->ac_g_ex
.fe_start
;
1031 __entry
->goal_group
= ac
->ac_g_ex
.fe_group
;
1032 __entry
->goal_len
= ac
->ac_g_ex
.fe_len
;
1033 __entry
->result_logical
= ac
->ac_f_ex
.fe_logical
;
1034 __entry
->result_start
= ac
->ac_f_ex
.fe_start
;
1035 __entry
->result_group
= ac
->ac_f_ex
.fe_group
;
1036 __entry
->result_len
= ac
->ac_f_ex
.fe_len
;
1037 __entry
->found
= ac
->ac_found
;
1038 __entry
->flags
= ac
->ac_flags
;
1039 __entry
->groups
= ac
->ac_groups_scanned
;
1040 __entry
->buddy
= ac
->ac_buddy
;
1041 __entry
->tail
= ac
->ac_tail
;
1042 __entry
->cr
= ac
->ac_criteria
;
1045 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
1046 "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
1047 "tail %u broken %u",
1048 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1049 (unsigned long) __entry
->ino
,
1050 __entry
->orig_group
, __entry
->orig_start
,
1051 __entry
->orig_len
, __entry
->orig_logical
,
1052 __entry
->goal_group
, __entry
->goal_start
,
1053 __entry
->goal_len
, __entry
->goal_logical
,
1054 __entry
->result_group
, __entry
->result_start
,
1055 __entry
->result_len
, __entry
->result_logical
,
1056 __entry
->found
, __entry
->groups
, __entry
->cr
,
1057 show_mballoc_flags(__entry
->flags
), __entry
->tail
,
1058 __entry
->buddy
? 1 << __entry
->buddy
: 0)
1061 TRACE_EVENT(ext4_mballoc_prealloc
,
1062 TP_PROTO(struct ext4_allocation_context
*ac
),
1067 __field( dev_t
, dev
)
1068 __field( ino_t
, ino
)
1069 __field( __u32
, orig_logical
)
1070 __field( int, orig_start
)
1071 __field( __u32
, orig_group
)
1072 __field( int, orig_len
)
1073 __field( __u32
, result_logical
)
1074 __field( int, result_start
)
1075 __field( __u32
, result_group
)
1076 __field( int, result_len
)
1080 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
1081 __entry
->ino
= ac
->ac_inode
->i_ino
;
1082 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
1083 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
1084 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
1085 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
1086 __entry
->result_logical
= ac
->ac_b_ex
.fe_logical
;
1087 __entry
->result_start
= ac
->ac_b_ex
.fe_start
;
1088 __entry
->result_group
= ac
->ac_b_ex
.fe_group
;
1089 __entry
->result_len
= ac
->ac_b_ex
.fe_len
;
1092 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
1093 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1094 (unsigned long) __entry
->ino
,
1095 __entry
->orig_group
, __entry
->orig_start
,
1096 __entry
->orig_len
, __entry
->orig_logical
,
1097 __entry
->result_group
, __entry
->result_start
,
1098 __entry
->result_len
, __entry
->result_logical
)
1101 DECLARE_EVENT_CLASS(ext4__mballoc
,
1102 TP_PROTO(struct super_block
*sb
,
1103 struct inode
*inode
,
1105 ext4_grpblk_t start
,
1108 TP_ARGS(sb
, inode
, group
, start
, len
),
1111 __field( dev_t
, dev
)
1112 __field( ino_t
, ino
)
1113 __field( int, result_start
)
1114 __field( __u32
, result_group
)
1115 __field( int, result_len
)
1119 __entry
->dev
= sb
->s_dev
;
1120 __entry
->ino
= inode
? inode
->i_ino
: 0;
1121 __entry
->result_start
= start
;
1122 __entry
->result_group
= group
;
1123 __entry
->result_len
= len
;
1126 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
1127 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1128 (unsigned long) __entry
->ino
,
1129 __entry
->result_group
, __entry
->result_start
,
1130 __entry
->result_len
)
1133 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_discard
,
1135 TP_PROTO(struct super_block
*sb
,
1136 struct inode
*inode
,
1138 ext4_grpblk_t start
,
1141 TP_ARGS(sb
, inode
, group
, start
, len
)
1144 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_free
,
1146 TP_PROTO(struct super_block
*sb
,
1147 struct inode
*inode
,
1149 ext4_grpblk_t start
,
1152 TP_ARGS(sb
, inode
, group
, start
, len
)
1155 TRACE_EVENT(ext4_forget
,
1156 TP_PROTO(struct inode
*inode
, int is_metadata
, __u64 block
),
1158 TP_ARGS(inode
, is_metadata
, block
),
1161 __field( dev_t
, dev
)
1162 __field( ino_t
, ino
)
1163 __field( __u64
, block
)
1164 __field( int, is_metadata
)
1165 __field( __u16
, mode
)
1169 __entry
->dev
= inode
->i_sb
->s_dev
;
1170 __entry
->ino
= inode
->i_ino
;
1171 __entry
->block
= block
;
1172 __entry
->is_metadata
= is_metadata
;
1173 __entry
->mode
= inode
->i_mode
;
1176 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
1177 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1178 (unsigned long) __entry
->ino
,
1179 __entry
->mode
, __entry
->is_metadata
, __entry
->block
)
1182 TRACE_EVENT(ext4_da_update_reserve_space
,
1183 TP_PROTO(struct inode
*inode
, int used_blocks
, int quota_claim
),
1185 TP_ARGS(inode
, used_blocks
, quota_claim
),
1188 __field( dev_t
, dev
)
1189 __field( ino_t
, ino
)
1190 __field( __u64
, i_blocks
)
1191 __field( int, used_blocks
)
1192 __field( int, reserved_data_blocks
)
1193 __field( int, quota_claim
)
1194 __field( __u16
, mode
)
1198 __entry
->dev
= inode
->i_sb
->s_dev
;
1199 __entry
->ino
= inode
->i_ino
;
1200 __entry
->i_blocks
= inode
->i_blocks
;
1201 __entry
->used_blocks
= used_blocks
;
1202 __entry
->reserved_data_blocks
=
1203 EXT4_I(inode
)->i_reserved_data_blocks
;
1204 __entry
->quota_claim
= quota_claim
;
1205 __entry
->mode
= inode
->i_mode
;
1208 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1209 "reserved_data_blocks %d quota_claim %d",
1210 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1211 (unsigned long) __entry
->ino
,
1212 __entry
->mode
, __entry
->i_blocks
,
1213 __entry
->used_blocks
, __entry
->reserved_data_blocks
,
1214 __entry
->quota_claim
)
1217 TRACE_EVENT(ext4_da_reserve_space
,
1218 TP_PROTO(struct inode
*inode
),
1223 __field( dev_t
, dev
)
1224 __field( ino_t
, ino
)
1225 __field( __u64
, i_blocks
)
1226 __field( int, reserved_data_blocks
)
1227 __field( __u16
, mode
)
1231 __entry
->dev
= inode
->i_sb
->s_dev
;
1232 __entry
->ino
= inode
->i_ino
;
1233 __entry
->i_blocks
= inode
->i_blocks
;
1234 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
1235 __entry
->mode
= inode
->i_mode
;
1238 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu "
1239 "reserved_data_blocks %d",
1240 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1241 (unsigned long) __entry
->ino
,
1242 __entry
->mode
, __entry
->i_blocks
,
1243 __entry
->reserved_data_blocks
)
1246 TRACE_EVENT(ext4_da_release_space
,
1247 TP_PROTO(struct inode
*inode
, int freed_blocks
),
1249 TP_ARGS(inode
, freed_blocks
),
1252 __field( dev_t
, dev
)
1253 __field( ino_t
, ino
)
1254 __field( __u64
, i_blocks
)
1255 __field( int, freed_blocks
)
1256 __field( int, reserved_data_blocks
)
1257 __field( __u16
, mode
)
1261 __entry
->dev
= inode
->i_sb
->s_dev
;
1262 __entry
->ino
= inode
->i_ino
;
1263 __entry
->i_blocks
= inode
->i_blocks
;
1264 __entry
->freed_blocks
= freed_blocks
;
1265 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
1266 __entry
->mode
= inode
->i_mode
;
1269 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1270 "reserved_data_blocks %d",
1271 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1272 (unsigned long) __entry
->ino
,
1273 __entry
->mode
, __entry
->i_blocks
,
1274 __entry
->freed_blocks
, __entry
->reserved_data_blocks
)
1277 DECLARE_EVENT_CLASS(ext4__bitmap_load
,
1278 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1283 __field( dev_t
, dev
)
1284 __field( __u32
, group
)
1289 __entry
->dev
= sb
->s_dev
;
1290 __entry
->group
= group
;
1293 TP_printk("dev %d,%d group %u",
1294 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1298 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_bitmap_load
,
1300 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1305 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_buddy_bitmap_load
,
1307 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1312 DEFINE_EVENT(ext4__bitmap_load
, ext4_read_block_bitmap_load
,
1314 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1319 DEFINE_EVENT(ext4__bitmap_load
, ext4_load_inode_bitmap
,
1321 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1326 TRACE_EVENT(ext4_direct_IO_enter
,
1327 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
, int rw
),
1329 TP_ARGS(inode
, offset
, len
, rw
),
1332 __field( dev_t
, dev
)
1333 __field( ino_t
, ino
)
1334 __field( loff_t
, pos
)
1335 __field( unsigned long, len
)
1340 __entry
->dev
= inode
->i_sb
->s_dev
;
1341 __entry
->ino
= inode
->i_ino
;
1342 __entry
->pos
= offset
;
1347 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
1348 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1349 (unsigned long) __entry
->ino
,
1350 __entry
->pos
, __entry
->len
, __entry
->rw
)
1353 TRACE_EVENT(ext4_direct_IO_exit
,
1354 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
,
1357 TP_ARGS(inode
, offset
, len
, rw
, ret
),
1360 __field( dev_t
, dev
)
1361 __field( ino_t
, ino
)
1362 __field( loff_t
, pos
)
1363 __field( unsigned long, len
)
1369 __entry
->dev
= inode
->i_sb
->s_dev
;
1370 __entry
->ino
= inode
->i_ino
;
1371 __entry
->pos
= offset
;
1377 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
1378 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1379 (unsigned long) __entry
->ino
,
1380 __entry
->pos
, __entry
->len
,
1381 __entry
->rw
, __entry
->ret
)
1384 DECLARE_EVENT_CLASS(ext4__fallocate_mode
,
1385 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1387 TP_ARGS(inode
, offset
, len
, mode
),
1390 __field( dev_t
, dev
)
1391 __field( ino_t
, ino
)
1392 __field( loff_t
, offset
)
1393 __field( loff_t
, len
)
1394 __field( int, mode
)
1398 __entry
->dev
= inode
->i_sb
->s_dev
;
1399 __entry
->ino
= inode
->i_ino
;
1400 __entry
->offset
= offset
;
1402 __entry
->mode
= mode
;
1405 TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
1406 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1407 (unsigned long) __entry
->ino
,
1408 __entry
->offset
, __entry
->len
,
1409 show_falloc_mode(__entry
->mode
))
1412 DEFINE_EVENT(ext4__fallocate_mode
, ext4_fallocate_enter
,
1414 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1416 TP_ARGS(inode
, offset
, len
, mode
)
1419 DEFINE_EVENT(ext4__fallocate_mode
, ext4_punch_hole
,
1421 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1423 TP_ARGS(inode
, offset
, len
, mode
)
1426 DEFINE_EVENT(ext4__fallocate_mode
, ext4_zero_range
,
1428 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1430 TP_ARGS(inode
, offset
, len
, mode
)
1433 TRACE_EVENT(ext4_fallocate_exit
,
1434 TP_PROTO(struct inode
*inode
, loff_t offset
,
1435 unsigned int max_blocks
, int ret
),
1437 TP_ARGS(inode
, offset
, max_blocks
, ret
),
1440 __field( dev_t
, dev
)
1441 __field( ino_t
, ino
)
1442 __field( loff_t
, pos
)
1443 __field( unsigned int, blocks
)
1448 __entry
->dev
= inode
->i_sb
->s_dev
;
1449 __entry
->ino
= inode
->i_ino
;
1450 __entry
->pos
= offset
;
1451 __entry
->blocks
= max_blocks
;
1455 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
1456 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1457 (unsigned long) __entry
->ino
,
1458 __entry
->pos
, __entry
->blocks
,
1462 TRACE_EVENT(ext4_unlink_enter
,
1463 TP_PROTO(struct inode
*parent
, struct dentry
*dentry
),
1465 TP_ARGS(parent
, dentry
),
1468 __field( dev_t
, dev
)
1469 __field( ino_t
, ino
)
1470 __field( ino_t
, parent
)
1471 __field( loff_t
, size
)
1475 __entry
->dev
= dentry
->d_sb
->s_dev
;
1476 __entry
->ino
= d_inode(dentry
)->i_ino
;
1477 __entry
->parent
= parent
->i_ino
;
1478 __entry
->size
= d_inode(dentry
)->i_size
;
1481 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
1482 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1483 (unsigned long) __entry
->ino
, __entry
->size
,
1484 (unsigned long) __entry
->parent
)
1487 TRACE_EVENT(ext4_unlink_exit
,
1488 TP_PROTO(struct dentry
*dentry
, int ret
),
1490 TP_ARGS(dentry
, ret
),
1493 __field( dev_t
, dev
)
1494 __field( ino_t
, ino
)
1499 __entry
->dev
= dentry
->d_sb
->s_dev
;
1500 __entry
->ino
= d_inode(dentry
)->i_ino
;
1504 TP_printk("dev %d,%d ino %lu ret %d",
1505 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1506 (unsigned long) __entry
->ino
,
1510 DECLARE_EVENT_CLASS(ext4__truncate
,
1511 TP_PROTO(struct inode
*inode
),
1516 __field( dev_t
, dev
)
1517 __field( ino_t
, ino
)
1518 __field( __u64
, blocks
)
1522 __entry
->dev
= inode
->i_sb
->s_dev
;
1523 __entry
->ino
= inode
->i_ino
;
1524 __entry
->blocks
= inode
->i_blocks
;
1527 TP_printk("dev %d,%d ino %lu blocks %llu",
1528 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1529 (unsigned long) __entry
->ino
, __entry
->blocks
)
1532 DEFINE_EVENT(ext4__truncate
, ext4_truncate_enter
,
1534 TP_PROTO(struct inode
*inode
),
1539 DEFINE_EVENT(ext4__truncate
, ext4_truncate_exit
,
1541 TP_PROTO(struct inode
*inode
),
1546 /* 'ux' is the unwritten extent. */
1547 TRACE_EVENT(ext4_ext_convert_to_initialized_enter
,
1548 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
,
1549 struct ext4_extent
*ux
),
1551 TP_ARGS(inode
, map
, ux
),
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
)
1564 __entry
->dev
= inode
->i_sb
->s_dev
;
1565 __entry
->ino
= inode
->i_ino
;
1566 __entry
->m_lblk
= map
->m_lblk
;
1567 __entry
->m_len
= map
->m_len
;
1568 __entry
->u_lblk
= le32_to_cpu(ux
->ee_block
);
1569 __entry
->u_len
= ext4_ext_get_actual_len(ux
);
1570 __entry
->u_pblk
= ext4_ext_pblock(ux
);
1573 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1575 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1576 (unsigned long) __entry
->ino
,
1577 __entry
->m_lblk
, __entry
->m_len
,
1578 __entry
->u_lblk
, __entry
->u_len
, __entry
->u_pblk
)
1582 * 'ux' is the unwritten extent.
1583 * 'ix' is the initialized extent to which blocks are transferred.
1585 TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath
,
1586 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
,
1587 struct ext4_extent
*ux
, struct ext4_extent
*ix
),
1589 TP_ARGS(inode
, map
, ux
, ix
),
1592 __field( dev_t
, dev
)
1593 __field( ino_t
, ino
)
1594 __field( ext4_lblk_t
, m_lblk
)
1595 __field( unsigned, m_len
)
1596 __field( ext4_lblk_t
, u_lblk
)
1597 __field( unsigned, u_len
)
1598 __field( ext4_fsblk_t
, u_pblk
)
1599 __field( ext4_lblk_t
, i_lblk
)
1600 __field( unsigned, i_len
)
1601 __field( ext4_fsblk_t
, i_pblk
)
1605 __entry
->dev
= inode
->i_sb
->s_dev
;
1606 __entry
->ino
= inode
->i_ino
;
1607 __entry
->m_lblk
= map
->m_lblk
;
1608 __entry
->m_len
= map
->m_len
;
1609 __entry
->u_lblk
= le32_to_cpu(ux
->ee_block
);
1610 __entry
->u_len
= ext4_ext_get_actual_len(ux
);
1611 __entry
->u_pblk
= ext4_ext_pblock(ux
);
1612 __entry
->i_lblk
= le32_to_cpu(ix
->ee_block
);
1613 __entry
->i_len
= ext4_ext_get_actual_len(ix
);
1614 __entry
->i_pblk
= ext4_ext_pblock(ix
);
1617 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1618 "u_lblk %u u_len %u u_pblk %llu "
1619 "i_lblk %u i_len %u i_pblk %llu ",
1620 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1621 (unsigned long) __entry
->ino
,
1622 __entry
->m_lblk
, __entry
->m_len
,
1623 __entry
->u_lblk
, __entry
->u_len
, __entry
->u_pblk
,
1624 __entry
->i_lblk
, __entry
->i_len
, __entry
->i_pblk
)
1627 DECLARE_EVENT_CLASS(ext4__map_blocks_enter
,
1628 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1629 unsigned int len
, unsigned int flags
),
1631 TP_ARGS(inode
, lblk
, len
, flags
),
1634 __field( dev_t
, dev
)
1635 __field( ino_t
, ino
)
1636 __field( ext4_lblk_t
, lblk
)
1637 __field( unsigned int, len
)
1638 __field( unsigned int, flags
)
1642 __entry
->dev
= inode
->i_sb
->s_dev
;
1643 __entry
->ino
= inode
->i_ino
;
1644 __entry
->lblk
= lblk
;
1646 __entry
->flags
= flags
;
1649 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
1650 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1651 (unsigned long) __entry
->ino
,
1652 __entry
->lblk
, __entry
->len
, show_map_flags(__entry
->flags
))
1655 DEFINE_EVENT(ext4__map_blocks_enter
, ext4_ext_map_blocks_enter
,
1656 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1657 unsigned len
, unsigned flags
),
1659 TP_ARGS(inode
, lblk
, len
, flags
)
1662 DEFINE_EVENT(ext4__map_blocks_enter
, ext4_ind_map_blocks_enter
,
1663 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1664 unsigned len
, unsigned flags
),
1666 TP_ARGS(inode
, lblk
, len
, flags
)
1669 DECLARE_EVENT_CLASS(ext4__map_blocks_exit
,
1670 TP_PROTO(struct inode
*inode
, unsigned flags
, struct ext4_map_blocks
*map
,
1673 TP_ARGS(inode
, flags
, map
, ret
),
1676 __field( dev_t
, dev
)
1677 __field( ino_t
, ino
)
1678 __field( unsigned int, flags
)
1679 __field( ext4_fsblk_t
, pblk
)
1680 __field( ext4_lblk_t
, lblk
)
1681 __field( unsigned int, len
)
1682 __field( unsigned int, mflags
)
1687 __entry
->dev
= inode
->i_sb
->s_dev
;
1688 __entry
->ino
= inode
->i_ino
;
1689 __entry
->flags
= flags
;
1690 __entry
->pblk
= map
->m_pblk
;
1691 __entry
->lblk
= map
->m_lblk
;
1692 __entry
->len
= map
->m_len
;
1693 __entry
->mflags
= map
->m_flags
;
1697 TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
1699 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1700 (unsigned long) __entry
->ino
,
1701 show_map_flags(__entry
->flags
), __entry
->lblk
, __entry
->pblk
,
1702 __entry
->len
, show_mflags(__entry
->mflags
), __entry
->ret
)
1705 DEFINE_EVENT(ext4__map_blocks_exit
, ext4_ext_map_blocks_exit
,
1706 TP_PROTO(struct inode
*inode
, unsigned flags
,
1707 struct ext4_map_blocks
*map
, int ret
),
1709 TP_ARGS(inode
, flags
, map
, ret
)
1712 DEFINE_EVENT(ext4__map_blocks_exit
, ext4_ind_map_blocks_exit
,
1713 TP_PROTO(struct inode
*inode
, unsigned flags
,
1714 struct ext4_map_blocks
*map
, int ret
),
1716 TP_ARGS(inode
, flags
, map
, ret
)
1719 TRACE_EVENT(ext4_ext_load_extent
,
1720 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_fsblk_t pblk
),
1722 TP_ARGS(inode
, lblk
, pblk
),
1725 __field( dev_t
, dev
)
1726 __field( ino_t
, ino
)
1727 __field( ext4_fsblk_t
, pblk
)
1728 __field( ext4_lblk_t
, lblk
)
1732 __entry
->dev
= inode
->i_sb
->s_dev
;
1733 __entry
->ino
= inode
->i_ino
;
1734 __entry
->pblk
= pblk
;
1735 __entry
->lblk
= lblk
;
1738 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1739 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1740 (unsigned long) __entry
->ino
,
1741 __entry
->lblk
, __entry
->pblk
)
1744 TRACE_EVENT(ext4_load_inode
,
1745 TP_PROTO(struct inode
*inode
),
1750 __field( dev_t
, dev
)
1751 __field( ino_t
, ino
)
1755 __entry
->dev
= inode
->i_sb
->s_dev
;
1756 __entry
->ino
= inode
->i_ino
;
1759 TP_printk("dev %d,%d ino %ld",
1760 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1761 (unsigned long) __entry
->ino
)
1764 TRACE_EVENT(ext4_journal_start
,
1765 TP_PROTO(struct super_block
*sb
, int blocks
, int rsv_blocks
,
1766 int revoke_creds
, unsigned long IP
),
1768 TP_ARGS(sb
, blocks
, rsv_blocks
, revoke_creds
, IP
),
1771 __field( dev_t
, dev
)
1772 __field(unsigned long, ip
)
1773 __field( int, blocks
)
1774 __field( int, rsv_blocks
)
1775 __field( int, revoke_creds
)
1779 __entry
->dev
= sb
->s_dev
;
1781 __entry
->blocks
= blocks
;
1782 __entry
->rsv_blocks
= rsv_blocks
;
1783 __entry
->revoke_creds
= revoke_creds
;
1786 TP_printk("dev %d,%d blocks %d, rsv_blocks %d, revoke_creds %d, "
1787 "caller %pS", MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1788 __entry
->blocks
, __entry
->rsv_blocks
, __entry
->revoke_creds
,
1789 (void *)__entry
->ip
)
1792 TRACE_EVENT(ext4_journal_start_reserved
,
1793 TP_PROTO(struct super_block
*sb
, int blocks
, unsigned long IP
),
1795 TP_ARGS(sb
, blocks
, IP
),
1798 __field( dev_t
, dev
)
1799 __field(unsigned long, ip
)
1800 __field( int, blocks
)
1804 __entry
->dev
= sb
->s_dev
;
1806 __entry
->blocks
= blocks
;
1809 TP_printk("dev %d,%d blocks, %d caller %pS",
1810 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1811 __entry
->blocks
, (void *)__entry
->ip
)
1814 DECLARE_EVENT_CLASS(ext4__trim
,
1815 TP_PROTO(struct super_block
*sb
,
1817 ext4_grpblk_t start
,
1820 TP_ARGS(sb
, group
, start
, len
),
1823 __field( int, dev_major
)
1824 __field( int, dev_minor
)
1825 __field( __u32
, group
)
1826 __field( int, start
)
1831 __entry
->dev_major
= MAJOR(sb
->s_dev
);
1832 __entry
->dev_minor
= MINOR(sb
->s_dev
);
1833 __entry
->group
= group
;
1834 __entry
->start
= start
;
1838 TP_printk("dev %d,%d group %u, start %d, len %d",
1839 __entry
->dev_major
, __entry
->dev_minor
,
1840 __entry
->group
, __entry
->start
, __entry
->len
)
1843 DEFINE_EVENT(ext4__trim
, ext4_trim_extent
,
1845 TP_PROTO(struct super_block
*sb
,
1847 ext4_grpblk_t start
,
1850 TP_ARGS(sb
, group
, start
, len
)
1853 DEFINE_EVENT(ext4__trim
, ext4_trim_all_free
,
1855 TP_PROTO(struct super_block
*sb
,
1857 ext4_grpblk_t start
,
1860 TP_ARGS(sb
, group
, start
, len
)
1863 TRACE_EVENT(ext4_ext_handle_unwritten_extents
,
1864 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
, int flags
,
1865 unsigned int allocated
, ext4_fsblk_t newblock
),
1867 TP_ARGS(inode
, map
, flags
, allocated
, newblock
),
1870 __field( dev_t
, dev
)
1871 __field( ino_t
, ino
)
1872 __field( int, flags
)
1873 __field( ext4_lblk_t
, lblk
)
1874 __field( ext4_fsblk_t
, pblk
)
1875 __field( unsigned int, len
)
1876 __field( unsigned int, allocated
)
1877 __field( ext4_fsblk_t
, newblk
)
1881 __entry
->dev
= inode
->i_sb
->s_dev
;
1882 __entry
->ino
= inode
->i_ino
;
1883 __entry
->flags
= flags
;
1884 __entry
->lblk
= map
->m_lblk
;
1885 __entry
->pblk
= map
->m_pblk
;
1886 __entry
->len
= map
->m_len
;
1887 __entry
->allocated
= allocated
;
1888 __entry
->newblk
= newblock
;
1891 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %s "
1892 "allocated %d newblock %llu",
1893 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1894 (unsigned long) __entry
->ino
,
1895 (unsigned) __entry
->lblk
, (unsigned long long) __entry
->pblk
,
1896 __entry
->len
, show_map_flags(__entry
->flags
),
1897 (unsigned int) __entry
->allocated
,
1898 (unsigned long long) __entry
->newblk
)
1901 TRACE_EVENT(ext4_get_implied_cluster_alloc_exit
,
1902 TP_PROTO(struct super_block
*sb
, struct ext4_map_blocks
*map
, int ret
),
1904 TP_ARGS(sb
, map
, ret
),
1907 __field( dev_t
, dev
)
1908 __field( unsigned int, flags
)
1909 __field( ext4_lblk_t
, lblk
)
1910 __field( ext4_fsblk_t
, pblk
)
1911 __field( unsigned int, len
)
1916 __entry
->dev
= sb
->s_dev
;
1917 __entry
->flags
= map
->m_flags
;
1918 __entry
->lblk
= map
->m_lblk
;
1919 __entry
->pblk
= map
->m_pblk
;
1920 __entry
->len
= map
->m_len
;
1924 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %s ret %d",
1925 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1926 __entry
->lblk
, (unsigned long long) __entry
->pblk
,
1927 __entry
->len
, show_mflags(__entry
->flags
), __entry
->ret
)
1930 TRACE_EVENT(ext4_ext_put_in_cache
,
1931 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, unsigned int len
,
1932 ext4_fsblk_t start
),
1934 TP_ARGS(inode
, lblk
, len
, start
),
1937 __field( dev_t
, dev
)
1938 __field( ino_t
, ino
)
1939 __field( ext4_lblk_t
, lblk
)
1940 __field( unsigned int, len
)
1941 __field( ext4_fsblk_t
, start
)
1945 __entry
->dev
= inode
->i_sb
->s_dev
;
1946 __entry
->ino
= inode
->i_ino
;
1947 __entry
->lblk
= lblk
;
1949 __entry
->start
= start
;
1952 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1953 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1954 (unsigned long) __entry
->ino
,
1955 (unsigned) __entry
->lblk
,
1957 (unsigned long long) __entry
->start
)
1960 TRACE_EVENT(ext4_ext_in_cache
,
1961 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, int ret
),
1963 TP_ARGS(inode
, lblk
, ret
),
1966 __field( dev_t
, dev
)
1967 __field( ino_t
, ino
)
1968 __field( ext4_lblk_t
, lblk
)
1973 __entry
->dev
= inode
->i_sb
->s_dev
;
1974 __entry
->ino
= inode
->i_ino
;
1975 __entry
->lblk
= lblk
;
1979 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1980 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1981 (unsigned long) __entry
->ino
,
1982 (unsigned) __entry
->lblk
,
1987 TRACE_EVENT(ext4_find_delalloc_range
,
1988 TP_PROTO(struct inode
*inode
, ext4_lblk_t from
, ext4_lblk_t to
,
1989 int reverse
, int found
, ext4_lblk_t found_blk
),
1991 TP_ARGS(inode
, from
, to
, reverse
, found
, found_blk
),
1994 __field( dev_t
, dev
)
1995 __field( ino_t
, ino
)
1996 __field( ext4_lblk_t
, from
)
1997 __field( ext4_lblk_t
, to
)
1998 __field( int, reverse
)
1999 __field( int, found
)
2000 __field( ext4_lblk_t
, found_blk
)
2004 __entry
->dev
= inode
->i_sb
->s_dev
;
2005 __entry
->ino
= inode
->i_ino
;
2006 __entry
->from
= from
;
2008 __entry
->reverse
= reverse
;
2009 __entry
->found
= found
;
2010 __entry
->found_blk
= found_blk
;
2013 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
2015 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2016 (unsigned long) __entry
->ino
,
2017 (unsigned) __entry
->from
, (unsigned) __entry
->to
,
2018 __entry
->reverse
, __entry
->found
,
2019 (unsigned) __entry
->found_blk
)
2022 TRACE_EVENT(ext4_get_reserved_cluster_alloc
,
2023 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, unsigned int len
),
2025 TP_ARGS(inode
, lblk
, len
),
2028 __field( dev_t
, dev
)
2029 __field( ino_t
, ino
)
2030 __field( ext4_lblk_t
, lblk
)
2031 __field( unsigned int, len
)
2035 __entry
->dev
= inode
->i_sb
->s_dev
;
2036 __entry
->ino
= inode
->i_ino
;
2037 __entry
->lblk
= lblk
;
2041 TP_printk("dev %d,%d ino %lu lblk %u len %u",
2042 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2043 (unsigned long) __entry
->ino
,
2044 (unsigned) __entry
->lblk
,
2048 TRACE_EVENT(ext4_ext_show_extent
,
2049 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_fsblk_t pblk
,
2050 unsigned short len
),
2052 TP_ARGS(inode
, lblk
, pblk
, len
),
2055 __field( dev_t
, dev
)
2056 __field( ino_t
, ino
)
2057 __field( ext4_fsblk_t
, pblk
)
2058 __field( ext4_lblk_t
, lblk
)
2059 __field( unsigned short, len
)
2063 __entry
->dev
= inode
->i_sb
->s_dev
;
2064 __entry
->ino
= inode
->i_ino
;
2065 __entry
->pblk
= pblk
;
2066 __entry
->lblk
= lblk
;
2070 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
2071 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2072 (unsigned long) __entry
->ino
,
2073 (unsigned) __entry
->lblk
,
2074 (unsigned long long) __entry
->pblk
,
2075 (unsigned short) __entry
->len
)
2078 TRACE_EVENT(ext4_remove_blocks
,
2079 TP_PROTO(struct inode
*inode
, struct ext4_extent
*ex
,
2080 ext4_lblk_t from
, ext4_fsblk_t to
,
2081 struct partial_cluster
*pc
),
2083 TP_ARGS(inode
, ex
, from
, to
, pc
),
2086 __field( dev_t
, dev
)
2087 __field( ino_t
, ino
)
2088 __field( ext4_lblk_t
, from
)
2089 __field( ext4_lblk_t
, to
)
2090 __field( ext4_fsblk_t
, ee_pblk
)
2091 __field( ext4_lblk_t
, ee_lblk
)
2092 __field( unsigned short, ee_len
)
2093 __field( ext4_fsblk_t
, pc_pclu
)
2094 __field( ext4_lblk_t
, pc_lblk
)
2095 __field( int, pc_state
)
2099 __entry
->dev
= inode
->i_sb
->s_dev
;
2100 __entry
->ino
= inode
->i_ino
;
2101 __entry
->from
= from
;
2103 __entry
->ee_pblk
= ext4_ext_pblock(ex
);
2104 __entry
->ee_lblk
= le32_to_cpu(ex
->ee_block
);
2105 __entry
->ee_len
= ext4_ext_get_actual_len(ex
);
2106 __entry
->pc_pclu
= pc
->pclu
;
2107 __entry
->pc_lblk
= pc
->lblk
;
2108 __entry
->pc_state
= pc
->state
;
2111 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
2112 "from %u to %u partial [pclu %lld lblk %u state %d]",
2113 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2114 (unsigned long) __entry
->ino
,
2115 (unsigned) __entry
->ee_lblk
,
2116 (unsigned long long) __entry
->ee_pblk
,
2117 (unsigned short) __entry
->ee_len
,
2118 (unsigned) __entry
->from
,
2119 (unsigned) __entry
->to
,
2120 (long long) __entry
->pc_pclu
,
2121 (unsigned int) __entry
->pc_lblk
,
2122 (int) __entry
->pc_state
)
2125 TRACE_EVENT(ext4_ext_rm_leaf
,
2126 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
,
2127 struct ext4_extent
*ex
,
2128 struct partial_cluster
*pc
),
2130 TP_ARGS(inode
, start
, ex
, pc
),
2133 __field( dev_t
, dev
)
2134 __field( ino_t
, ino
)
2135 __field( ext4_lblk_t
, start
)
2136 __field( ext4_lblk_t
, ee_lblk
)
2137 __field( ext4_fsblk_t
, ee_pblk
)
2138 __field( short, ee_len
)
2139 __field( ext4_fsblk_t
, pc_pclu
)
2140 __field( ext4_lblk_t
, pc_lblk
)
2141 __field( int, pc_state
)
2145 __entry
->dev
= inode
->i_sb
->s_dev
;
2146 __entry
->ino
= inode
->i_ino
;
2147 __entry
->start
= start
;
2148 __entry
->ee_lblk
= le32_to_cpu(ex
->ee_block
);
2149 __entry
->ee_pblk
= ext4_ext_pblock(ex
);
2150 __entry
->ee_len
= ext4_ext_get_actual_len(ex
);
2151 __entry
->pc_pclu
= pc
->pclu
;
2152 __entry
->pc_lblk
= pc
->lblk
;
2153 __entry
->pc_state
= pc
->state
;
2156 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
2157 "partial [pclu %lld lblk %u state %d]",
2158 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2159 (unsigned long) __entry
->ino
,
2160 (unsigned) __entry
->start
,
2161 (unsigned) __entry
->ee_lblk
,
2162 (unsigned long long) __entry
->ee_pblk
,
2163 (unsigned short) __entry
->ee_len
,
2164 (long long) __entry
->pc_pclu
,
2165 (unsigned int) __entry
->pc_lblk
,
2166 (int) __entry
->pc_state
)
2169 TRACE_EVENT(ext4_ext_rm_idx
,
2170 TP_PROTO(struct inode
*inode
, ext4_fsblk_t pblk
),
2172 TP_ARGS(inode
, pblk
),
2175 __field( dev_t
, dev
)
2176 __field( ino_t
, ino
)
2177 __field( ext4_fsblk_t
, pblk
)
2181 __entry
->dev
= inode
->i_sb
->s_dev
;
2182 __entry
->ino
= inode
->i_ino
;
2183 __entry
->pblk
= pblk
;
2186 TP_printk("dev %d,%d ino %lu index_pblk %llu",
2187 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2188 (unsigned long) __entry
->ino
,
2189 (unsigned long long) __entry
->pblk
)
2192 TRACE_EVENT(ext4_ext_remove_space
,
2193 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
,
2194 ext4_lblk_t end
, int depth
),
2196 TP_ARGS(inode
, start
, end
, depth
),
2199 __field( dev_t
, dev
)
2200 __field( ino_t
, ino
)
2201 __field( ext4_lblk_t
, start
)
2202 __field( ext4_lblk_t
, end
)
2203 __field( int, depth
)
2207 __entry
->dev
= inode
->i_sb
->s_dev
;
2208 __entry
->ino
= inode
->i_ino
;
2209 __entry
->start
= start
;
2211 __entry
->depth
= depth
;
2214 TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
2215 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2216 (unsigned long) __entry
->ino
,
2217 (unsigned) __entry
->start
,
2218 (unsigned) __entry
->end
,
2222 TRACE_EVENT(ext4_ext_remove_space_done
,
2223 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
, ext4_lblk_t end
,
2224 int depth
, struct partial_cluster
*pc
, __le16 eh_entries
),
2226 TP_ARGS(inode
, start
, end
, depth
, pc
, eh_entries
),
2229 __field( dev_t
, dev
)
2230 __field( ino_t
, ino
)
2231 __field( ext4_lblk_t
, start
)
2232 __field( ext4_lblk_t
, end
)
2233 __field( int, depth
)
2234 __field( ext4_fsblk_t
, pc_pclu
)
2235 __field( ext4_lblk_t
, pc_lblk
)
2236 __field( int, pc_state
)
2237 __field( unsigned short, eh_entries
)
2241 __entry
->dev
= inode
->i_sb
->s_dev
;
2242 __entry
->ino
= inode
->i_ino
;
2243 __entry
->start
= start
;
2245 __entry
->depth
= depth
;
2246 __entry
->pc_pclu
= pc
->pclu
;
2247 __entry
->pc_lblk
= pc
->lblk
;
2248 __entry
->pc_state
= pc
->state
;
2249 __entry
->eh_entries
= le16_to_cpu(eh_entries
);
2252 TP_printk("dev %d,%d ino %lu since %u end %u depth %d "
2253 "partial [pclu %lld lblk %u state %d] "
2254 "remaining_entries %u",
2255 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2256 (unsigned long) __entry
->ino
,
2257 (unsigned) __entry
->start
,
2258 (unsigned) __entry
->end
,
2260 (long long) __entry
->pc_pclu
,
2261 (unsigned int) __entry
->pc_lblk
,
2262 (int) __entry
->pc_state
,
2263 (unsigned short) __entry
->eh_entries
)
2266 DECLARE_EVENT_CLASS(ext4__es_extent
,
2267 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2272 __field( dev_t
, dev
)
2273 __field( ino_t
, ino
)
2274 __field( ext4_lblk_t
, lblk
)
2275 __field( ext4_lblk_t
, len
)
2276 __field( ext4_fsblk_t
, pblk
)
2277 __field( char, status
)
2281 __entry
->dev
= inode
->i_sb
->s_dev
;
2282 __entry
->ino
= inode
->i_ino
;
2283 __entry
->lblk
= es
->es_lblk
;
2284 __entry
->len
= es
->es_len
;
2285 __entry
->pblk
= ext4_es_show_pblock(es
);
2286 __entry
->status
= ext4_es_status(es
);
2289 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
2290 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2291 (unsigned long) __entry
->ino
,
2292 __entry
->lblk
, __entry
->len
,
2293 __entry
->pblk
, show_extent_status(__entry
->status
))
2296 DEFINE_EVENT(ext4__es_extent
, ext4_es_insert_extent
,
2297 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2302 DEFINE_EVENT(ext4__es_extent
, ext4_es_cache_extent
,
2303 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2308 TRACE_EVENT(ext4_es_remove_extent
,
2309 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_lblk_t len
),
2311 TP_ARGS(inode
, lblk
, len
),
2314 __field( dev_t
, dev
)
2315 __field( ino_t
, ino
)
2316 __field( loff_t
, lblk
)
2317 __field( loff_t
, len
)
2321 __entry
->dev
= inode
->i_sb
->s_dev
;
2322 __entry
->ino
= inode
->i_ino
;
2323 __entry
->lblk
= lblk
;
2327 TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
2328 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2329 (unsigned long) __entry
->ino
,
2330 __entry
->lblk
, __entry
->len
)
2333 TRACE_EVENT(ext4_es_find_extent_range_enter
,
2334 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
),
2336 TP_ARGS(inode
, lblk
),
2339 __field( dev_t
, dev
)
2340 __field( ino_t
, ino
)
2341 __field( ext4_lblk_t
, lblk
)
2345 __entry
->dev
= inode
->i_sb
->s_dev
;
2346 __entry
->ino
= inode
->i_ino
;
2347 __entry
->lblk
= lblk
;
2350 TP_printk("dev %d,%d ino %lu lblk %u",
2351 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2352 (unsigned long) __entry
->ino
, __entry
->lblk
)
2355 TRACE_EVENT(ext4_es_find_extent_range_exit
,
2356 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2361 __field( dev_t
, dev
)
2362 __field( ino_t
, ino
)
2363 __field( ext4_lblk_t
, lblk
)
2364 __field( ext4_lblk_t
, len
)
2365 __field( ext4_fsblk_t
, pblk
)
2366 __field( char, status
)
2370 __entry
->dev
= inode
->i_sb
->s_dev
;
2371 __entry
->ino
= inode
->i_ino
;
2372 __entry
->lblk
= es
->es_lblk
;
2373 __entry
->len
= es
->es_len
;
2374 __entry
->pblk
= ext4_es_show_pblock(es
);
2375 __entry
->status
= ext4_es_status(es
);
2378 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
2379 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2380 (unsigned long) __entry
->ino
,
2381 __entry
->lblk
, __entry
->len
,
2382 __entry
->pblk
, show_extent_status(__entry
->status
))
2385 TRACE_EVENT(ext4_es_lookup_extent_enter
,
2386 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
),
2388 TP_ARGS(inode
, lblk
),
2391 __field( dev_t
, dev
)
2392 __field( ino_t
, ino
)
2393 __field( ext4_lblk_t
, lblk
)
2397 __entry
->dev
= inode
->i_sb
->s_dev
;
2398 __entry
->ino
= inode
->i_ino
;
2399 __entry
->lblk
= lblk
;
2402 TP_printk("dev %d,%d ino %lu lblk %u",
2403 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2404 (unsigned long) __entry
->ino
, __entry
->lblk
)
2407 TRACE_EVENT(ext4_es_lookup_extent_exit
,
2408 TP_PROTO(struct inode
*inode
, struct extent_status
*es
,
2411 TP_ARGS(inode
, es
, found
),
2414 __field( dev_t
, dev
)
2415 __field( ino_t
, ino
)
2416 __field( ext4_lblk_t
, lblk
)
2417 __field( ext4_lblk_t
, len
)
2418 __field( ext4_fsblk_t
, pblk
)
2419 __field( char, status
)
2420 __field( int, found
)
2424 __entry
->dev
= inode
->i_sb
->s_dev
;
2425 __entry
->ino
= inode
->i_ino
;
2426 __entry
->lblk
= es
->es_lblk
;
2427 __entry
->len
= es
->es_len
;
2428 __entry
->pblk
= ext4_es_show_pblock(es
);
2429 __entry
->status
= ext4_es_status(es
);
2430 __entry
->found
= found
;
2433 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
2434 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2435 (unsigned long) __entry
->ino
, __entry
->found
,
2436 __entry
->lblk
, __entry
->len
,
2437 __entry
->found
? __entry
->pblk
: 0,
2438 show_extent_status(__entry
->found
? __entry
->status
: 0))
2441 DECLARE_EVENT_CLASS(ext4__es_shrink_enter
,
2442 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2444 TP_ARGS(sb
, nr_to_scan
, cache_cnt
),
2447 __field( dev_t
, dev
)
2448 __field( int, nr_to_scan
)
2449 __field( int, cache_cnt
)
2453 __entry
->dev
= sb
->s_dev
;
2454 __entry
->nr_to_scan
= nr_to_scan
;
2455 __entry
->cache_cnt
= cache_cnt
;
2458 TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
2459 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2460 __entry
->nr_to_scan
, __entry
->cache_cnt
)
2463 DEFINE_EVENT(ext4__es_shrink_enter
, ext4_es_shrink_count
,
2464 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2466 TP_ARGS(sb
, nr_to_scan
, cache_cnt
)
2469 DEFINE_EVENT(ext4__es_shrink_enter
, ext4_es_shrink_scan_enter
,
2470 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2472 TP_ARGS(sb
, nr_to_scan
, cache_cnt
)
2475 TRACE_EVENT(ext4_es_shrink_scan_exit
,
2476 TP_PROTO(struct super_block
*sb
, int nr_shrunk
, int cache_cnt
),
2478 TP_ARGS(sb
, nr_shrunk
, cache_cnt
),
2481 __field( dev_t
, dev
)
2482 __field( int, nr_shrunk
)
2483 __field( int, cache_cnt
)
2487 __entry
->dev
= sb
->s_dev
;
2488 __entry
->nr_shrunk
= nr_shrunk
;
2489 __entry
->cache_cnt
= cache_cnt
;
2492 TP_printk("dev %d,%d nr_shrunk %d cache_cnt %d",
2493 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2494 __entry
->nr_shrunk
, __entry
->cache_cnt
)
2497 TRACE_EVENT(ext4_collapse_range
,
2498 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
),
2500 TP_ARGS(inode
, offset
, len
),
2505 __field(loff_t
, offset
)
2506 __field(loff_t
, len
)
2510 __entry
->dev
= inode
->i_sb
->s_dev
;
2511 __entry
->ino
= inode
->i_ino
;
2512 __entry
->offset
= offset
;
2516 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2517 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2518 (unsigned long) __entry
->ino
,
2519 __entry
->offset
, __entry
->len
)
2522 TRACE_EVENT(ext4_insert_range
,
2523 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
),
2525 TP_ARGS(inode
, offset
, len
),
2530 __field(loff_t
, offset
)
2531 __field(loff_t
, len
)
2535 __entry
->dev
= inode
->i_sb
->s_dev
;
2536 __entry
->ino
= inode
->i_ino
;
2537 __entry
->offset
= offset
;
2541 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2542 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2543 (unsigned long) __entry
->ino
,
2544 __entry
->offset
, __entry
->len
)
2547 TRACE_EVENT(ext4_es_shrink
,
2548 TP_PROTO(struct super_block
*sb
, int nr_shrunk
, u64 scan_time
,
2549 int nr_skipped
, int retried
),
2551 TP_ARGS(sb
, nr_shrunk
, scan_time
, nr_skipped
, retried
),
2554 __field( dev_t
, dev
)
2555 __field( int, nr_shrunk
)
2556 __field( unsigned long long, scan_time
)
2557 __field( int, nr_skipped
)
2558 __field( int, retried
)
2562 __entry
->dev
= sb
->s_dev
;
2563 __entry
->nr_shrunk
= nr_shrunk
;
2564 __entry
->scan_time
= div_u64(scan_time
, 1000);
2565 __entry
->nr_skipped
= nr_skipped
;
2566 __entry
->retried
= retried
;
2569 TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu "
2570 "nr_skipped %d retried %d",
2571 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->nr_shrunk
,
2572 __entry
->scan_time
, __entry
->nr_skipped
, __entry
->retried
)
2575 TRACE_EVENT(ext4_es_insert_delayed_block
,
2576 TP_PROTO(struct inode
*inode
, struct extent_status
*es
,
2579 TP_ARGS(inode
, es
, allocated
),
2582 __field( dev_t
, dev
)
2583 __field( ino_t
, ino
)
2584 __field( ext4_lblk_t
, lblk
)
2585 __field( ext4_lblk_t
, len
)
2586 __field( ext4_fsblk_t
, pblk
)
2587 __field( char, status
)
2588 __field( bool, allocated
)
2592 __entry
->dev
= inode
->i_sb
->s_dev
;
2593 __entry
->ino
= inode
->i_ino
;
2594 __entry
->lblk
= es
->es_lblk
;
2595 __entry
->len
= es
->es_len
;
2596 __entry
->pblk
= ext4_es_show_pblock(es
);
2597 __entry
->status
= ext4_es_status(es
);
2598 __entry
->allocated
= allocated
;
2601 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s "
2603 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2604 (unsigned long) __entry
->ino
,
2605 __entry
->lblk
, __entry
->len
,
2606 __entry
->pblk
, show_extent_status(__entry
->status
),
2611 DECLARE_EVENT_CLASS(ext4_fsmap_class
,
2612 TP_PROTO(struct super_block
*sb
, u32 keydev
, u32 agno
, u64 bno
, u64 len
,
2614 TP_ARGS(sb
, keydev
, agno
, bno
, len
, owner
),
2617 __field(dev_t
, keydev
)
2624 __entry
->dev
= sb
->s_bdev
->bd_dev
;
2625 __entry
->keydev
= new_decode_dev(keydev
);
2626 __entry
->agno
= agno
;
2629 __entry
->owner
= owner
;
2631 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld\n",
2632 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2633 MAJOR(__entry
->keydev
), MINOR(__entry
->keydev
),
2639 #define DEFINE_FSMAP_EVENT(name) \
2640 DEFINE_EVENT(ext4_fsmap_class, name, \
2641 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len, \
2643 TP_ARGS(sb, keydev, agno, bno, len, owner))
2644 DEFINE_FSMAP_EVENT(ext4_fsmap_low_key
);
2645 DEFINE_FSMAP_EVENT(ext4_fsmap_high_key
);
2646 DEFINE_FSMAP_EVENT(ext4_fsmap_mapping
);
2648 DECLARE_EVENT_CLASS(ext4_getfsmap_class
,
2649 TP_PROTO(struct super_block
*sb
, struct ext4_fsmap
*fsmap
),
2653 __field(dev_t
, keydev
)
2660 __entry
->dev
= sb
->s_bdev
->bd_dev
;
2661 __entry
->keydev
= new_decode_dev(fsmap
->fmr_device
);
2662 __entry
->block
= fsmap
->fmr_physical
;
2663 __entry
->len
= fsmap
->fmr_length
;
2664 __entry
->owner
= fsmap
->fmr_owner
;
2665 __entry
->flags
= fsmap
->fmr_flags
;
2667 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld flags 0x%llx\n",
2668 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2669 MAJOR(__entry
->keydev
), MINOR(__entry
->keydev
),
2675 #define DEFINE_GETFSMAP_EVENT(name) \
2676 DEFINE_EVENT(ext4_getfsmap_class, name, \
2677 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap), \
2679 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_low_key
);
2680 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_high_key
);
2681 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_mapping
);
2683 TRACE_EVENT(ext4_shutdown
,
2684 TP_PROTO(struct super_block
*sb
, unsigned long flags
),
2689 __field( dev_t
, dev
)
2690 __field( unsigned, flags
)
2694 __entry
->dev
= sb
->s_dev
;
2695 __entry
->flags
= flags
;
2698 TP_printk("dev %d,%d flags %u",
2699 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2703 TRACE_EVENT(ext4_error
,
2704 TP_PROTO(struct super_block
*sb
, const char *function
,
2707 TP_ARGS(sb
, function
, line
),
2710 __field( dev_t
, dev
)
2711 __field( const char *, function
)
2712 __field( unsigned, line
)
2716 __entry
->dev
= sb
->s_dev
;
2717 __entry
->function
= function
;
2718 __entry
->line
= line
;
2721 TP_printk("dev %d,%d function %s line %u",
2722 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2723 __entry
->function
, __entry
->line
)
2726 #endif /* _TRACE_EXT4_H */
2728 /* This part must be outside protection */
2729 #include <trace/define_trace.h>