2 #define TRACE_SYSTEM ext4
4 #if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/writeback.h>
8 #include <linux/tracepoint.h>
10 struct ext4_allocation_context
;
11 struct ext4_allocation_request
;
12 struct ext4_prealloc_space
;
13 struct ext4_inode_info
;
16 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
18 TRACE_EVENT(ext4_free_inode
,
19 TP_PROTO(struct inode
*inode
),
26 __field( umode_t
, mode
)
29 __field( blkcnt_t
, blocks
)
33 __entry
->dev
= inode
->i_sb
->s_dev
;
34 __entry
->ino
= inode
->i_ino
;
35 __entry
->mode
= inode
->i_mode
;
36 __entry
->uid
= inode
->i_uid
;
37 __entry
->gid
= inode
->i_gid
;
38 __entry
->blocks
= inode
->i_blocks
;
41 TP_printk("dev %s ino %lu mode 0%o uid %u gid %u blocks %llu",
42 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
43 __entry
->mode
, __entry
->uid
, __entry
->gid
,
44 (unsigned long long) __entry
->blocks
)
47 TRACE_EVENT(ext4_request_inode
,
48 TP_PROTO(struct inode
*dir
, int mode
),
55 __field( umode_t
, mode
)
59 __entry
->dev
= dir
->i_sb
->s_dev
;
60 __entry
->dir
= dir
->i_ino
;
64 TP_printk("dev %s dir %lu mode 0%o",
65 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->dir
,
69 TRACE_EVENT(ext4_allocate_inode
,
70 TP_PROTO(struct inode
*inode
, struct inode
*dir
, int mode
),
72 TP_ARGS(inode
, dir
, mode
),
78 __field( umode_t
, mode
)
82 __entry
->dev
= inode
->i_sb
->s_dev
;
83 __entry
->ino
= inode
->i_ino
;
84 __entry
->dir
= dir
->i_ino
;
88 TP_printk("dev %s ino %lu dir %lu mode 0%o",
89 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
90 (unsigned long) __entry
->dir
, __entry
->mode
)
93 DECLARE_EVENT_CLASS(ext4__write_begin
,
95 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
98 TP_ARGS(inode
, pos
, len
, flags
),
101 __field( dev_t
, dev
)
102 __field( ino_t
, ino
)
103 __field( loff_t
, pos
)
104 __field( unsigned int, len
)
105 __field( unsigned int, flags
)
109 __entry
->dev
= inode
->i_sb
->s_dev
;
110 __entry
->ino
= inode
->i_ino
;
113 __entry
->flags
= flags
;
116 TP_printk("dev %s ino %lu pos %llu len %u flags %u",
117 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
118 __entry
->pos
, __entry
->len
, __entry
->flags
)
121 DEFINE_EVENT(ext4__write_begin
, ext4_write_begin
,
123 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
126 TP_ARGS(inode
, pos
, len
, flags
)
129 DEFINE_EVENT(ext4__write_begin
, ext4_da_write_begin
,
131 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
134 TP_ARGS(inode
, pos
, len
, flags
)
137 DECLARE_EVENT_CLASS(ext4__write_end
,
138 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
139 unsigned int copied
),
141 TP_ARGS(inode
, pos
, len
, copied
),
144 __field( dev_t
, dev
)
145 __field( ino_t
, ino
)
146 __field( loff_t
, pos
)
147 __field( unsigned int, len
)
148 __field( unsigned int, copied
)
152 __entry
->dev
= inode
->i_sb
->s_dev
;
153 __entry
->ino
= inode
->i_ino
;
156 __entry
->copied
= copied
;
159 TP_printk("dev %s ino %lu pos %llu len %u copied %u",
160 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
161 __entry
->pos
, __entry
->len
, __entry
->copied
)
164 DEFINE_EVENT(ext4__write_end
, ext4_ordered_write_end
,
166 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
167 unsigned int copied
),
169 TP_ARGS(inode
, pos
, len
, copied
)
172 DEFINE_EVENT(ext4__write_end
, ext4_writeback_write_end
,
174 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
175 unsigned int copied
),
177 TP_ARGS(inode
, pos
, len
, copied
)
180 DEFINE_EVENT(ext4__write_end
, ext4_journalled_write_end
,
182 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
183 unsigned int copied
),
185 TP_ARGS(inode
, pos
, len
, copied
)
188 DEFINE_EVENT(ext4__write_end
, ext4_da_write_end
,
190 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
191 unsigned int copied
),
193 TP_ARGS(inode
, pos
, len
, copied
)
196 TRACE_EVENT(ext4_writepage
,
197 TP_PROTO(struct inode
*inode
, struct page
*page
),
199 TP_ARGS(inode
, page
),
202 __field( dev_t
, dev
)
203 __field( ino_t
, ino
)
204 __field( pgoff_t
, index
)
209 __entry
->dev
= inode
->i_sb
->s_dev
;
210 __entry
->ino
= inode
->i_ino
;
211 __entry
->index
= page
->index
;
214 TP_printk("dev %s ino %lu page_index %lu",
215 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
219 TRACE_EVENT(ext4_da_writepages
,
220 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
),
225 __field( dev_t
, dev
)
226 __field( ino_t
, ino
)
227 __field( long, nr_to_write
)
228 __field( long, pages_skipped
)
229 __field( loff_t
, range_start
)
230 __field( loff_t
, range_end
)
231 __field( char, nonblocking
)
232 __field( char, for_kupdate
)
233 __field( char, for_reclaim
)
234 __field( char, range_cyclic
)
235 __field( pgoff_t
, writeback_index
)
239 __entry
->dev
= inode
->i_sb
->s_dev
;
240 __entry
->ino
= inode
->i_ino
;
241 __entry
->nr_to_write
= wbc
->nr_to_write
;
242 __entry
->pages_skipped
= wbc
->pages_skipped
;
243 __entry
->range_start
= wbc
->range_start
;
244 __entry
->range_end
= wbc
->range_end
;
245 __entry
->nonblocking
= wbc
->nonblocking
;
246 __entry
->for_kupdate
= wbc
->for_kupdate
;
247 __entry
->for_reclaim
= wbc
->for_reclaim
;
248 __entry
->range_cyclic
= wbc
->range_cyclic
;
249 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
252 TP_printk("dev %s ino %lu nr_to_write %ld pages_skipped %ld range_start %llu range_end %llu nonblocking %d for_kupdate %d for_reclaim %d range_cyclic %d writeback_index %lu",
253 jbd2_dev_to_name(__entry
->dev
),
254 (unsigned long) __entry
->ino
, __entry
->nr_to_write
,
255 __entry
->pages_skipped
, __entry
->range_start
,
256 __entry
->range_end
, __entry
->nonblocking
,
257 __entry
->for_kupdate
, __entry
->for_reclaim
,
258 __entry
->range_cyclic
,
259 (unsigned long) __entry
->writeback_index
)
262 TRACE_EVENT(ext4_da_write_pages
,
263 TP_PROTO(struct inode
*inode
, struct mpage_da_data
*mpd
),
268 __field( dev_t
, dev
)
269 __field( ino_t
, ino
)
270 __field( __u64
, b_blocknr
)
271 __field( __u32
, b_size
)
272 __field( __u32
, b_state
)
273 __field( unsigned long, first_page
)
274 __field( int, io_done
)
275 __field( int, pages_written
)
279 __entry
->dev
= inode
->i_sb
->s_dev
;
280 __entry
->ino
= inode
->i_ino
;
281 __entry
->b_blocknr
= mpd
->b_blocknr
;
282 __entry
->b_size
= mpd
->b_size
;
283 __entry
->b_state
= mpd
->b_state
;
284 __entry
->first_page
= mpd
->first_page
;
285 __entry
->io_done
= mpd
->io_done
;
286 __entry
->pages_written
= mpd
->pages_written
;
289 TP_printk("dev %s ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d",
290 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
291 __entry
->b_blocknr
, __entry
->b_size
,
292 __entry
->b_state
, __entry
->first_page
,
293 __entry
->io_done
, __entry
->pages_written
)
296 TRACE_EVENT(ext4_da_writepages_result
,
297 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
,
298 int ret
, int pages_written
),
300 TP_ARGS(inode
, wbc
, ret
, pages_written
),
303 __field( dev_t
, dev
)
304 __field( ino_t
, ino
)
306 __field( int, pages_written
)
307 __field( long, pages_skipped
)
308 __field( char, more_io
)
309 __field( pgoff_t
, writeback_index
)
313 __entry
->dev
= inode
->i_sb
->s_dev
;
314 __entry
->ino
= inode
->i_ino
;
316 __entry
->pages_written
= pages_written
;
317 __entry
->pages_skipped
= wbc
->pages_skipped
;
318 __entry
->more_io
= wbc
->more_io
;
319 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
322 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu",
323 jbd2_dev_to_name(__entry
->dev
),
324 (unsigned long) __entry
->ino
, __entry
->ret
,
325 __entry
->pages_written
, __entry
->pages_skipped
,
327 (unsigned long) __entry
->writeback_index
)
330 TRACE_EVENT(ext4_discard_blocks
,
331 TP_PROTO(struct super_block
*sb
, unsigned long long blk
,
332 unsigned long long count
),
334 TP_ARGS(sb
, blk
, count
),
337 __field( dev_t
, dev
)
338 __field( __u64
, blk
)
339 __field( __u64
, count
)
344 __entry
->dev
= sb
->s_dev
;
346 __entry
->count
= count
;
349 TP_printk("dev %s blk %llu count %llu",
350 jbd2_dev_to_name(__entry
->dev
), __entry
->blk
, __entry
->count
)
353 DECLARE_EVENT_CLASS(ext4__mb_new_pa
,
354 TP_PROTO(struct ext4_allocation_context
*ac
,
355 struct ext4_prealloc_space
*pa
),
360 __field( dev_t
, dev
)
361 __field( ino_t
, ino
)
362 __field( __u64
, pa_pstart
)
363 __field( __u32
, pa_len
)
364 __field( __u64
, pa_lstart
)
369 __entry
->dev
= ac
->ac_sb
->s_dev
;
370 __entry
->ino
= ac
->ac_inode
->i_ino
;
371 __entry
->pa_pstart
= pa
->pa_pstart
;
372 __entry
->pa_len
= pa
->pa_len
;
373 __entry
->pa_lstart
= pa
->pa_lstart
;
376 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
377 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
378 __entry
->pa_pstart
, __entry
->pa_len
, __entry
->pa_lstart
)
381 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_inode_pa
,
383 TP_PROTO(struct ext4_allocation_context
*ac
,
384 struct ext4_prealloc_space
*pa
),
389 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_group_pa
,
391 TP_PROTO(struct ext4_allocation_context
*ac
,
392 struct ext4_prealloc_space
*pa
),
397 TRACE_EVENT(ext4_mb_release_inode_pa
,
398 TP_PROTO(struct ext4_allocation_context
*ac
,
399 struct ext4_prealloc_space
*pa
,
400 unsigned long long block
, unsigned int count
),
402 TP_ARGS(ac
, pa
, block
, count
),
405 __field( dev_t
, dev
)
406 __field( ino_t
, ino
)
407 __field( __u64
, block
)
408 __field( __u32
, count
)
413 __entry
->dev
= ac
->ac_sb
->s_dev
;
414 __entry
->ino
= ac
->ac_inode
->i_ino
;
415 __entry
->block
= block
;
416 __entry
->count
= count
;
419 TP_printk("dev %s ino %lu block %llu count %u",
420 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
421 __entry
->block
, __entry
->count
)
424 TRACE_EVENT(ext4_mb_release_group_pa
,
425 TP_PROTO(struct ext4_allocation_context
*ac
,
426 struct ext4_prealloc_space
*pa
),
431 __field( dev_t
, dev
)
432 __field( ino_t
, ino
)
433 __field( __u64
, pa_pstart
)
434 __field( __u32
, pa_len
)
439 __entry
->dev
= ac
->ac_sb
->s_dev
;
440 __entry
->ino
= ac
->ac_inode
->i_ino
;
441 __entry
->pa_pstart
= pa
->pa_pstart
;
442 __entry
->pa_len
= pa
->pa_len
;
445 TP_printk("dev %s pstart %llu len %u",
446 jbd2_dev_to_name(__entry
->dev
), __entry
->pa_pstart
, __entry
->pa_len
)
449 TRACE_EVENT(ext4_discard_preallocations
,
450 TP_PROTO(struct inode
*inode
),
455 __field( dev_t
, dev
)
456 __field( ino_t
, ino
)
461 __entry
->dev
= inode
->i_sb
->s_dev
;
462 __entry
->ino
= inode
->i_ino
;
465 TP_printk("dev %s ino %lu",
466 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
)
469 TRACE_EVENT(ext4_mb_discard_preallocations
,
470 TP_PROTO(struct super_block
*sb
, int needed
),
475 __field( dev_t
, dev
)
476 __field( int, needed
)
481 __entry
->dev
= sb
->s_dev
;
482 __entry
->needed
= needed
;
485 TP_printk("dev %s needed %d",
486 jbd2_dev_to_name(__entry
->dev
), __entry
->needed
)
489 TRACE_EVENT(ext4_request_blocks
,
490 TP_PROTO(struct ext4_allocation_request
*ar
),
495 __field( dev_t
, dev
)
496 __field( ino_t
, ino
)
497 __field( unsigned int, flags
)
498 __field( unsigned int, len
)
499 __field( __u64
, logical
)
500 __field( __u64
, goal
)
501 __field( __u64
, lleft
)
502 __field( __u64
, lright
)
503 __field( __u64
, pleft
)
504 __field( __u64
, pright
)
508 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
509 __entry
->ino
= ar
->inode
->i_ino
;
510 __entry
->flags
= ar
->flags
;
511 __entry
->len
= ar
->len
;
512 __entry
->logical
= ar
->logical
;
513 __entry
->goal
= ar
->goal
;
514 __entry
->lleft
= ar
->lleft
;
515 __entry
->lright
= ar
->lright
;
516 __entry
->pleft
= ar
->pleft
;
517 __entry
->pright
= ar
->pright
;
520 TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
521 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
522 __entry
->flags
, __entry
->len
,
523 (unsigned long long) __entry
->logical
,
524 (unsigned long long) __entry
->goal
,
525 (unsigned long long) __entry
->lleft
,
526 (unsigned long long) __entry
->lright
,
527 (unsigned long long) __entry
->pleft
,
528 (unsigned long long) __entry
->pright
)
531 TRACE_EVENT(ext4_allocate_blocks
,
532 TP_PROTO(struct ext4_allocation_request
*ar
, unsigned long long block
),
537 __field( dev_t
, dev
)
538 __field( ino_t
, ino
)
539 __field( __u64
, block
)
540 __field( unsigned int, flags
)
541 __field( unsigned int, len
)
542 __field( __u64
, logical
)
543 __field( __u64
, goal
)
544 __field( __u64
, lleft
)
545 __field( __u64
, lright
)
546 __field( __u64
, pleft
)
547 __field( __u64
, pright
)
551 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
552 __entry
->ino
= ar
->inode
->i_ino
;
553 __entry
->block
= block
;
554 __entry
->flags
= ar
->flags
;
555 __entry
->len
= ar
->len
;
556 __entry
->logical
= ar
->logical
;
557 __entry
->goal
= ar
->goal
;
558 __entry
->lleft
= ar
->lleft
;
559 __entry
->lright
= ar
->lright
;
560 __entry
->pleft
= ar
->pleft
;
561 __entry
->pright
= ar
->pright
;
564 TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
565 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
566 __entry
->flags
, __entry
->len
, __entry
->block
,
567 (unsigned long long) __entry
->logical
,
568 (unsigned long long) __entry
->goal
,
569 (unsigned long long) __entry
->lleft
,
570 (unsigned long long) __entry
->lright
,
571 (unsigned long long) __entry
->pleft
,
572 (unsigned long long) __entry
->pright
)
575 TRACE_EVENT(ext4_free_blocks
,
576 TP_PROTO(struct inode
*inode
, __u64 block
, unsigned long count
,
579 TP_ARGS(inode
, block
, count
, flags
),
582 __field( dev_t
, dev
)
583 __field( ino_t
, ino
)
584 __field( umode_t
, mode
)
585 __field( __u64
, block
)
586 __field( unsigned long, count
)
587 __field( int, flags
)
591 __entry
->dev
= inode
->i_sb
->s_dev
;
592 __entry
->ino
= inode
->i_ino
;
593 __entry
->mode
= inode
->i_mode
;
594 __entry
->block
= block
;
595 __entry
->count
= count
;
596 __entry
->flags
= flags
;
599 TP_printk("dev %s ino %lu mode 0%o block %llu count %lu flags %d",
600 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
601 __entry
->mode
, __entry
->block
, __entry
->count
,
605 TRACE_EVENT(ext4_sync_file
,
606 TP_PROTO(struct file
*file
, int datasync
),
608 TP_ARGS(file
, datasync
),
611 __field( dev_t
, dev
)
612 __field( ino_t
, ino
)
613 __field( ino_t
, parent
)
614 __field( int, datasync
)
618 struct dentry
*dentry
= file
->f_path
.dentry
;
620 __entry
->dev
= dentry
->d_inode
->i_sb
->s_dev
;
621 __entry
->ino
= dentry
->d_inode
->i_ino
;
622 __entry
->datasync
= datasync
;
623 __entry
->parent
= dentry
->d_parent
->d_inode
->i_ino
;
626 TP_printk("dev %s ino %ld parent %ld datasync %d ",
627 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
628 (unsigned long) __entry
->parent
, __entry
->datasync
)
631 TRACE_EVENT(ext4_sync_fs
,
632 TP_PROTO(struct super_block
*sb
, int wait
),
637 __field( dev_t
, dev
)
643 __entry
->dev
= sb
->s_dev
;
644 __entry
->wait
= wait
;
647 TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry
->dev
),
651 TRACE_EVENT(ext4_alloc_da_blocks
,
652 TP_PROTO(struct inode
*inode
),
657 __field( dev_t
, dev
)
658 __field( ino_t
, ino
)
659 __field( unsigned int, data_blocks
)
660 __field( unsigned int, meta_blocks
)
664 __entry
->dev
= inode
->i_sb
->s_dev
;
665 __entry
->ino
= inode
->i_ino
;
666 __entry
->data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
667 __entry
->meta_blocks
= EXT4_I(inode
)->i_reserved_meta_blocks
;
670 TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u",
671 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
672 __entry
->data_blocks
, __entry
->meta_blocks
)
675 TRACE_EVENT(ext4_mballoc_alloc
,
676 TP_PROTO(struct ext4_allocation_context
*ac
),
681 __field( dev_t
, dev
)
682 __field( ino_t
, ino
)
683 __field( __u16
, found
)
684 __field( __u16
, groups
)
685 __field( __u16
, buddy
)
686 __field( __u16
, flags
)
687 __field( __u16
, tail
)
689 __field( __u32
, orig_logical
)
690 __field( int, orig_start
)
691 __field( __u32
, orig_group
)
692 __field( int, orig_len
)
693 __field( __u32
, goal_logical
)
694 __field( int, goal_start
)
695 __field( __u32
, goal_group
)
696 __field( int, goal_len
)
697 __field( __u32
, result_logical
)
698 __field( int, result_start
)
699 __field( __u32
, result_group
)
700 __field( int, result_len
)
704 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
705 __entry
->ino
= ac
->ac_inode
->i_ino
;
706 __entry
->found
= ac
->ac_found
;
707 __entry
->flags
= ac
->ac_flags
;
708 __entry
->groups
= ac
->ac_groups_scanned
;
709 __entry
->buddy
= ac
->ac_buddy
;
710 __entry
->tail
= ac
->ac_tail
;
711 __entry
->cr
= ac
->ac_criteria
;
712 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
713 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
714 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
715 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
716 __entry
->goal_logical
= ac
->ac_g_ex
.fe_logical
;
717 __entry
->goal_start
= ac
->ac_g_ex
.fe_start
;
718 __entry
->goal_group
= ac
->ac_g_ex
.fe_group
;
719 __entry
->goal_len
= ac
->ac_g_ex
.fe_len
;
720 __entry
->result_logical
= ac
->ac_f_ex
.fe_logical
;
721 __entry
->result_start
= ac
->ac_f_ex
.fe_start
;
722 __entry
->result_group
= ac
->ac_f_ex
.fe_group
;
723 __entry
->result_len
= ac
->ac_f_ex
.fe_len
;
726 TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
727 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
729 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
730 __entry
->orig_group
, __entry
->orig_start
,
731 __entry
->orig_len
, __entry
->orig_logical
,
732 __entry
->goal_group
, __entry
->goal_start
,
733 __entry
->goal_len
, __entry
->goal_logical
,
734 __entry
->result_group
, __entry
->result_start
,
735 __entry
->result_len
, __entry
->result_logical
,
736 __entry
->found
, __entry
->groups
, __entry
->cr
,
737 __entry
->flags
, __entry
->tail
,
738 __entry
->buddy
? 1 << __entry
->buddy
: 0)
741 TRACE_EVENT(ext4_mballoc_prealloc
,
742 TP_PROTO(struct ext4_allocation_context
*ac
),
747 __field( dev_t
, dev
)
748 __field( ino_t
, ino
)
749 __field( __u32
, orig_logical
)
750 __field( int, orig_start
)
751 __field( __u32
, orig_group
)
752 __field( int, orig_len
)
753 __field( __u32
, result_logical
)
754 __field( int, result_start
)
755 __field( __u32
, result_group
)
756 __field( int, result_len
)
760 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
761 __entry
->ino
= ac
->ac_inode
->i_ino
;
762 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
763 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
764 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
765 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
766 __entry
->result_logical
= ac
->ac_b_ex
.fe_logical
;
767 __entry
->result_start
= ac
->ac_b_ex
.fe_start
;
768 __entry
->result_group
= ac
->ac_b_ex
.fe_group
;
769 __entry
->result_len
= ac
->ac_b_ex
.fe_len
;
772 TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
773 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
774 __entry
->orig_group
, __entry
->orig_start
,
775 __entry
->orig_len
, __entry
->orig_logical
,
776 __entry
->result_group
, __entry
->result_start
,
777 __entry
->result_len
, __entry
->result_logical
)
780 DECLARE_EVENT_CLASS(ext4__mballoc
,
781 TP_PROTO(struct ext4_allocation_context
*ac
),
786 __field( dev_t
, dev
)
787 __field( ino_t
, ino
)
788 __field( __u32
, result_logical
)
789 __field( int, result_start
)
790 __field( __u32
, result_group
)
791 __field( int, result_len
)
795 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
796 __entry
->ino
= ac
->ac_inode
->i_ino
;
797 __entry
->result_logical
= ac
->ac_b_ex
.fe_logical
;
798 __entry
->result_start
= ac
->ac_b_ex
.fe_start
;
799 __entry
->result_group
= ac
->ac_b_ex
.fe_group
;
800 __entry
->result_len
= ac
->ac_b_ex
.fe_len
;
803 TP_printk("dev %s inode %lu extent %u/%d/%u@%u ",
804 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
805 __entry
->result_group
, __entry
->result_start
,
806 __entry
->result_len
, __entry
->result_logical
)
809 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_discard
,
811 TP_PROTO(struct ext4_allocation_context
*ac
),
816 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_free
,
818 TP_PROTO(struct ext4_allocation_context
*ac
),
823 TRACE_EVENT(ext4_forget
,
824 TP_PROTO(struct inode
*inode
, int is_metadata
, __u64 block
),
826 TP_ARGS(inode
, is_metadata
, block
),
829 __field( dev_t
, dev
)
830 __field( ino_t
, ino
)
831 __field( umode_t
, mode
)
832 __field( int, is_metadata
)
833 __field( __u64
, block
)
837 __entry
->dev
= inode
->i_sb
->s_dev
;
838 __entry
->ino
= inode
->i_ino
;
839 __entry
->mode
= inode
->i_mode
;
840 __entry
->is_metadata
= is_metadata
;
841 __entry
->block
= block
;
844 TP_printk("dev %s ino %lu mode 0%o is_metadata %d block %llu",
845 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
846 __entry
->mode
, __entry
->is_metadata
, __entry
->block
)
849 TRACE_EVENT(ext4_da_update_reserve_space
,
850 TP_PROTO(struct inode
*inode
, int used_blocks
),
852 TP_ARGS(inode
, used_blocks
),
855 __field( dev_t
, dev
)
856 __field( ino_t
, ino
)
857 __field( umode_t
, mode
)
858 __field( __u64
, i_blocks
)
859 __field( int, used_blocks
)
860 __field( int, reserved_data_blocks
)
861 __field( int, reserved_meta_blocks
)
862 __field( int, allocated_meta_blocks
)
866 __entry
->dev
= inode
->i_sb
->s_dev
;
867 __entry
->ino
= inode
->i_ino
;
868 __entry
->mode
= inode
->i_mode
;
869 __entry
->i_blocks
= inode
->i_blocks
;
870 __entry
->used_blocks
= used_blocks
;
871 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
872 __entry
->reserved_meta_blocks
= EXT4_I(inode
)->i_reserved_meta_blocks
;
873 __entry
->allocated_meta_blocks
= EXT4_I(inode
)->i_allocated_meta_blocks
;
876 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d",
877 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
878 __entry
->mode
, (unsigned long long) __entry
->i_blocks
,
879 __entry
->used_blocks
, __entry
->reserved_data_blocks
,
880 __entry
->reserved_meta_blocks
, __entry
->allocated_meta_blocks
)
883 TRACE_EVENT(ext4_da_reserve_space
,
884 TP_PROTO(struct inode
*inode
, int md_needed
),
886 TP_ARGS(inode
, md_needed
),
889 __field( dev_t
, dev
)
890 __field( ino_t
, ino
)
891 __field( umode_t
, mode
)
892 __field( __u64
, i_blocks
)
893 __field( int, md_needed
)
894 __field( int, reserved_data_blocks
)
895 __field( int, reserved_meta_blocks
)
899 __entry
->dev
= inode
->i_sb
->s_dev
;
900 __entry
->ino
= inode
->i_ino
;
901 __entry
->mode
= inode
->i_mode
;
902 __entry
->i_blocks
= inode
->i_blocks
;
903 __entry
->md_needed
= md_needed
;
904 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
905 __entry
->reserved_meta_blocks
= EXT4_I(inode
)->i_reserved_meta_blocks
;
908 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d",
909 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
910 __entry
->mode
, (unsigned long long) __entry
->i_blocks
,
911 __entry
->md_needed
, __entry
->reserved_data_blocks
,
912 __entry
->reserved_meta_blocks
)
915 TRACE_EVENT(ext4_da_release_space
,
916 TP_PROTO(struct inode
*inode
, int freed_blocks
),
918 TP_ARGS(inode
, freed_blocks
),
921 __field( dev_t
, dev
)
922 __field( ino_t
, ino
)
923 __field( umode_t
, mode
)
924 __field( __u64
, i_blocks
)
925 __field( int, freed_blocks
)
926 __field( int, reserved_data_blocks
)
927 __field( int, reserved_meta_blocks
)
928 __field( int, allocated_meta_blocks
)
932 __entry
->dev
= inode
->i_sb
->s_dev
;
933 __entry
->ino
= inode
->i_ino
;
934 __entry
->mode
= inode
->i_mode
;
935 __entry
->i_blocks
= inode
->i_blocks
;
936 __entry
->freed_blocks
= freed_blocks
;
937 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
938 __entry
->reserved_meta_blocks
= EXT4_I(inode
)->i_reserved_meta_blocks
;
939 __entry
->allocated_meta_blocks
= EXT4_I(inode
)->i_allocated_meta_blocks
;
942 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d",
943 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
944 __entry
->mode
, (unsigned long long) __entry
->i_blocks
,
945 __entry
->freed_blocks
, __entry
->reserved_data_blocks
,
946 __entry
->reserved_meta_blocks
, __entry
->allocated_meta_blocks
)
949 DECLARE_EVENT_CLASS(ext4__bitmap_load
,
950 TP_PROTO(struct super_block
*sb
, unsigned long group
),
955 __field( dev_t
, dev
)
956 __field( __u32
, group
)
961 __entry
->dev
= sb
->s_dev
;
962 __entry
->group
= group
;
965 TP_printk("dev %s group %u",
966 jbd2_dev_to_name(__entry
->dev
), __entry
->group
)
969 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_bitmap_load
,
971 TP_PROTO(struct super_block
*sb
, unsigned long group
),
976 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_buddy_bitmap_load
,
978 TP_PROTO(struct super_block
*sb
, unsigned long group
),
983 #endif /* _TRACE_EXT4_H */
985 /* This part must be outside protection */
986 #include <trace/define_trace.h>