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" })
51 #define show_mflags(flags) __print_flags(flags, "", \
52 { EXT4_MAP_NEW, "N" }, \
53 { EXT4_MAP_MAPPED, "M" }, \
54 { EXT4_MAP_UNWRITTEN, "U" }, \
55 { EXT4_MAP_BOUNDARY, "B" })
57 #define show_free_flags(flags) __print_flags(flags, "|", \
58 { EXT4_FREE_BLOCKS_METADATA, "METADATA" }, \
59 { EXT4_FREE_BLOCKS_FORGET, "FORGET" }, \
60 { EXT4_FREE_BLOCKS_VALIDATED, "VALIDATED" }, \
61 { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE, "NO_QUOTA" }, \
62 { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
63 { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
65 #define show_extent_status(status) __print_flags(status, "", \
66 { EXTENT_STATUS_WRITTEN, "W" }, \
67 { EXTENT_STATUS_UNWRITTEN, "U" }, \
68 { EXTENT_STATUS_DELAYED, "D" }, \
69 { EXTENT_STATUS_HOLE, "H" })
71 #define show_falloc_mode(mode) __print_flags(mode, "|", \
72 { FALLOC_FL_KEEP_SIZE, "KEEP_SIZE"}, \
73 { FALLOC_FL_PUNCH_HOLE, "PUNCH_HOLE"}, \
74 { FALLOC_FL_NO_HIDE_STALE, "NO_HIDE_STALE"}, \
75 { FALLOC_FL_COLLAPSE_RANGE, "COLLAPSE_RANGE"}, \
76 { FALLOC_FL_ZERO_RANGE, "ZERO_RANGE"})
79 TRACE_EVENT(ext4_other_inode_update_time
,
80 TP_PROTO(struct inode
*inode
, ino_t orig_ino
),
82 TP_ARGS(inode
, orig_ino
),
87 __field( ino_t
, orig_ino
)
90 __field( __u16
, mode
)
94 __entry
->orig_ino
= orig_ino
;
95 __entry
->dev
= inode
->i_sb
->s_dev
;
96 __entry
->ino
= inode
->i_ino
;
97 __entry
->uid
= i_uid_read(inode
);
98 __entry
->gid
= i_gid_read(inode
);
99 __entry
->mode
= inode
->i_mode
;
102 TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u",
103 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
104 (unsigned long) __entry
->orig_ino
,
105 (unsigned long) __entry
->ino
, __entry
->mode
,
106 __entry
->uid
, __entry
->gid
)
109 TRACE_EVENT(ext4_free_inode
,
110 TP_PROTO(struct inode
*inode
),
115 __field( dev_t
, dev
)
116 __field( ino_t
, ino
)
117 __field( uid_t
, uid
)
118 __field( gid_t
, gid
)
119 __field( __u64
, blocks
)
120 __field( __u16
, mode
)
124 __entry
->dev
= inode
->i_sb
->s_dev
;
125 __entry
->ino
= inode
->i_ino
;
126 __entry
->uid
= i_uid_read(inode
);
127 __entry
->gid
= i_gid_read(inode
);
128 __entry
->blocks
= inode
->i_blocks
;
129 __entry
->mode
= inode
->i_mode
;
132 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
133 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
134 (unsigned long) __entry
->ino
, __entry
->mode
,
135 __entry
->uid
, __entry
->gid
, __entry
->blocks
)
138 TRACE_EVENT(ext4_request_inode
,
139 TP_PROTO(struct inode
*dir
, int mode
),
144 __field( dev_t
, dev
)
145 __field( ino_t
, dir
)
146 __field( __u16
, mode
)
150 __entry
->dev
= dir
->i_sb
->s_dev
;
151 __entry
->dir
= dir
->i_ino
;
152 __entry
->mode
= mode
;
155 TP_printk("dev %d,%d dir %lu mode 0%o",
156 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
157 (unsigned long) __entry
->dir
, __entry
->mode
)
160 TRACE_EVENT(ext4_allocate_inode
,
161 TP_PROTO(struct inode
*inode
, struct inode
*dir
, int mode
),
163 TP_ARGS(inode
, dir
, mode
),
166 __field( dev_t
, dev
)
167 __field( ino_t
, ino
)
168 __field( ino_t
, dir
)
169 __field( __u16
, mode
)
173 __entry
->dev
= inode
->i_sb
->s_dev
;
174 __entry
->ino
= inode
->i_ino
;
175 __entry
->dir
= dir
->i_ino
;
176 __entry
->mode
= mode
;
179 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
180 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
181 (unsigned long) __entry
->ino
,
182 (unsigned long) __entry
->dir
, __entry
->mode
)
185 TRACE_EVENT(ext4_evict_inode
,
186 TP_PROTO(struct inode
*inode
),
191 __field( dev_t
, dev
)
192 __field( ino_t
, ino
)
193 __field( int, nlink
)
197 __entry
->dev
= inode
->i_sb
->s_dev
;
198 __entry
->ino
= inode
->i_ino
;
199 __entry
->nlink
= inode
->i_nlink
;
202 TP_printk("dev %d,%d ino %lu nlink %d",
203 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
204 (unsigned long) __entry
->ino
, __entry
->nlink
)
207 TRACE_EVENT(ext4_drop_inode
,
208 TP_PROTO(struct inode
*inode
, int drop
),
210 TP_ARGS(inode
, drop
),
213 __field( dev_t
, dev
)
214 __field( ino_t
, ino
)
219 __entry
->dev
= inode
->i_sb
->s_dev
;
220 __entry
->ino
= inode
->i_ino
;
221 __entry
->drop
= drop
;
224 TP_printk("dev %d,%d ino %lu drop %d",
225 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
226 (unsigned long) __entry
->ino
, __entry
->drop
)
229 TRACE_EVENT(ext4_nfs_commit_metadata
,
230 TP_PROTO(struct inode
*inode
),
235 __field( dev_t
, dev
)
236 __field( ino_t
, ino
)
240 __entry
->dev
= inode
->i_sb
->s_dev
;
241 __entry
->ino
= inode
->i_ino
;
244 TP_printk("dev %d,%d ino %lu",
245 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
246 (unsigned long) __entry
->ino
)
249 TRACE_EVENT(ext4_mark_inode_dirty
,
250 TP_PROTO(struct inode
*inode
, unsigned long IP
),
255 __field( dev_t
, dev
)
256 __field( ino_t
, ino
)
257 __field(unsigned long, ip
)
261 __entry
->dev
= inode
->i_sb
->s_dev
;
262 __entry
->ino
= inode
->i_ino
;
266 TP_printk("dev %d,%d ino %lu caller %pS",
267 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
268 (unsigned long) __entry
->ino
, (void *)__entry
->ip
)
271 TRACE_EVENT(ext4_begin_ordered_truncate
,
272 TP_PROTO(struct inode
*inode
, loff_t new_size
),
274 TP_ARGS(inode
, new_size
),
277 __field( dev_t
, dev
)
278 __field( ino_t
, ino
)
279 __field( loff_t
, new_size
)
283 __entry
->dev
= inode
->i_sb
->s_dev
;
284 __entry
->ino
= inode
->i_ino
;
285 __entry
->new_size
= new_size
;
288 TP_printk("dev %d,%d ino %lu new_size %lld",
289 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
290 (unsigned long) __entry
->ino
,
294 DECLARE_EVENT_CLASS(ext4__write_begin
,
296 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
299 TP_ARGS(inode
, pos
, len
, flags
),
302 __field( dev_t
, dev
)
303 __field( ino_t
, ino
)
304 __field( loff_t
, pos
)
305 __field( unsigned int, len
)
306 __field( unsigned int, flags
)
310 __entry
->dev
= inode
->i_sb
->s_dev
;
311 __entry
->ino
= inode
->i_ino
;
314 __entry
->flags
= flags
;
317 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
318 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
319 (unsigned long) __entry
->ino
,
320 __entry
->pos
, __entry
->len
, __entry
->flags
)
323 DEFINE_EVENT(ext4__write_begin
, ext4_write_begin
,
325 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
328 TP_ARGS(inode
, pos
, len
, flags
)
331 DEFINE_EVENT(ext4__write_begin
, ext4_da_write_begin
,
333 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
336 TP_ARGS(inode
, pos
, len
, flags
)
339 DECLARE_EVENT_CLASS(ext4__write_end
,
340 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
341 unsigned int copied
),
343 TP_ARGS(inode
, pos
, len
, copied
),
346 __field( dev_t
, dev
)
347 __field( ino_t
, ino
)
348 __field( loff_t
, pos
)
349 __field( unsigned int, len
)
350 __field( unsigned int, copied
)
354 __entry
->dev
= inode
->i_sb
->s_dev
;
355 __entry
->ino
= inode
->i_ino
;
358 __entry
->copied
= copied
;
361 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
362 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
363 (unsigned long) __entry
->ino
,
364 __entry
->pos
, __entry
->len
, __entry
->copied
)
367 DEFINE_EVENT(ext4__write_end
, ext4_write_end
,
369 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
370 unsigned int copied
),
372 TP_ARGS(inode
, pos
, len
, copied
)
375 DEFINE_EVENT(ext4__write_end
, ext4_journalled_write_end
,
377 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
378 unsigned int copied
),
380 TP_ARGS(inode
, pos
, len
, copied
)
383 DEFINE_EVENT(ext4__write_end
, ext4_da_write_end
,
385 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
386 unsigned int copied
),
388 TP_ARGS(inode
, pos
, len
, copied
)
391 TRACE_EVENT(ext4_writepages
,
392 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
397 __field( dev_t
, dev
)
398 __field( ino_t
, ino
)
399 __field( long, nr_to_write
)
400 __field( long, pages_skipped
)
401 __field( loff_t
, range_start
)
402 __field( loff_t
, range_end
)
403 __field( pgoff_t
, writeback_index
)
404 __field( int, sync_mode
)
405 __field( char, for_kupdate
)
406 __field( char, range_cyclic
)
410 __entry
->dev
= inode
->i_sb
->s_dev
;
411 __entry
->ino
= inode
->i_ino
;
412 __entry
->nr_to_write
= wbc
->nr_to_write
;
413 __entry
->pages_skipped
= wbc
->pages_skipped
;
414 __entry
->range_start
= wbc
->range_start
;
415 __entry
->range_end
= wbc
->range_end
;
416 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
417 __entry
->sync_mode
= wbc
->sync_mode
;
418 __entry
->for_kupdate
= wbc
->for_kupdate
;
419 __entry
->range_cyclic
= wbc
->range_cyclic
;
422 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
423 "range_start %lld range_end %lld sync_mode %d "
424 "for_kupdate %d range_cyclic %d writeback_index %lu",
425 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
426 (unsigned long) __entry
->ino
, __entry
->nr_to_write
,
427 __entry
->pages_skipped
, __entry
->range_start
,
428 __entry
->range_end
, __entry
->sync_mode
,
429 __entry
->for_kupdate
, __entry
->range_cyclic
,
430 (unsigned long) __entry
->writeback_index
)
433 TRACE_EVENT(ext4_da_write_pages
,
434 TP_PROTO(struct inode
*inode
, pgoff_t first_page
,
435 struct writeback_control
*wbc
),
437 TP_ARGS(inode
, first_page
, wbc
),
440 __field( dev_t
, dev
)
441 __field( ino_t
, ino
)
442 __field( pgoff_t
, first_page
)
443 __field( long, nr_to_write
)
444 __field( int, sync_mode
)
448 __entry
->dev
= inode
->i_sb
->s_dev
;
449 __entry
->ino
= inode
->i_ino
;
450 __entry
->first_page
= first_page
;
451 __entry
->nr_to_write
= wbc
->nr_to_write
;
452 __entry
->sync_mode
= wbc
->sync_mode
;
455 TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
457 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
458 (unsigned long) __entry
->ino
, __entry
->first_page
,
459 __entry
->nr_to_write
, __entry
->sync_mode
)
462 TRACE_EVENT(ext4_da_write_pages_extent
,
463 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
),
468 __field( dev_t
, dev
)
469 __field( ino_t
, ino
)
470 __field( __u64
, lblk
)
471 __field( __u32
, len
)
472 __field( __u32
, flags
)
476 __entry
->dev
= inode
->i_sb
->s_dev
;
477 __entry
->ino
= inode
->i_ino
;
478 __entry
->lblk
= map
->m_lblk
;
479 __entry
->len
= map
->m_len
;
480 __entry
->flags
= map
->m_flags
;
483 TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
484 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
485 (unsigned long) __entry
->ino
, __entry
->lblk
, __entry
->len
,
486 show_mflags(__entry
->flags
))
489 TRACE_EVENT(ext4_writepages_result
,
490 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
,
491 int ret
, int pages_written
),
493 TP_ARGS(inode
, wbc
, ret
, pages_written
),
496 __field( dev_t
, dev
)
497 __field( ino_t
, ino
)
499 __field( int, pages_written
)
500 __field( long, pages_skipped
)
501 __field( pgoff_t
, writeback_index
)
502 __field( int, sync_mode
)
506 __entry
->dev
= inode
->i_sb
->s_dev
;
507 __entry
->ino
= inode
->i_ino
;
509 __entry
->pages_written
= pages_written
;
510 __entry
->pages_skipped
= wbc
->pages_skipped
;
511 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
512 __entry
->sync_mode
= wbc
->sync_mode
;
515 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
516 "sync_mode %d writeback_index %lu",
517 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
518 (unsigned long) __entry
->ino
, __entry
->ret
,
519 __entry
->pages_written
, __entry
->pages_skipped
,
521 (unsigned long) __entry
->writeback_index
)
524 DECLARE_EVENT_CLASS(ext4__page_op
,
525 TP_PROTO(struct page
*page
),
530 __field( dev_t
, dev
)
531 __field( ino_t
, ino
)
532 __field( pgoff_t
, index
)
537 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
538 __entry
->ino
= page
->mapping
->host
->i_ino
;
539 __entry
->index
= page
->index
;
542 TP_printk("dev %d,%d ino %lu page_index %lu",
543 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
544 (unsigned long) __entry
->ino
,
545 (unsigned long) __entry
->index
)
548 DEFINE_EVENT(ext4__page_op
, ext4_writepage
,
550 TP_PROTO(struct page
*page
),
555 DEFINE_EVENT(ext4__page_op
, ext4_readpage
,
557 TP_PROTO(struct page
*page
),
562 DEFINE_EVENT(ext4__page_op
, ext4_releasepage
,
564 TP_PROTO(struct page
*page
),
569 DECLARE_EVENT_CLASS(ext4_invalidatepage_op
,
570 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
572 TP_ARGS(page
, offset
, length
),
575 __field( dev_t
, dev
)
576 __field( ino_t
, ino
)
577 __field( pgoff_t
, index
)
578 __field( unsigned int, offset
)
579 __field( unsigned int, length
)
583 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
584 __entry
->ino
= page
->mapping
->host
->i_ino
;
585 __entry
->index
= page
->index
;
586 __entry
->offset
= offset
;
587 __entry
->length
= length
;
590 TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
591 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
592 (unsigned long) __entry
->ino
,
593 (unsigned long) __entry
->index
,
594 __entry
->offset
, __entry
->length
)
597 DEFINE_EVENT(ext4_invalidatepage_op
, ext4_invalidatepage
,
598 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
600 TP_ARGS(page
, offset
, length
)
603 DEFINE_EVENT(ext4_invalidatepage_op
, ext4_journalled_invalidatepage
,
604 TP_PROTO(struct page
*page
, unsigned int offset
, unsigned int length
),
606 TP_ARGS(page
, offset
, length
)
609 TRACE_EVENT(ext4_discard_blocks
,
610 TP_PROTO(struct super_block
*sb
, unsigned long long blk
,
611 unsigned long long count
),
613 TP_ARGS(sb
, blk
, count
),
616 __field( dev_t
, dev
)
617 __field( __u64
, blk
)
618 __field( __u64
, count
)
623 __entry
->dev
= sb
->s_dev
;
625 __entry
->count
= count
;
628 TP_printk("dev %d,%d blk %llu count %llu",
629 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
630 __entry
->blk
, __entry
->count
)
633 DECLARE_EVENT_CLASS(ext4__mb_new_pa
,
634 TP_PROTO(struct ext4_allocation_context
*ac
,
635 struct ext4_prealloc_space
*pa
),
640 __field( dev_t
, dev
)
641 __field( ino_t
, ino
)
642 __field( __u64
, pa_pstart
)
643 __field( __u64
, pa_lstart
)
644 __field( __u32
, pa_len
)
649 __entry
->dev
= ac
->ac_sb
->s_dev
;
650 __entry
->ino
= ac
->ac_inode
->i_ino
;
651 __entry
->pa_pstart
= pa
->pa_pstart
;
652 __entry
->pa_lstart
= pa
->pa_lstart
;
653 __entry
->pa_len
= pa
->pa_len
;
656 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
657 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
658 (unsigned long) __entry
->ino
,
659 __entry
->pa_pstart
, __entry
->pa_len
, __entry
->pa_lstart
)
662 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_inode_pa
,
664 TP_PROTO(struct ext4_allocation_context
*ac
,
665 struct ext4_prealloc_space
*pa
),
670 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_group_pa
,
672 TP_PROTO(struct ext4_allocation_context
*ac
,
673 struct ext4_prealloc_space
*pa
),
678 TRACE_EVENT(ext4_mb_release_inode_pa
,
679 TP_PROTO(struct ext4_prealloc_space
*pa
,
680 unsigned long long block
, unsigned int count
),
682 TP_ARGS(pa
, block
, count
),
685 __field( dev_t
, dev
)
686 __field( ino_t
, ino
)
687 __field( __u64
, block
)
688 __field( __u32
, count
)
693 __entry
->dev
= pa
->pa_inode
->i_sb
->s_dev
;
694 __entry
->ino
= pa
->pa_inode
->i_ino
;
695 __entry
->block
= block
;
696 __entry
->count
= count
;
699 TP_printk("dev %d,%d ino %lu block %llu count %u",
700 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
701 (unsigned long) __entry
->ino
,
702 __entry
->block
, __entry
->count
)
705 TRACE_EVENT(ext4_mb_release_group_pa
,
706 TP_PROTO(struct super_block
*sb
, struct ext4_prealloc_space
*pa
),
711 __field( dev_t
, dev
)
712 __field( __u64
, pa_pstart
)
713 __field( __u32
, pa_len
)
718 __entry
->dev
= sb
->s_dev
;
719 __entry
->pa_pstart
= pa
->pa_pstart
;
720 __entry
->pa_len
= pa
->pa_len
;
723 TP_printk("dev %d,%d pstart %llu len %u",
724 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
725 __entry
->pa_pstart
, __entry
->pa_len
)
728 TRACE_EVENT(ext4_discard_preallocations
,
729 TP_PROTO(struct inode
*inode
),
734 __field( dev_t
, dev
)
735 __field( ino_t
, ino
)
740 __entry
->dev
= inode
->i_sb
->s_dev
;
741 __entry
->ino
= inode
->i_ino
;
744 TP_printk("dev %d,%d ino %lu",
745 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
746 (unsigned long) __entry
->ino
)
749 TRACE_EVENT(ext4_mb_discard_preallocations
,
750 TP_PROTO(struct super_block
*sb
, int needed
),
755 __field( dev_t
, dev
)
756 __field( int, needed
)
761 __entry
->dev
= sb
->s_dev
;
762 __entry
->needed
= needed
;
765 TP_printk("dev %d,%d needed %d",
766 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
770 TRACE_EVENT(ext4_request_blocks
,
771 TP_PROTO(struct ext4_allocation_request
*ar
),
776 __field( dev_t
, dev
)
777 __field( ino_t
, ino
)
778 __field( unsigned int, len
)
779 __field( __u32
, logical
)
780 __field( __u32
, lleft
)
781 __field( __u32
, lright
)
782 __field( __u64
, goal
)
783 __field( __u64
, pleft
)
784 __field( __u64
, pright
)
785 __field( unsigned int, flags
)
789 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
790 __entry
->ino
= ar
->inode
->i_ino
;
791 __entry
->len
= ar
->len
;
792 __entry
->logical
= ar
->logical
;
793 __entry
->goal
= ar
->goal
;
794 __entry
->lleft
= ar
->lleft
;
795 __entry
->lright
= ar
->lright
;
796 __entry
->pleft
= ar
->pleft
;
797 __entry
->pright
= ar
->pright
;
798 __entry
->flags
= ar
->flags
;
801 TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
802 "lleft %u lright %u pleft %llu pright %llu ",
803 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
804 (unsigned long) __entry
->ino
, show_mballoc_flags(__entry
->flags
),
805 __entry
->len
, __entry
->logical
, __entry
->goal
,
806 __entry
->lleft
, __entry
->lright
, __entry
->pleft
,
810 TRACE_EVENT(ext4_allocate_blocks
,
811 TP_PROTO(struct ext4_allocation_request
*ar
, unsigned long long block
),
816 __field( dev_t
, dev
)
817 __field( ino_t
, ino
)
818 __field( __u64
, block
)
819 __field( unsigned int, len
)
820 __field( __u32
, logical
)
821 __field( __u32
, lleft
)
822 __field( __u32
, lright
)
823 __field( __u64
, goal
)
824 __field( __u64
, pleft
)
825 __field( __u64
, pright
)
826 __field( unsigned int, flags
)
830 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
831 __entry
->ino
= ar
->inode
->i_ino
;
832 __entry
->block
= block
;
833 __entry
->len
= ar
->len
;
834 __entry
->logical
= ar
->logical
;
835 __entry
->goal
= ar
->goal
;
836 __entry
->lleft
= ar
->lleft
;
837 __entry
->lright
= ar
->lright
;
838 __entry
->pleft
= ar
->pleft
;
839 __entry
->pright
= ar
->pright
;
840 __entry
->flags
= ar
->flags
;
843 TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
844 "goal %llu lleft %u lright %u pleft %llu pright %llu",
845 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
846 (unsigned long) __entry
->ino
, show_mballoc_flags(__entry
->flags
),
847 __entry
->len
, __entry
->block
, __entry
->logical
,
848 __entry
->goal
, __entry
->lleft
, __entry
->lright
,
849 __entry
->pleft
, __entry
->pright
)
852 TRACE_EVENT(ext4_free_blocks
,
853 TP_PROTO(struct inode
*inode
, __u64 block
, unsigned long count
,
856 TP_ARGS(inode
, block
, count
, flags
),
859 __field( dev_t
, dev
)
860 __field( ino_t
, ino
)
861 __field( __u64
, block
)
862 __field( unsigned long, count
)
863 __field( int, flags
)
864 __field( __u16
, mode
)
868 __entry
->dev
= inode
->i_sb
->s_dev
;
869 __entry
->ino
= inode
->i_ino
;
870 __entry
->block
= block
;
871 __entry
->count
= count
;
872 __entry
->flags
= flags
;
873 __entry
->mode
= inode
->i_mode
;
876 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
877 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
878 (unsigned long) __entry
->ino
,
879 __entry
->mode
, __entry
->block
, __entry
->count
,
880 show_free_flags(__entry
->flags
))
883 TRACE_EVENT(ext4_sync_file_enter
,
884 TP_PROTO(struct file
*file
, int datasync
),
886 TP_ARGS(file
, datasync
),
889 __field( dev_t
, dev
)
890 __field( ino_t
, ino
)
891 __field( ino_t
, parent
)
892 __field( int, datasync
)
896 struct dentry
*dentry
= file
->f_path
.dentry
;
898 __entry
->dev
= dentry
->d_sb
->s_dev
;
899 __entry
->ino
= d_inode(dentry
)->i_ino
;
900 __entry
->datasync
= datasync
;
901 __entry
->parent
= d_inode(dentry
->d_parent
)->i_ino
;
904 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
905 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
906 (unsigned long) __entry
->ino
,
907 (unsigned long) __entry
->parent
, __entry
->datasync
)
910 TRACE_EVENT(ext4_sync_file_exit
,
911 TP_PROTO(struct inode
*inode
, int ret
),
916 __field( dev_t
, dev
)
917 __field( ino_t
, ino
)
922 __entry
->dev
= inode
->i_sb
->s_dev
;
923 __entry
->ino
= inode
->i_ino
;
927 TP_printk("dev %d,%d ino %lu ret %d",
928 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
929 (unsigned long) __entry
->ino
,
933 TRACE_EVENT(ext4_sync_fs
,
934 TP_PROTO(struct super_block
*sb
, int wait
),
939 __field( dev_t
, dev
)
945 __entry
->dev
= sb
->s_dev
;
946 __entry
->wait
= wait
;
949 TP_printk("dev %d,%d wait %d",
950 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
954 TRACE_EVENT(ext4_alloc_da_blocks
,
955 TP_PROTO(struct inode
*inode
),
960 __field( dev_t
, dev
)
961 __field( ino_t
, ino
)
962 __field( unsigned int, data_blocks
)
966 __entry
->dev
= inode
->i_sb
->s_dev
;
967 __entry
->ino
= inode
->i_ino
;
968 __entry
->data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
971 TP_printk("dev %d,%d ino %lu reserved_data_blocks %u",
972 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
973 (unsigned long) __entry
->ino
,
974 __entry
->data_blocks
)
977 TRACE_EVENT(ext4_mballoc_alloc
,
978 TP_PROTO(struct ext4_allocation_context
*ac
),
983 __field( dev_t
, dev
)
984 __field( ino_t
, ino
)
985 __field( __u32
, orig_logical
)
986 __field( int, orig_start
)
987 __field( __u32
, orig_group
)
988 __field( int, orig_len
)
989 __field( __u32
, goal_logical
)
990 __field( int, goal_start
)
991 __field( __u32
, goal_group
)
992 __field( int, goal_len
)
993 __field( __u32
, result_logical
)
994 __field( int, result_start
)
995 __field( __u32
, result_group
)
996 __field( int, result_len
)
997 __field( __u16
, found
)
998 __field( __u16
, groups
)
999 __field( __u16
, buddy
)
1000 __field( __u16
, flags
)
1001 __field( __u16
, tail
)
1006 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
1007 __entry
->ino
= ac
->ac_inode
->i_ino
;
1008 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
1009 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
1010 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
1011 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
1012 __entry
->goal_logical
= ac
->ac_g_ex
.fe_logical
;
1013 __entry
->goal_start
= ac
->ac_g_ex
.fe_start
;
1014 __entry
->goal_group
= ac
->ac_g_ex
.fe_group
;
1015 __entry
->goal_len
= ac
->ac_g_ex
.fe_len
;
1016 __entry
->result_logical
= ac
->ac_f_ex
.fe_logical
;
1017 __entry
->result_start
= ac
->ac_f_ex
.fe_start
;
1018 __entry
->result_group
= ac
->ac_f_ex
.fe_group
;
1019 __entry
->result_len
= ac
->ac_f_ex
.fe_len
;
1020 __entry
->found
= ac
->ac_found
;
1021 __entry
->flags
= ac
->ac_flags
;
1022 __entry
->groups
= ac
->ac_groups_scanned
;
1023 __entry
->buddy
= ac
->ac_buddy
;
1024 __entry
->tail
= ac
->ac_tail
;
1025 __entry
->cr
= ac
->ac_criteria
;
1028 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
1029 "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
1030 "tail %u broken %u",
1031 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1032 (unsigned long) __entry
->ino
,
1033 __entry
->orig_group
, __entry
->orig_start
,
1034 __entry
->orig_len
, __entry
->orig_logical
,
1035 __entry
->goal_group
, __entry
->goal_start
,
1036 __entry
->goal_len
, __entry
->goal_logical
,
1037 __entry
->result_group
, __entry
->result_start
,
1038 __entry
->result_len
, __entry
->result_logical
,
1039 __entry
->found
, __entry
->groups
, __entry
->cr
,
1040 show_mballoc_flags(__entry
->flags
), __entry
->tail
,
1041 __entry
->buddy
? 1 << __entry
->buddy
: 0)
1044 TRACE_EVENT(ext4_mballoc_prealloc
,
1045 TP_PROTO(struct ext4_allocation_context
*ac
),
1050 __field( dev_t
, dev
)
1051 __field( ino_t
, ino
)
1052 __field( __u32
, orig_logical
)
1053 __field( int, orig_start
)
1054 __field( __u32
, orig_group
)
1055 __field( int, orig_len
)
1056 __field( __u32
, result_logical
)
1057 __field( int, result_start
)
1058 __field( __u32
, result_group
)
1059 __field( int, result_len
)
1063 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
1064 __entry
->ino
= ac
->ac_inode
->i_ino
;
1065 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
1066 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
1067 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
1068 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
1069 __entry
->result_logical
= ac
->ac_b_ex
.fe_logical
;
1070 __entry
->result_start
= ac
->ac_b_ex
.fe_start
;
1071 __entry
->result_group
= ac
->ac_b_ex
.fe_group
;
1072 __entry
->result_len
= ac
->ac_b_ex
.fe_len
;
1075 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
1076 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1077 (unsigned long) __entry
->ino
,
1078 __entry
->orig_group
, __entry
->orig_start
,
1079 __entry
->orig_len
, __entry
->orig_logical
,
1080 __entry
->result_group
, __entry
->result_start
,
1081 __entry
->result_len
, __entry
->result_logical
)
1084 DECLARE_EVENT_CLASS(ext4__mballoc
,
1085 TP_PROTO(struct super_block
*sb
,
1086 struct inode
*inode
,
1088 ext4_grpblk_t start
,
1091 TP_ARGS(sb
, inode
, group
, start
, len
),
1094 __field( dev_t
, dev
)
1095 __field( ino_t
, ino
)
1096 __field( int, result_start
)
1097 __field( __u32
, result_group
)
1098 __field( int, result_len
)
1102 __entry
->dev
= sb
->s_dev
;
1103 __entry
->ino
= inode
? inode
->i_ino
: 0;
1104 __entry
->result_start
= start
;
1105 __entry
->result_group
= group
;
1106 __entry
->result_len
= len
;
1109 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
1110 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1111 (unsigned long) __entry
->ino
,
1112 __entry
->result_group
, __entry
->result_start
,
1113 __entry
->result_len
)
1116 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_discard
,
1118 TP_PROTO(struct super_block
*sb
,
1119 struct inode
*inode
,
1121 ext4_grpblk_t start
,
1124 TP_ARGS(sb
, inode
, group
, start
, len
)
1127 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_free
,
1129 TP_PROTO(struct super_block
*sb
,
1130 struct inode
*inode
,
1132 ext4_grpblk_t start
,
1135 TP_ARGS(sb
, inode
, group
, start
, len
)
1138 TRACE_EVENT(ext4_forget
,
1139 TP_PROTO(struct inode
*inode
, int is_metadata
, __u64 block
),
1141 TP_ARGS(inode
, is_metadata
, block
),
1144 __field( dev_t
, dev
)
1145 __field( ino_t
, ino
)
1146 __field( __u64
, block
)
1147 __field( int, is_metadata
)
1148 __field( __u16
, mode
)
1152 __entry
->dev
= inode
->i_sb
->s_dev
;
1153 __entry
->ino
= inode
->i_ino
;
1154 __entry
->block
= block
;
1155 __entry
->is_metadata
= is_metadata
;
1156 __entry
->mode
= inode
->i_mode
;
1159 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
1160 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1161 (unsigned long) __entry
->ino
,
1162 __entry
->mode
, __entry
->is_metadata
, __entry
->block
)
1165 TRACE_EVENT(ext4_da_update_reserve_space
,
1166 TP_PROTO(struct inode
*inode
, int used_blocks
, int quota_claim
),
1168 TP_ARGS(inode
, used_blocks
, quota_claim
),
1171 __field( dev_t
, dev
)
1172 __field( ino_t
, ino
)
1173 __field( __u64
, i_blocks
)
1174 __field( int, used_blocks
)
1175 __field( int, reserved_data_blocks
)
1176 __field( int, quota_claim
)
1177 __field( __u16
, mode
)
1181 __entry
->dev
= inode
->i_sb
->s_dev
;
1182 __entry
->ino
= inode
->i_ino
;
1183 __entry
->i_blocks
= inode
->i_blocks
;
1184 __entry
->used_blocks
= used_blocks
;
1185 __entry
->reserved_data_blocks
=
1186 EXT4_I(inode
)->i_reserved_data_blocks
;
1187 __entry
->quota_claim
= quota_claim
;
1188 __entry
->mode
= inode
->i_mode
;
1191 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1192 "reserved_data_blocks %d quota_claim %d",
1193 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1194 (unsigned long) __entry
->ino
,
1195 __entry
->mode
, __entry
->i_blocks
,
1196 __entry
->used_blocks
, __entry
->reserved_data_blocks
,
1197 __entry
->quota_claim
)
1200 TRACE_EVENT(ext4_da_reserve_space
,
1201 TP_PROTO(struct inode
*inode
),
1206 __field( dev_t
, dev
)
1207 __field( ino_t
, ino
)
1208 __field( __u64
, i_blocks
)
1209 __field( int, reserved_data_blocks
)
1210 __field( __u16
, mode
)
1214 __entry
->dev
= inode
->i_sb
->s_dev
;
1215 __entry
->ino
= inode
->i_ino
;
1216 __entry
->i_blocks
= inode
->i_blocks
;
1217 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
1218 __entry
->mode
= inode
->i_mode
;
1221 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu "
1222 "reserved_data_blocks %d",
1223 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1224 (unsigned long) __entry
->ino
,
1225 __entry
->mode
, __entry
->i_blocks
,
1226 __entry
->reserved_data_blocks
)
1229 TRACE_EVENT(ext4_da_release_space
,
1230 TP_PROTO(struct inode
*inode
, int freed_blocks
),
1232 TP_ARGS(inode
, freed_blocks
),
1235 __field( dev_t
, dev
)
1236 __field( ino_t
, ino
)
1237 __field( __u64
, i_blocks
)
1238 __field( int, freed_blocks
)
1239 __field( int, reserved_data_blocks
)
1240 __field( __u16
, mode
)
1244 __entry
->dev
= inode
->i_sb
->s_dev
;
1245 __entry
->ino
= inode
->i_ino
;
1246 __entry
->i_blocks
= inode
->i_blocks
;
1247 __entry
->freed_blocks
= freed_blocks
;
1248 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
1249 __entry
->mode
= inode
->i_mode
;
1252 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1253 "reserved_data_blocks %d",
1254 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1255 (unsigned long) __entry
->ino
,
1256 __entry
->mode
, __entry
->i_blocks
,
1257 __entry
->freed_blocks
, __entry
->reserved_data_blocks
)
1260 DECLARE_EVENT_CLASS(ext4__bitmap_load
,
1261 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1266 __field( dev_t
, dev
)
1267 __field( __u32
, group
)
1272 __entry
->dev
= sb
->s_dev
;
1273 __entry
->group
= group
;
1276 TP_printk("dev %d,%d group %u",
1277 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1281 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_bitmap_load
,
1283 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1288 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_buddy_bitmap_load
,
1290 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1295 DEFINE_EVENT(ext4__bitmap_load
, ext4_read_block_bitmap_load
,
1297 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1302 DEFINE_EVENT(ext4__bitmap_load
, ext4_load_inode_bitmap
,
1304 TP_PROTO(struct super_block
*sb
, unsigned long group
),
1309 TRACE_EVENT(ext4_direct_IO_enter
,
1310 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
, int rw
),
1312 TP_ARGS(inode
, offset
, len
, rw
),
1315 __field( dev_t
, dev
)
1316 __field( ino_t
, ino
)
1317 __field( loff_t
, pos
)
1318 __field( unsigned long, len
)
1323 __entry
->dev
= inode
->i_sb
->s_dev
;
1324 __entry
->ino
= inode
->i_ino
;
1325 __entry
->pos
= offset
;
1330 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
1331 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1332 (unsigned long) __entry
->ino
,
1333 __entry
->pos
, __entry
->len
, __entry
->rw
)
1336 TRACE_EVENT(ext4_direct_IO_exit
,
1337 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
,
1340 TP_ARGS(inode
, offset
, len
, rw
, ret
),
1343 __field( dev_t
, dev
)
1344 __field( ino_t
, ino
)
1345 __field( loff_t
, pos
)
1346 __field( unsigned long, len
)
1352 __entry
->dev
= inode
->i_sb
->s_dev
;
1353 __entry
->ino
= inode
->i_ino
;
1354 __entry
->pos
= offset
;
1360 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
1361 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1362 (unsigned long) __entry
->ino
,
1363 __entry
->pos
, __entry
->len
,
1364 __entry
->rw
, __entry
->ret
)
1367 DECLARE_EVENT_CLASS(ext4__fallocate_mode
,
1368 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1370 TP_ARGS(inode
, offset
, len
, mode
),
1373 __field( dev_t
, dev
)
1374 __field( ino_t
, ino
)
1375 __field( loff_t
, offset
)
1376 __field( loff_t
, len
)
1377 __field( int, mode
)
1381 __entry
->dev
= inode
->i_sb
->s_dev
;
1382 __entry
->ino
= inode
->i_ino
;
1383 __entry
->offset
= offset
;
1385 __entry
->mode
= mode
;
1388 TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
1389 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1390 (unsigned long) __entry
->ino
,
1391 __entry
->offset
, __entry
->len
,
1392 show_falloc_mode(__entry
->mode
))
1395 DEFINE_EVENT(ext4__fallocate_mode
, ext4_fallocate_enter
,
1397 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1399 TP_ARGS(inode
, offset
, len
, mode
)
1402 DEFINE_EVENT(ext4__fallocate_mode
, ext4_punch_hole
,
1404 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1406 TP_ARGS(inode
, offset
, len
, mode
)
1409 DEFINE_EVENT(ext4__fallocate_mode
, ext4_zero_range
,
1411 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
, int mode
),
1413 TP_ARGS(inode
, offset
, len
, mode
)
1416 TRACE_EVENT(ext4_fallocate_exit
,
1417 TP_PROTO(struct inode
*inode
, loff_t offset
,
1418 unsigned int max_blocks
, int ret
),
1420 TP_ARGS(inode
, offset
, max_blocks
, ret
),
1423 __field( dev_t
, dev
)
1424 __field( ino_t
, ino
)
1425 __field( loff_t
, pos
)
1426 __field( unsigned int, blocks
)
1431 __entry
->dev
= inode
->i_sb
->s_dev
;
1432 __entry
->ino
= inode
->i_ino
;
1433 __entry
->pos
= offset
;
1434 __entry
->blocks
= max_blocks
;
1438 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
1439 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1440 (unsigned long) __entry
->ino
,
1441 __entry
->pos
, __entry
->blocks
,
1445 TRACE_EVENT(ext4_unlink_enter
,
1446 TP_PROTO(struct inode
*parent
, struct dentry
*dentry
),
1448 TP_ARGS(parent
, dentry
),
1451 __field( dev_t
, dev
)
1452 __field( ino_t
, ino
)
1453 __field( ino_t
, parent
)
1454 __field( loff_t
, size
)
1458 __entry
->dev
= dentry
->d_sb
->s_dev
;
1459 __entry
->ino
= d_inode(dentry
)->i_ino
;
1460 __entry
->parent
= parent
->i_ino
;
1461 __entry
->size
= d_inode(dentry
)->i_size
;
1464 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
1465 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1466 (unsigned long) __entry
->ino
, __entry
->size
,
1467 (unsigned long) __entry
->parent
)
1470 TRACE_EVENT(ext4_unlink_exit
,
1471 TP_PROTO(struct dentry
*dentry
, int ret
),
1473 TP_ARGS(dentry
, ret
),
1476 __field( dev_t
, dev
)
1477 __field( ino_t
, ino
)
1482 __entry
->dev
= dentry
->d_sb
->s_dev
;
1483 __entry
->ino
= d_inode(dentry
)->i_ino
;
1487 TP_printk("dev %d,%d ino %lu ret %d",
1488 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1489 (unsigned long) __entry
->ino
,
1493 DECLARE_EVENT_CLASS(ext4__truncate
,
1494 TP_PROTO(struct inode
*inode
),
1499 __field( dev_t
, dev
)
1500 __field( ino_t
, ino
)
1501 __field( __u64
, blocks
)
1505 __entry
->dev
= inode
->i_sb
->s_dev
;
1506 __entry
->ino
= inode
->i_ino
;
1507 __entry
->blocks
= inode
->i_blocks
;
1510 TP_printk("dev %d,%d ino %lu blocks %llu",
1511 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1512 (unsigned long) __entry
->ino
, __entry
->blocks
)
1515 DEFINE_EVENT(ext4__truncate
, ext4_truncate_enter
,
1517 TP_PROTO(struct inode
*inode
),
1522 DEFINE_EVENT(ext4__truncate
, ext4_truncate_exit
,
1524 TP_PROTO(struct inode
*inode
),
1529 /* 'ux' is the unwritten extent. */
1530 TRACE_EVENT(ext4_ext_convert_to_initialized_enter
,
1531 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
,
1532 struct ext4_extent
*ux
),
1534 TP_ARGS(inode
, map
, ux
),
1537 __field( dev_t
, dev
)
1538 __field( ino_t
, ino
)
1539 __field( ext4_lblk_t
, m_lblk
)
1540 __field( unsigned, m_len
)
1541 __field( ext4_lblk_t
, u_lblk
)
1542 __field( unsigned, u_len
)
1543 __field( ext4_fsblk_t
, u_pblk
)
1547 __entry
->dev
= inode
->i_sb
->s_dev
;
1548 __entry
->ino
= inode
->i_ino
;
1549 __entry
->m_lblk
= map
->m_lblk
;
1550 __entry
->m_len
= map
->m_len
;
1551 __entry
->u_lblk
= le32_to_cpu(ux
->ee_block
);
1552 __entry
->u_len
= ext4_ext_get_actual_len(ux
);
1553 __entry
->u_pblk
= ext4_ext_pblock(ux
);
1556 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1558 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1559 (unsigned long) __entry
->ino
,
1560 __entry
->m_lblk
, __entry
->m_len
,
1561 __entry
->u_lblk
, __entry
->u_len
, __entry
->u_pblk
)
1565 * 'ux' is the unwritten extent.
1566 * 'ix' is the initialized extent to which blocks are transferred.
1568 TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath
,
1569 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
,
1570 struct ext4_extent
*ux
, struct ext4_extent
*ix
),
1572 TP_ARGS(inode
, map
, ux
, ix
),
1575 __field( dev_t
, dev
)
1576 __field( ino_t
, ino
)
1577 __field( ext4_lblk_t
, m_lblk
)
1578 __field( unsigned, m_len
)
1579 __field( ext4_lblk_t
, u_lblk
)
1580 __field( unsigned, u_len
)
1581 __field( ext4_fsblk_t
, u_pblk
)
1582 __field( ext4_lblk_t
, i_lblk
)
1583 __field( unsigned, i_len
)
1584 __field( ext4_fsblk_t
, i_pblk
)
1588 __entry
->dev
= inode
->i_sb
->s_dev
;
1589 __entry
->ino
= inode
->i_ino
;
1590 __entry
->m_lblk
= map
->m_lblk
;
1591 __entry
->m_len
= map
->m_len
;
1592 __entry
->u_lblk
= le32_to_cpu(ux
->ee_block
);
1593 __entry
->u_len
= ext4_ext_get_actual_len(ux
);
1594 __entry
->u_pblk
= ext4_ext_pblock(ux
);
1595 __entry
->i_lblk
= le32_to_cpu(ix
->ee_block
);
1596 __entry
->i_len
= ext4_ext_get_actual_len(ix
);
1597 __entry
->i_pblk
= ext4_ext_pblock(ix
);
1600 TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1601 "u_lblk %u u_len %u u_pblk %llu "
1602 "i_lblk %u i_len %u i_pblk %llu ",
1603 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1604 (unsigned long) __entry
->ino
,
1605 __entry
->m_lblk
, __entry
->m_len
,
1606 __entry
->u_lblk
, __entry
->u_len
, __entry
->u_pblk
,
1607 __entry
->i_lblk
, __entry
->i_len
, __entry
->i_pblk
)
1610 DECLARE_EVENT_CLASS(ext4__map_blocks_enter
,
1611 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1612 unsigned int len
, unsigned int flags
),
1614 TP_ARGS(inode
, lblk
, len
, flags
),
1617 __field( dev_t
, dev
)
1618 __field( ino_t
, ino
)
1619 __field( ext4_lblk_t
, lblk
)
1620 __field( unsigned int, len
)
1621 __field( unsigned int, flags
)
1625 __entry
->dev
= inode
->i_sb
->s_dev
;
1626 __entry
->ino
= inode
->i_ino
;
1627 __entry
->lblk
= lblk
;
1629 __entry
->flags
= flags
;
1632 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
1633 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1634 (unsigned long) __entry
->ino
,
1635 __entry
->lblk
, __entry
->len
, show_map_flags(__entry
->flags
))
1638 DEFINE_EVENT(ext4__map_blocks_enter
, ext4_ext_map_blocks_enter
,
1639 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1640 unsigned len
, unsigned flags
),
1642 TP_ARGS(inode
, lblk
, len
, flags
)
1645 DEFINE_EVENT(ext4__map_blocks_enter
, ext4_ind_map_blocks_enter
,
1646 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
,
1647 unsigned len
, unsigned flags
),
1649 TP_ARGS(inode
, lblk
, len
, flags
)
1652 DECLARE_EVENT_CLASS(ext4__map_blocks_exit
,
1653 TP_PROTO(struct inode
*inode
, unsigned flags
, struct ext4_map_blocks
*map
,
1656 TP_ARGS(inode
, flags
, map
, ret
),
1659 __field( dev_t
, dev
)
1660 __field( ino_t
, ino
)
1661 __field( unsigned int, flags
)
1662 __field( ext4_fsblk_t
, pblk
)
1663 __field( ext4_lblk_t
, lblk
)
1664 __field( unsigned int, len
)
1665 __field( unsigned int, mflags
)
1670 __entry
->dev
= inode
->i_sb
->s_dev
;
1671 __entry
->ino
= inode
->i_ino
;
1672 __entry
->flags
= flags
;
1673 __entry
->pblk
= map
->m_pblk
;
1674 __entry
->lblk
= map
->m_lblk
;
1675 __entry
->len
= map
->m_len
;
1676 __entry
->mflags
= map
->m_flags
;
1680 TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
1682 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1683 (unsigned long) __entry
->ino
,
1684 show_map_flags(__entry
->flags
), __entry
->lblk
, __entry
->pblk
,
1685 __entry
->len
, show_mflags(__entry
->mflags
), __entry
->ret
)
1688 DEFINE_EVENT(ext4__map_blocks_exit
, ext4_ext_map_blocks_exit
,
1689 TP_PROTO(struct inode
*inode
, unsigned flags
,
1690 struct ext4_map_blocks
*map
, int ret
),
1692 TP_ARGS(inode
, flags
, map
, ret
)
1695 DEFINE_EVENT(ext4__map_blocks_exit
, ext4_ind_map_blocks_exit
,
1696 TP_PROTO(struct inode
*inode
, unsigned flags
,
1697 struct ext4_map_blocks
*map
, int ret
),
1699 TP_ARGS(inode
, flags
, map
, ret
)
1702 TRACE_EVENT(ext4_ext_load_extent
,
1703 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_fsblk_t pblk
),
1705 TP_ARGS(inode
, lblk
, pblk
),
1708 __field( dev_t
, dev
)
1709 __field( ino_t
, ino
)
1710 __field( ext4_fsblk_t
, pblk
)
1711 __field( ext4_lblk_t
, lblk
)
1715 __entry
->dev
= inode
->i_sb
->s_dev
;
1716 __entry
->ino
= inode
->i_ino
;
1717 __entry
->pblk
= pblk
;
1718 __entry
->lblk
= lblk
;
1721 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1722 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1723 (unsigned long) __entry
->ino
,
1724 __entry
->lblk
, __entry
->pblk
)
1727 TRACE_EVENT(ext4_load_inode
,
1728 TP_PROTO(struct inode
*inode
),
1733 __field( dev_t
, dev
)
1734 __field( ino_t
, ino
)
1738 __entry
->dev
= inode
->i_sb
->s_dev
;
1739 __entry
->ino
= inode
->i_ino
;
1742 TP_printk("dev %d,%d ino %ld",
1743 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1744 (unsigned long) __entry
->ino
)
1747 TRACE_EVENT(ext4_journal_start
,
1748 TP_PROTO(struct super_block
*sb
, int blocks
, int rsv_blocks
,
1751 TP_ARGS(sb
, blocks
, rsv_blocks
, IP
),
1754 __field( dev_t
, dev
)
1755 __field(unsigned long, ip
)
1756 __field( int, blocks
)
1757 __field( int, rsv_blocks
)
1761 __entry
->dev
= sb
->s_dev
;
1763 __entry
->blocks
= blocks
;
1764 __entry
->rsv_blocks
= rsv_blocks
;
1767 TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pS",
1768 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1769 __entry
->blocks
, __entry
->rsv_blocks
, (void *)__entry
->ip
)
1772 TRACE_EVENT(ext4_journal_start_reserved
,
1773 TP_PROTO(struct super_block
*sb
, int blocks
, unsigned long IP
),
1775 TP_ARGS(sb
, blocks
, IP
),
1778 __field( dev_t
, dev
)
1779 __field(unsigned long, ip
)
1780 __field( int, blocks
)
1784 __entry
->dev
= sb
->s_dev
;
1786 __entry
->blocks
= blocks
;
1789 TP_printk("dev %d,%d blocks, %d caller %pS",
1790 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1791 __entry
->blocks
, (void *)__entry
->ip
)
1794 DECLARE_EVENT_CLASS(ext4__trim
,
1795 TP_PROTO(struct super_block
*sb
,
1797 ext4_grpblk_t start
,
1800 TP_ARGS(sb
, group
, start
, len
),
1803 __field( int, dev_major
)
1804 __field( int, dev_minor
)
1805 __field( __u32
, group
)
1806 __field( int, start
)
1811 __entry
->dev_major
= MAJOR(sb
->s_dev
);
1812 __entry
->dev_minor
= MINOR(sb
->s_dev
);
1813 __entry
->group
= group
;
1814 __entry
->start
= start
;
1818 TP_printk("dev %d,%d group %u, start %d, len %d",
1819 __entry
->dev_major
, __entry
->dev_minor
,
1820 __entry
->group
, __entry
->start
, __entry
->len
)
1823 DEFINE_EVENT(ext4__trim
, ext4_trim_extent
,
1825 TP_PROTO(struct super_block
*sb
,
1827 ext4_grpblk_t start
,
1830 TP_ARGS(sb
, group
, start
, len
)
1833 DEFINE_EVENT(ext4__trim
, ext4_trim_all_free
,
1835 TP_PROTO(struct super_block
*sb
,
1837 ext4_grpblk_t start
,
1840 TP_ARGS(sb
, group
, start
, len
)
1843 TRACE_EVENT(ext4_ext_handle_unwritten_extents
,
1844 TP_PROTO(struct inode
*inode
, struct ext4_map_blocks
*map
, int flags
,
1845 unsigned int allocated
, ext4_fsblk_t newblock
),
1847 TP_ARGS(inode
, map
, flags
, allocated
, newblock
),
1850 __field( dev_t
, dev
)
1851 __field( ino_t
, ino
)
1852 __field( int, flags
)
1853 __field( ext4_lblk_t
, lblk
)
1854 __field( ext4_fsblk_t
, pblk
)
1855 __field( unsigned int, len
)
1856 __field( unsigned int, allocated
)
1857 __field( ext4_fsblk_t
, newblk
)
1861 __entry
->dev
= inode
->i_sb
->s_dev
;
1862 __entry
->ino
= inode
->i_ino
;
1863 __entry
->flags
= flags
;
1864 __entry
->lblk
= map
->m_lblk
;
1865 __entry
->pblk
= map
->m_pblk
;
1866 __entry
->len
= map
->m_len
;
1867 __entry
->allocated
= allocated
;
1868 __entry
->newblk
= newblock
;
1871 TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %s "
1872 "allocated %d newblock %llu",
1873 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1874 (unsigned long) __entry
->ino
,
1875 (unsigned) __entry
->lblk
, (unsigned long long) __entry
->pblk
,
1876 __entry
->len
, show_map_flags(__entry
->flags
),
1877 (unsigned int) __entry
->allocated
,
1878 (unsigned long long) __entry
->newblk
)
1881 TRACE_EVENT(ext4_get_implied_cluster_alloc_exit
,
1882 TP_PROTO(struct super_block
*sb
, struct ext4_map_blocks
*map
, int ret
),
1884 TP_ARGS(sb
, map
, ret
),
1887 __field( dev_t
, dev
)
1888 __field( unsigned int, flags
)
1889 __field( ext4_lblk_t
, lblk
)
1890 __field( ext4_fsblk_t
, pblk
)
1891 __field( unsigned int, len
)
1896 __entry
->dev
= sb
->s_dev
;
1897 __entry
->flags
= map
->m_flags
;
1898 __entry
->lblk
= map
->m_lblk
;
1899 __entry
->pblk
= map
->m_pblk
;
1900 __entry
->len
= map
->m_len
;
1904 TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %s ret %d",
1905 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1906 __entry
->lblk
, (unsigned long long) __entry
->pblk
,
1907 __entry
->len
, show_mflags(__entry
->flags
), __entry
->ret
)
1910 TRACE_EVENT(ext4_ext_put_in_cache
,
1911 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, unsigned int len
,
1912 ext4_fsblk_t start
),
1914 TP_ARGS(inode
, lblk
, len
, start
),
1917 __field( dev_t
, dev
)
1918 __field( ino_t
, ino
)
1919 __field( ext4_lblk_t
, lblk
)
1920 __field( unsigned int, len
)
1921 __field( ext4_fsblk_t
, start
)
1925 __entry
->dev
= inode
->i_sb
->s_dev
;
1926 __entry
->ino
= inode
->i_ino
;
1927 __entry
->lblk
= lblk
;
1929 __entry
->start
= start
;
1932 TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1933 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1934 (unsigned long) __entry
->ino
,
1935 (unsigned) __entry
->lblk
,
1937 (unsigned long long) __entry
->start
)
1940 TRACE_EVENT(ext4_ext_in_cache
,
1941 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, int ret
),
1943 TP_ARGS(inode
, lblk
, ret
),
1946 __field( dev_t
, dev
)
1947 __field( ino_t
, ino
)
1948 __field( ext4_lblk_t
, lblk
)
1953 __entry
->dev
= inode
->i_sb
->s_dev
;
1954 __entry
->ino
= inode
->i_ino
;
1955 __entry
->lblk
= lblk
;
1959 TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1960 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1961 (unsigned long) __entry
->ino
,
1962 (unsigned) __entry
->lblk
,
1967 TRACE_EVENT(ext4_find_delalloc_range
,
1968 TP_PROTO(struct inode
*inode
, ext4_lblk_t from
, ext4_lblk_t to
,
1969 int reverse
, int found
, ext4_lblk_t found_blk
),
1971 TP_ARGS(inode
, from
, to
, reverse
, found
, found_blk
),
1974 __field( dev_t
, dev
)
1975 __field( ino_t
, ino
)
1976 __field( ext4_lblk_t
, from
)
1977 __field( ext4_lblk_t
, to
)
1978 __field( int, reverse
)
1979 __field( int, found
)
1980 __field( ext4_lblk_t
, found_blk
)
1984 __entry
->dev
= inode
->i_sb
->s_dev
;
1985 __entry
->ino
= inode
->i_ino
;
1986 __entry
->from
= from
;
1988 __entry
->reverse
= reverse
;
1989 __entry
->found
= found
;
1990 __entry
->found_blk
= found_blk
;
1993 TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1995 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
1996 (unsigned long) __entry
->ino
,
1997 (unsigned) __entry
->from
, (unsigned) __entry
->to
,
1998 __entry
->reverse
, __entry
->found
,
1999 (unsigned) __entry
->found_blk
)
2002 TRACE_EVENT(ext4_get_reserved_cluster_alloc
,
2003 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, unsigned int len
),
2005 TP_ARGS(inode
, lblk
, len
),
2008 __field( dev_t
, dev
)
2009 __field( ino_t
, ino
)
2010 __field( ext4_lblk_t
, lblk
)
2011 __field( unsigned int, len
)
2015 __entry
->dev
= inode
->i_sb
->s_dev
;
2016 __entry
->ino
= inode
->i_ino
;
2017 __entry
->lblk
= lblk
;
2021 TP_printk("dev %d,%d ino %lu lblk %u len %u",
2022 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2023 (unsigned long) __entry
->ino
,
2024 (unsigned) __entry
->lblk
,
2028 TRACE_EVENT(ext4_ext_show_extent
,
2029 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_fsblk_t pblk
,
2030 unsigned short len
),
2032 TP_ARGS(inode
, lblk
, pblk
, len
),
2035 __field( dev_t
, dev
)
2036 __field( ino_t
, ino
)
2037 __field( ext4_fsblk_t
, pblk
)
2038 __field( ext4_lblk_t
, lblk
)
2039 __field( unsigned short, len
)
2043 __entry
->dev
= inode
->i_sb
->s_dev
;
2044 __entry
->ino
= inode
->i_ino
;
2045 __entry
->pblk
= pblk
;
2046 __entry
->lblk
= lblk
;
2050 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
2051 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2052 (unsigned long) __entry
->ino
,
2053 (unsigned) __entry
->lblk
,
2054 (unsigned long long) __entry
->pblk
,
2055 (unsigned short) __entry
->len
)
2058 TRACE_EVENT(ext4_remove_blocks
,
2059 TP_PROTO(struct inode
*inode
, struct ext4_extent
*ex
,
2060 ext4_lblk_t from
, ext4_fsblk_t to
,
2061 struct partial_cluster
*pc
),
2063 TP_ARGS(inode
, ex
, from
, to
, pc
),
2066 __field( dev_t
, dev
)
2067 __field( ino_t
, ino
)
2068 __field( ext4_lblk_t
, from
)
2069 __field( ext4_lblk_t
, to
)
2070 __field( ext4_fsblk_t
, ee_pblk
)
2071 __field( ext4_lblk_t
, ee_lblk
)
2072 __field( unsigned short, ee_len
)
2073 __field( ext4_fsblk_t
, pc_pclu
)
2074 __field( ext4_lblk_t
, pc_lblk
)
2075 __field( int, pc_state
)
2079 __entry
->dev
= inode
->i_sb
->s_dev
;
2080 __entry
->ino
= inode
->i_ino
;
2081 __entry
->from
= from
;
2083 __entry
->ee_pblk
= ext4_ext_pblock(ex
);
2084 __entry
->ee_lblk
= le32_to_cpu(ex
->ee_block
);
2085 __entry
->ee_len
= ext4_ext_get_actual_len(ex
);
2086 __entry
->pc_pclu
= pc
->pclu
;
2087 __entry
->pc_lblk
= pc
->lblk
;
2088 __entry
->pc_state
= pc
->state
;
2091 TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
2092 "from %u to %u partial [pclu %lld lblk %u state %d]",
2093 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2094 (unsigned long) __entry
->ino
,
2095 (unsigned) __entry
->ee_lblk
,
2096 (unsigned long long) __entry
->ee_pblk
,
2097 (unsigned short) __entry
->ee_len
,
2098 (unsigned) __entry
->from
,
2099 (unsigned) __entry
->to
,
2100 (long long) __entry
->pc_pclu
,
2101 (unsigned int) __entry
->pc_lblk
,
2102 (int) __entry
->pc_state
)
2105 TRACE_EVENT(ext4_ext_rm_leaf
,
2106 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
,
2107 struct ext4_extent
*ex
,
2108 struct partial_cluster
*pc
),
2110 TP_ARGS(inode
, start
, ex
, pc
),
2113 __field( dev_t
, dev
)
2114 __field( ino_t
, ino
)
2115 __field( ext4_lblk_t
, start
)
2116 __field( ext4_lblk_t
, ee_lblk
)
2117 __field( ext4_fsblk_t
, ee_pblk
)
2118 __field( short, ee_len
)
2119 __field( ext4_fsblk_t
, pc_pclu
)
2120 __field( ext4_lblk_t
, pc_lblk
)
2121 __field( int, pc_state
)
2125 __entry
->dev
= inode
->i_sb
->s_dev
;
2126 __entry
->ino
= inode
->i_ino
;
2127 __entry
->start
= start
;
2128 __entry
->ee_lblk
= le32_to_cpu(ex
->ee_block
);
2129 __entry
->ee_pblk
= ext4_ext_pblock(ex
);
2130 __entry
->ee_len
= ext4_ext_get_actual_len(ex
);
2131 __entry
->pc_pclu
= pc
->pclu
;
2132 __entry
->pc_lblk
= pc
->lblk
;
2133 __entry
->pc_state
= pc
->state
;
2136 TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
2137 "partial [pclu %lld lblk %u state %d]",
2138 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2139 (unsigned long) __entry
->ino
,
2140 (unsigned) __entry
->start
,
2141 (unsigned) __entry
->ee_lblk
,
2142 (unsigned long long) __entry
->ee_pblk
,
2143 (unsigned short) __entry
->ee_len
,
2144 (long long) __entry
->pc_pclu
,
2145 (unsigned int) __entry
->pc_lblk
,
2146 (int) __entry
->pc_state
)
2149 TRACE_EVENT(ext4_ext_rm_idx
,
2150 TP_PROTO(struct inode
*inode
, ext4_fsblk_t pblk
),
2152 TP_ARGS(inode
, pblk
),
2155 __field( dev_t
, dev
)
2156 __field( ino_t
, ino
)
2157 __field( ext4_fsblk_t
, pblk
)
2161 __entry
->dev
= inode
->i_sb
->s_dev
;
2162 __entry
->ino
= inode
->i_ino
;
2163 __entry
->pblk
= pblk
;
2166 TP_printk("dev %d,%d ino %lu index_pblk %llu",
2167 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2168 (unsigned long) __entry
->ino
,
2169 (unsigned long long) __entry
->pblk
)
2172 TRACE_EVENT(ext4_ext_remove_space
,
2173 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
,
2174 ext4_lblk_t end
, int depth
),
2176 TP_ARGS(inode
, start
, end
, depth
),
2179 __field( dev_t
, dev
)
2180 __field( ino_t
, ino
)
2181 __field( ext4_lblk_t
, start
)
2182 __field( ext4_lblk_t
, end
)
2183 __field( int, depth
)
2187 __entry
->dev
= inode
->i_sb
->s_dev
;
2188 __entry
->ino
= inode
->i_ino
;
2189 __entry
->start
= start
;
2191 __entry
->depth
= depth
;
2194 TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
2195 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2196 (unsigned long) __entry
->ino
,
2197 (unsigned) __entry
->start
,
2198 (unsigned) __entry
->end
,
2202 TRACE_EVENT(ext4_ext_remove_space_done
,
2203 TP_PROTO(struct inode
*inode
, ext4_lblk_t start
, ext4_lblk_t end
,
2204 int depth
, struct partial_cluster
*pc
, __le16 eh_entries
),
2206 TP_ARGS(inode
, start
, end
, depth
, pc
, eh_entries
),
2209 __field( dev_t
, dev
)
2210 __field( ino_t
, ino
)
2211 __field( ext4_lblk_t
, start
)
2212 __field( ext4_lblk_t
, end
)
2213 __field( int, depth
)
2214 __field( ext4_fsblk_t
, pc_pclu
)
2215 __field( ext4_lblk_t
, pc_lblk
)
2216 __field( int, pc_state
)
2217 __field( unsigned short, eh_entries
)
2221 __entry
->dev
= inode
->i_sb
->s_dev
;
2222 __entry
->ino
= inode
->i_ino
;
2223 __entry
->start
= start
;
2225 __entry
->depth
= depth
;
2226 __entry
->pc_pclu
= pc
->pclu
;
2227 __entry
->pc_lblk
= pc
->lblk
;
2228 __entry
->pc_state
= pc
->state
;
2229 __entry
->eh_entries
= le16_to_cpu(eh_entries
);
2232 TP_printk("dev %d,%d ino %lu since %u end %u depth %d "
2233 "partial [pclu %lld lblk %u state %d] "
2234 "remaining_entries %u",
2235 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2236 (unsigned long) __entry
->ino
,
2237 (unsigned) __entry
->start
,
2238 (unsigned) __entry
->end
,
2240 (long long) __entry
->pc_pclu
,
2241 (unsigned int) __entry
->pc_lblk
,
2242 (int) __entry
->pc_state
,
2243 (unsigned short) __entry
->eh_entries
)
2246 DECLARE_EVENT_CLASS(ext4__es_extent
,
2247 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2252 __field( dev_t
, dev
)
2253 __field( ino_t
, ino
)
2254 __field( ext4_lblk_t
, lblk
)
2255 __field( ext4_lblk_t
, len
)
2256 __field( ext4_fsblk_t
, pblk
)
2257 __field( char, status
)
2261 __entry
->dev
= inode
->i_sb
->s_dev
;
2262 __entry
->ino
= inode
->i_ino
;
2263 __entry
->lblk
= es
->es_lblk
;
2264 __entry
->len
= es
->es_len
;
2265 __entry
->pblk
= ext4_es_pblock(es
);
2266 __entry
->status
= ext4_es_status(es
);
2269 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
2270 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2271 (unsigned long) __entry
->ino
,
2272 __entry
->lblk
, __entry
->len
,
2273 __entry
->pblk
, show_extent_status(__entry
->status
))
2276 DEFINE_EVENT(ext4__es_extent
, ext4_es_insert_extent
,
2277 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2282 DEFINE_EVENT(ext4__es_extent
, ext4_es_cache_extent
,
2283 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2288 TRACE_EVENT(ext4_es_remove_extent
,
2289 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
, ext4_lblk_t len
),
2291 TP_ARGS(inode
, lblk
, len
),
2294 __field( dev_t
, dev
)
2295 __field( ino_t
, ino
)
2296 __field( loff_t
, lblk
)
2297 __field( loff_t
, len
)
2301 __entry
->dev
= inode
->i_sb
->s_dev
;
2302 __entry
->ino
= inode
->i_ino
;
2303 __entry
->lblk
= lblk
;
2307 TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
2308 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2309 (unsigned long) __entry
->ino
,
2310 __entry
->lblk
, __entry
->len
)
2313 TRACE_EVENT(ext4_es_find_extent_range_enter
,
2314 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
),
2316 TP_ARGS(inode
, lblk
),
2319 __field( dev_t
, dev
)
2320 __field( ino_t
, ino
)
2321 __field( ext4_lblk_t
, lblk
)
2325 __entry
->dev
= inode
->i_sb
->s_dev
;
2326 __entry
->ino
= inode
->i_ino
;
2327 __entry
->lblk
= lblk
;
2330 TP_printk("dev %d,%d ino %lu lblk %u",
2331 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2332 (unsigned long) __entry
->ino
, __entry
->lblk
)
2335 TRACE_EVENT(ext4_es_find_extent_range_exit
,
2336 TP_PROTO(struct inode
*inode
, struct extent_status
*es
),
2341 __field( dev_t
, dev
)
2342 __field( ino_t
, ino
)
2343 __field( ext4_lblk_t
, lblk
)
2344 __field( ext4_lblk_t
, len
)
2345 __field( ext4_fsblk_t
, pblk
)
2346 __field( char, status
)
2350 __entry
->dev
= inode
->i_sb
->s_dev
;
2351 __entry
->ino
= inode
->i_ino
;
2352 __entry
->lblk
= es
->es_lblk
;
2353 __entry
->len
= es
->es_len
;
2354 __entry
->pblk
= ext4_es_pblock(es
);
2355 __entry
->status
= ext4_es_status(es
);
2358 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
2359 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2360 (unsigned long) __entry
->ino
,
2361 __entry
->lblk
, __entry
->len
,
2362 __entry
->pblk
, show_extent_status(__entry
->status
))
2365 TRACE_EVENT(ext4_es_lookup_extent_enter
,
2366 TP_PROTO(struct inode
*inode
, ext4_lblk_t lblk
),
2368 TP_ARGS(inode
, lblk
),
2371 __field( dev_t
, dev
)
2372 __field( ino_t
, ino
)
2373 __field( ext4_lblk_t
, lblk
)
2377 __entry
->dev
= inode
->i_sb
->s_dev
;
2378 __entry
->ino
= inode
->i_ino
;
2379 __entry
->lblk
= lblk
;
2382 TP_printk("dev %d,%d ino %lu lblk %u",
2383 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2384 (unsigned long) __entry
->ino
, __entry
->lblk
)
2387 TRACE_EVENT(ext4_es_lookup_extent_exit
,
2388 TP_PROTO(struct inode
*inode
, struct extent_status
*es
,
2391 TP_ARGS(inode
, es
, found
),
2394 __field( dev_t
, dev
)
2395 __field( ino_t
, ino
)
2396 __field( ext4_lblk_t
, lblk
)
2397 __field( ext4_lblk_t
, len
)
2398 __field( ext4_fsblk_t
, pblk
)
2399 __field( char, status
)
2400 __field( int, found
)
2404 __entry
->dev
= inode
->i_sb
->s_dev
;
2405 __entry
->ino
= inode
->i_ino
;
2406 __entry
->lblk
= es
->es_lblk
;
2407 __entry
->len
= es
->es_len
;
2408 __entry
->pblk
= ext4_es_pblock(es
);
2409 __entry
->status
= ext4_es_status(es
);
2410 __entry
->found
= found
;
2413 TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
2414 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2415 (unsigned long) __entry
->ino
, __entry
->found
,
2416 __entry
->lblk
, __entry
->len
,
2417 __entry
->found
? __entry
->pblk
: 0,
2418 show_extent_status(__entry
->found
? __entry
->status
: 0))
2421 DECLARE_EVENT_CLASS(ext4__es_shrink_enter
,
2422 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2424 TP_ARGS(sb
, nr_to_scan
, cache_cnt
),
2427 __field( dev_t
, dev
)
2428 __field( int, nr_to_scan
)
2429 __field( int, cache_cnt
)
2433 __entry
->dev
= sb
->s_dev
;
2434 __entry
->nr_to_scan
= nr_to_scan
;
2435 __entry
->cache_cnt
= cache_cnt
;
2438 TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
2439 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2440 __entry
->nr_to_scan
, __entry
->cache_cnt
)
2443 DEFINE_EVENT(ext4__es_shrink_enter
, ext4_es_shrink_count
,
2444 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2446 TP_ARGS(sb
, nr_to_scan
, cache_cnt
)
2449 DEFINE_EVENT(ext4__es_shrink_enter
, ext4_es_shrink_scan_enter
,
2450 TP_PROTO(struct super_block
*sb
, int nr_to_scan
, int cache_cnt
),
2452 TP_ARGS(sb
, nr_to_scan
, cache_cnt
)
2455 TRACE_EVENT(ext4_es_shrink_scan_exit
,
2456 TP_PROTO(struct super_block
*sb
, int nr_shrunk
, int cache_cnt
),
2458 TP_ARGS(sb
, nr_shrunk
, cache_cnt
),
2461 __field( dev_t
, dev
)
2462 __field( int, nr_shrunk
)
2463 __field( int, cache_cnt
)
2467 __entry
->dev
= sb
->s_dev
;
2468 __entry
->nr_shrunk
= nr_shrunk
;
2469 __entry
->cache_cnt
= cache_cnt
;
2472 TP_printk("dev %d,%d nr_shrunk %d cache_cnt %d",
2473 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2474 __entry
->nr_shrunk
, __entry
->cache_cnt
)
2477 TRACE_EVENT(ext4_collapse_range
,
2478 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
),
2480 TP_ARGS(inode
, offset
, len
),
2485 __field(loff_t
, offset
)
2486 __field(loff_t
, len
)
2490 __entry
->dev
= inode
->i_sb
->s_dev
;
2491 __entry
->ino
= inode
->i_ino
;
2492 __entry
->offset
= offset
;
2496 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2497 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2498 (unsigned long) __entry
->ino
,
2499 __entry
->offset
, __entry
->len
)
2502 TRACE_EVENT(ext4_insert_range
,
2503 TP_PROTO(struct inode
*inode
, loff_t offset
, loff_t len
),
2505 TP_ARGS(inode
, offset
, len
),
2510 __field(loff_t
, offset
)
2511 __field(loff_t
, len
)
2515 __entry
->dev
= inode
->i_sb
->s_dev
;
2516 __entry
->ino
= inode
->i_ino
;
2517 __entry
->offset
= offset
;
2521 TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2522 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2523 (unsigned long) __entry
->ino
,
2524 __entry
->offset
, __entry
->len
)
2527 TRACE_EVENT(ext4_es_shrink
,
2528 TP_PROTO(struct super_block
*sb
, int nr_shrunk
, u64 scan_time
,
2529 int nr_skipped
, int retried
),
2531 TP_ARGS(sb
, nr_shrunk
, scan_time
, nr_skipped
, retried
),
2534 __field( dev_t
, dev
)
2535 __field( int, nr_shrunk
)
2536 __field( unsigned long long, scan_time
)
2537 __field( int, nr_skipped
)
2538 __field( int, retried
)
2542 __entry
->dev
= sb
->s_dev
;
2543 __entry
->nr_shrunk
= nr_shrunk
;
2544 __entry
->scan_time
= div_u64(scan_time
, 1000);
2545 __entry
->nr_skipped
= nr_skipped
;
2546 __entry
->retried
= retried
;
2549 TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu "
2550 "nr_skipped %d retried %d",
2551 MAJOR(__entry
->dev
), MINOR(__entry
->dev
), __entry
->nr_shrunk
,
2552 __entry
->scan_time
, __entry
->nr_skipped
, __entry
->retried
)
2555 TRACE_EVENT(ext4_es_insert_delayed_block
,
2556 TP_PROTO(struct inode
*inode
, struct extent_status
*es
,
2559 TP_ARGS(inode
, es
, allocated
),
2562 __field( dev_t
, dev
)
2563 __field( ino_t
, ino
)
2564 __field( ext4_lblk_t
, lblk
)
2565 __field( ext4_lblk_t
, len
)
2566 __field( ext4_fsblk_t
, pblk
)
2567 __field( char, status
)
2568 __field( bool, allocated
)
2572 __entry
->dev
= inode
->i_sb
->s_dev
;
2573 __entry
->ino
= inode
->i_ino
;
2574 __entry
->lblk
= es
->es_lblk
;
2575 __entry
->len
= es
->es_len
;
2576 __entry
->pblk
= ext4_es_pblock(es
);
2577 __entry
->status
= ext4_es_status(es
);
2578 __entry
->allocated
= allocated
;
2581 TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s "
2583 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2584 (unsigned long) __entry
->ino
,
2585 __entry
->lblk
, __entry
->len
,
2586 __entry
->pblk
, show_extent_status(__entry
->status
),
2591 DECLARE_EVENT_CLASS(ext4_fsmap_class
,
2592 TP_PROTO(struct super_block
*sb
, u32 keydev
, u32 agno
, u64 bno
, u64 len
,
2594 TP_ARGS(sb
, keydev
, agno
, bno
, len
, owner
),
2597 __field(dev_t
, keydev
)
2604 __entry
->dev
= sb
->s_bdev
->bd_dev
;
2605 __entry
->keydev
= new_decode_dev(keydev
);
2606 __entry
->agno
= agno
;
2609 __entry
->owner
= owner
;
2611 TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld\n",
2612 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2613 MAJOR(__entry
->keydev
), MINOR(__entry
->keydev
),
2619 #define DEFINE_FSMAP_EVENT(name) \
2620 DEFINE_EVENT(ext4_fsmap_class, name, \
2621 TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len, \
2623 TP_ARGS(sb, keydev, agno, bno, len, owner))
2624 DEFINE_FSMAP_EVENT(ext4_fsmap_low_key
);
2625 DEFINE_FSMAP_EVENT(ext4_fsmap_high_key
);
2626 DEFINE_FSMAP_EVENT(ext4_fsmap_mapping
);
2628 DECLARE_EVENT_CLASS(ext4_getfsmap_class
,
2629 TP_PROTO(struct super_block
*sb
, struct ext4_fsmap
*fsmap
),
2633 __field(dev_t
, keydev
)
2640 __entry
->dev
= sb
->s_bdev
->bd_dev
;
2641 __entry
->keydev
= new_decode_dev(fsmap
->fmr_device
);
2642 __entry
->block
= fsmap
->fmr_physical
;
2643 __entry
->len
= fsmap
->fmr_length
;
2644 __entry
->owner
= fsmap
->fmr_owner
;
2645 __entry
->flags
= fsmap
->fmr_flags
;
2647 TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld flags 0x%llx\n",
2648 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2649 MAJOR(__entry
->keydev
), MINOR(__entry
->keydev
),
2655 #define DEFINE_GETFSMAP_EVENT(name) \
2656 DEFINE_EVENT(ext4_getfsmap_class, name, \
2657 TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap), \
2659 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_low_key
);
2660 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_high_key
);
2661 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_mapping
);
2663 TRACE_EVENT(ext4_shutdown
,
2664 TP_PROTO(struct super_block
*sb
, unsigned long flags
),
2669 __field( dev_t
, dev
)
2670 __field( unsigned, flags
)
2674 __entry
->dev
= sb
->s_dev
;
2675 __entry
->flags
= flags
;
2678 TP_printk("dev %d,%d flags %u",
2679 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2683 TRACE_EVENT(ext4_error
,
2684 TP_PROTO(struct super_block
*sb
, const char *function
,
2687 TP_ARGS(sb
, function
, line
),
2690 __field( dev_t
, dev
)
2691 __field( const char *, function
)
2692 __field( unsigned, line
)
2696 __entry
->dev
= sb
->s_dev
;
2697 __entry
->function
= function
;
2698 __entry
->line
= line
;
2701 TP_printk("dev %d,%d function %s line %u",
2702 MAJOR(__entry
->dev
), MINOR(__entry
->dev
),
2703 __entry
->function
, __entry
->line
)
2706 #endif /* _TRACE_EXT4_H */
2708 /* This part must be outside protection */
2709 #include <trace/define_trace.h>