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( char, no_nrwrite_index_update
)
310 __field( pgoff_t
, writeback_index
)
314 __entry
->dev
= inode
->i_sb
->s_dev
;
315 __entry
->ino
= inode
->i_ino
;
317 __entry
->pages_written
= pages_written
;
318 __entry
->pages_skipped
= wbc
->pages_skipped
;
319 __entry
->more_io
= wbc
->more_io
;
320 __entry
->no_nrwrite_index_update
= wbc
->no_nrwrite_index_update
;
321 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
324 TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d no_nrwrite_index_update %d writeback_index %lu",
325 jbd2_dev_to_name(__entry
->dev
),
326 (unsigned long) __entry
->ino
, __entry
->ret
,
327 __entry
->pages_written
, __entry
->pages_skipped
,
329 __entry
->no_nrwrite_index_update
,
330 (unsigned long) __entry
->writeback_index
)
333 TRACE_EVENT(ext4_discard_blocks
,
334 TP_PROTO(struct super_block
*sb
, unsigned long long blk
,
335 unsigned long long count
),
337 TP_ARGS(sb
, blk
, count
),
340 __field( dev_t
, dev
)
341 __field( __u64
, blk
)
342 __field( __u64
, count
)
347 __entry
->dev
= sb
->s_dev
;
349 __entry
->count
= count
;
352 TP_printk("dev %s blk %llu count %llu",
353 jbd2_dev_to_name(__entry
->dev
), __entry
->blk
, __entry
->count
)
356 DECLARE_EVENT_CLASS(ext4__mb_new_pa
,
357 TP_PROTO(struct ext4_allocation_context
*ac
,
358 struct ext4_prealloc_space
*pa
),
363 __field( dev_t
, dev
)
364 __field( ino_t
, ino
)
365 __field( __u64
, pa_pstart
)
366 __field( __u32
, pa_len
)
367 __field( __u64
, pa_lstart
)
372 __entry
->dev
= ac
->ac_sb
->s_dev
;
373 __entry
->ino
= ac
->ac_inode
->i_ino
;
374 __entry
->pa_pstart
= pa
->pa_pstart
;
375 __entry
->pa_len
= pa
->pa_len
;
376 __entry
->pa_lstart
= pa
->pa_lstart
;
379 TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
380 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
381 __entry
->pa_pstart
, __entry
->pa_len
, __entry
->pa_lstart
)
384 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_inode_pa
,
386 TP_PROTO(struct ext4_allocation_context
*ac
,
387 struct ext4_prealloc_space
*pa
),
392 DEFINE_EVENT(ext4__mb_new_pa
, ext4_mb_new_group_pa
,
394 TP_PROTO(struct ext4_allocation_context
*ac
,
395 struct ext4_prealloc_space
*pa
),
400 TRACE_EVENT(ext4_mb_release_inode_pa
,
401 TP_PROTO(struct ext4_allocation_context
*ac
,
402 struct ext4_prealloc_space
*pa
,
403 unsigned long long block
, unsigned int count
),
405 TP_ARGS(ac
, pa
, block
, count
),
408 __field( dev_t
, dev
)
409 __field( ino_t
, ino
)
410 __field( __u64
, block
)
411 __field( __u32
, count
)
416 __entry
->dev
= ac
->ac_sb
->s_dev
;
417 __entry
->ino
= ac
->ac_inode
->i_ino
;
418 __entry
->block
= block
;
419 __entry
->count
= count
;
422 TP_printk("dev %s ino %lu block %llu count %u",
423 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
424 __entry
->block
, __entry
->count
)
427 TRACE_EVENT(ext4_mb_release_group_pa
,
428 TP_PROTO(struct ext4_allocation_context
*ac
,
429 struct ext4_prealloc_space
*pa
),
434 __field( dev_t
, dev
)
435 __field( ino_t
, ino
)
436 __field( __u64
, pa_pstart
)
437 __field( __u32
, pa_len
)
442 __entry
->dev
= ac
->ac_sb
->s_dev
;
443 __entry
->ino
= ac
->ac_inode
->i_ino
;
444 __entry
->pa_pstart
= pa
->pa_pstart
;
445 __entry
->pa_len
= pa
->pa_len
;
448 TP_printk("dev %s pstart %llu len %u",
449 jbd2_dev_to_name(__entry
->dev
), __entry
->pa_pstart
, __entry
->pa_len
)
452 TRACE_EVENT(ext4_discard_preallocations
,
453 TP_PROTO(struct inode
*inode
),
458 __field( dev_t
, dev
)
459 __field( ino_t
, ino
)
464 __entry
->dev
= inode
->i_sb
->s_dev
;
465 __entry
->ino
= inode
->i_ino
;
468 TP_printk("dev %s ino %lu",
469 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
)
472 TRACE_EVENT(ext4_mb_discard_preallocations
,
473 TP_PROTO(struct super_block
*sb
, int needed
),
478 __field( dev_t
, dev
)
479 __field( int, needed
)
484 __entry
->dev
= sb
->s_dev
;
485 __entry
->needed
= needed
;
488 TP_printk("dev %s needed %d",
489 jbd2_dev_to_name(__entry
->dev
), __entry
->needed
)
492 TRACE_EVENT(ext4_request_blocks
,
493 TP_PROTO(struct ext4_allocation_request
*ar
),
498 __field( dev_t
, dev
)
499 __field( ino_t
, ino
)
500 __field( unsigned int, flags
)
501 __field( unsigned int, len
)
502 __field( __u64
, logical
)
503 __field( __u64
, goal
)
504 __field( __u64
, lleft
)
505 __field( __u64
, lright
)
506 __field( __u64
, pleft
)
507 __field( __u64
, pright
)
511 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
512 __entry
->ino
= ar
->inode
->i_ino
;
513 __entry
->flags
= ar
->flags
;
514 __entry
->len
= ar
->len
;
515 __entry
->logical
= ar
->logical
;
516 __entry
->goal
= ar
->goal
;
517 __entry
->lleft
= ar
->lleft
;
518 __entry
->lright
= ar
->lright
;
519 __entry
->pleft
= ar
->pleft
;
520 __entry
->pright
= ar
->pright
;
523 TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
524 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
525 __entry
->flags
, __entry
->len
,
526 (unsigned long long) __entry
->logical
,
527 (unsigned long long) __entry
->goal
,
528 (unsigned long long) __entry
->lleft
,
529 (unsigned long long) __entry
->lright
,
530 (unsigned long long) __entry
->pleft
,
531 (unsigned long long) __entry
->pright
)
534 TRACE_EVENT(ext4_allocate_blocks
,
535 TP_PROTO(struct ext4_allocation_request
*ar
, unsigned long long block
),
540 __field( dev_t
, dev
)
541 __field( ino_t
, ino
)
542 __field( __u64
, block
)
543 __field( unsigned int, flags
)
544 __field( unsigned int, len
)
545 __field( __u64
, logical
)
546 __field( __u64
, goal
)
547 __field( __u64
, lleft
)
548 __field( __u64
, lright
)
549 __field( __u64
, pleft
)
550 __field( __u64
, pright
)
554 __entry
->dev
= ar
->inode
->i_sb
->s_dev
;
555 __entry
->ino
= ar
->inode
->i_ino
;
556 __entry
->block
= block
;
557 __entry
->flags
= ar
->flags
;
558 __entry
->len
= ar
->len
;
559 __entry
->logical
= ar
->logical
;
560 __entry
->goal
= ar
->goal
;
561 __entry
->lleft
= ar
->lleft
;
562 __entry
->lright
= ar
->lright
;
563 __entry
->pleft
= ar
->pleft
;
564 __entry
->pright
= ar
->pright
;
567 TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
568 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
569 __entry
->flags
, __entry
->len
, __entry
->block
,
570 (unsigned long long) __entry
->logical
,
571 (unsigned long long) __entry
->goal
,
572 (unsigned long long) __entry
->lleft
,
573 (unsigned long long) __entry
->lright
,
574 (unsigned long long) __entry
->pleft
,
575 (unsigned long long) __entry
->pright
)
578 TRACE_EVENT(ext4_free_blocks
,
579 TP_PROTO(struct inode
*inode
, __u64 block
, unsigned long count
,
582 TP_ARGS(inode
, block
, count
, flags
),
585 __field( dev_t
, dev
)
586 __field( ino_t
, ino
)
587 __field( umode_t
, mode
)
588 __field( __u64
, block
)
589 __field( unsigned long, count
)
590 __field( int, flags
)
594 __entry
->dev
= inode
->i_sb
->s_dev
;
595 __entry
->ino
= inode
->i_ino
;
596 __entry
->mode
= inode
->i_mode
;
597 __entry
->block
= block
;
598 __entry
->count
= count
;
599 __entry
->flags
= flags
;
602 TP_printk("dev %s ino %lu mode 0%o block %llu count %lu flags %d",
603 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
604 __entry
->mode
, __entry
->block
, __entry
->count
,
608 TRACE_EVENT(ext4_sync_file
,
609 TP_PROTO(struct file
*file
, int datasync
),
611 TP_ARGS(file
, datasync
),
614 __field( dev_t
, dev
)
615 __field( ino_t
, ino
)
616 __field( ino_t
, parent
)
617 __field( int, datasync
)
621 struct dentry
*dentry
= file
->f_path
.dentry
;
623 __entry
->dev
= dentry
->d_inode
->i_sb
->s_dev
;
624 __entry
->ino
= dentry
->d_inode
->i_ino
;
625 __entry
->datasync
= datasync
;
626 __entry
->parent
= dentry
->d_parent
->d_inode
->i_ino
;
629 TP_printk("dev %s ino %ld parent %ld datasync %d ",
630 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
631 (unsigned long) __entry
->parent
, __entry
->datasync
)
634 TRACE_EVENT(ext4_sync_fs
,
635 TP_PROTO(struct super_block
*sb
, int wait
),
640 __field( dev_t
, dev
)
646 __entry
->dev
= sb
->s_dev
;
647 __entry
->wait
= wait
;
650 TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry
->dev
),
654 TRACE_EVENT(ext4_alloc_da_blocks
,
655 TP_PROTO(struct inode
*inode
),
660 __field( dev_t
, dev
)
661 __field( ino_t
, ino
)
662 __field( unsigned int, data_blocks
)
663 __field( unsigned int, meta_blocks
)
667 __entry
->dev
= inode
->i_sb
->s_dev
;
668 __entry
->ino
= inode
->i_ino
;
669 __entry
->data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
670 __entry
->meta_blocks
= EXT4_I(inode
)->i_reserved_meta_blocks
;
673 TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u",
674 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
675 __entry
->data_blocks
, __entry
->meta_blocks
)
678 TRACE_EVENT(ext4_mballoc_alloc
,
679 TP_PROTO(struct ext4_allocation_context
*ac
),
684 __field( dev_t
, dev
)
685 __field( ino_t
, ino
)
686 __field( __u16
, found
)
687 __field( __u16
, groups
)
688 __field( __u16
, buddy
)
689 __field( __u16
, flags
)
690 __field( __u16
, tail
)
692 __field( __u32
, orig_logical
)
693 __field( int, orig_start
)
694 __field( __u32
, orig_group
)
695 __field( int, orig_len
)
696 __field( __u32
, goal_logical
)
697 __field( int, goal_start
)
698 __field( __u32
, goal_group
)
699 __field( int, goal_len
)
700 __field( __u32
, result_logical
)
701 __field( int, result_start
)
702 __field( __u32
, result_group
)
703 __field( int, result_len
)
707 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
708 __entry
->ino
= ac
->ac_inode
->i_ino
;
709 __entry
->found
= ac
->ac_found
;
710 __entry
->flags
= ac
->ac_flags
;
711 __entry
->groups
= ac
->ac_groups_scanned
;
712 __entry
->buddy
= ac
->ac_buddy
;
713 __entry
->tail
= ac
->ac_tail
;
714 __entry
->cr
= ac
->ac_criteria
;
715 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
716 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
717 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
718 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
719 __entry
->goal_logical
= ac
->ac_g_ex
.fe_logical
;
720 __entry
->goal_start
= ac
->ac_g_ex
.fe_start
;
721 __entry
->goal_group
= ac
->ac_g_ex
.fe_group
;
722 __entry
->goal_len
= ac
->ac_g_ex
.fe_len
;
723 __entry
->result_logical
= ac
->ac_f_ex
.fe_logical
;
724 __entry
->result_start
= ac
->ac_f_ex
.fe_start
;
725 __entry
->result_group
= ac
->ac_f_ex
.fe_group
;
726 __entry
->result_len
= ac
->ac_f_ex
.fe_len
;
729 TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
730 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
732 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
733 __entry
->orig_group
, __entry
->orig_start
,
734 __entry
->orig_len
, __entry
->orig_logical
,
735 __entry
->goal_group
, __entry
->goal_start
,
736 __entry
->goal_len
, __entry
->goal_logical
,
737 __entry
->result_group
, __entry
->result_start
,
738 __entry
->result_len
, __entry
->result_logical
,
739 __entry
->found
, __entry
->groups
, __entry
->cr
,
740 __entry
->flags
, __entry
->tail
,
741 __entry
->buddy
? 1 << __entry
->buddy
: 0)
744 TRACE_EVENT(ext4_mballoc_prealloc
,
745 TP_PROTO(struct ext4_allocation_context
*ac
),
750 __field( dev_t
, dev
)
751 __field( ino_t
, ino
)
752 __field( __u32
, orig_logical
)
753 __field( int, orig_start
)
754 __field( __u32
, orig_group
)
755 __field( int, orig_len
)
756 __field( __u32
, result_logical
)
757 __field( int, result_start
)
758 __field( __u32
, result_group
)
759 __field( int, result_len
)
763 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
764 __entry
->ino
= ac
->ac_inode
->i_ino
;
765 __entry
->orig_logical
= ac
->ac_o_ex
.fe_logical
;
766 __entry
->orig_start
= ac
->ac_o_ex
.fe_start
;
767 __entry
->orig_group
= ac
->ac_o_ex
.fe_group
;
768 __entry
->orig_len
= ac
->ac_o_ex
.fe_len
;
769 __entry
->result_logical
= ac
->ac_b_ex
.fe_logical
;
770 __entry
->result_start
= ac
->ac_b_ex
.fe_start
;
771 __entry
->result_group
= ac
->ac_b_ex
.fe_group
;
772 __entry
->result_len
= ac
->ac_b_ex
.fe_len
;
775 TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
776 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
777 __entry
->orig_group
, __entry
->orig_start
,
778 __entry
->orig_len
, __entry
->orig_logical
,
779 __entry
->result_group
, __entry
->result_start
,
780 __entry
->result_len
, __entry
->result_logical
)
783 DECLARE_EVENT_CLASS(ext4__mballoc
,
784 TP_PROTO(struct ext4_allocation_context
*ac
),
789 __field( dev_t
, dev
)
790 __field( ino_t
, ino
)
791 __field( __u32
, result_logical
)
792 __field( int, result_start
)
793 __field( __u32
, result_group
)
794 __field( int, result_len
)
798 __entry
->dev
= ac
->ac_inode
->i_sb
->s_dev
;
799 __entry
->ino
= ac
->ac_inode
->i_ino
;
800 __entry
->result_logical
= ac
->ac_b_ex
.fe_logical
;
801 __entry
->result_start
= ac
->ac_b_ex
.fe_start
;
802 __entry
->result_group
= ac
->ac_b_ex
.fe_group
;
803 __entry
->result_len
= ac
->ac_b_ex
.fe_len
;
806 TP_printk("dev %s inode %lu extent %u/%d/%u@%u ",
807 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
808 __entry
->result_group
, __entry
->result_start
,
809 __entry
->result_len
, __entry
->result_logical
)
812 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_discard
,
814 TP_PROTO(struct ext4_allocation_context
*ac
),
819 DEFINE_EVENT(ext4__mballoc
, ext4_mballoc_free
,
821 TP_PROTO(struct ext4_allocation_context
*ac
),
826 TRACE_EVENT(ext4_forget
,
827 TP_PROTO(struct inode
*inode
, int is_metadata
, __u64 block
),
829 TP_ARGS(inode
, is_metadata
, block
),
832 __field( dev_t
, dev
)
833 __field( ino_t
, ino
)
834 __field( umode_t
, mode
)
835 __field( int, is_metadata
)
836 __field( __u64
, block
)
840 __entry
->dev
= inode
->i_sb
->s_dev
;
841 __entry
->ino
= inode
->i_ino
;
842 __entry
->mode
= inode
->i_mode
;
843 __entry
->is_metadata
= is_metadata
;
844 __entry
->block
= block
;
847 TP_printk("dev %s ino %lu mode 0%o is_metadata %d block %llu",
848 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
849 __entry
->mode
, __entry
->is_metadata
, __entry
->block
)
852 TRACE_EVENT(ext4_da_update_reserve_space
,
853 TP_PROTO(struct inode
*inode
, int used_blocks
),
855 TP_ARGS(inode
, used_blocks
),
858 __field( dev_t
, dev
)
859 __field( ino_t
, ino
)
860 __field( umode_t
, mode
)
861 __field( __u64
, i_blocks
)
862 __field( int, used_blocks
)
863 __field( int, reserved_data_blocks
)
864 __field( int, reserved_meta_blocks
)
865 __field( int, allocated_meta_blocks
)
869 __entry
->dev
= inode
->i_sb
->s_dev
;
870 __entry
->ino
= inode
->i_ino
;
871 __entry
->mode
= inode
->i_mode
;
872 __entry
->i_blocks
= inode
->i_blocks
;
873 __entry
->used_blocks
= used_blocks
;
874 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
875 __entry
->reserved_meta_blocks
= EXT4_I(inode
)->i_reserved_meta_blocks
;
876 __entry
->allocated_meta_blocks
= EXT4_I(inode
)->i_allocated_meta_blocks
;
879 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",
880 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
881 __entry
->mode
, (unsigned long long) __entry
->i_blocks
,
882 __entry
->used_blocks
, __entry
->reserved_data_blocks
,
883 __entry
->reserved_meta_blocks
, __entry
->allocated_meta_blocks
)
886 TRACE_EVENT(ext4_da_reserve_space
,
887 TP_PROTO(struct inode
*inode
, int md_needed
),
889 TP_ARGS(inode
, md_needed
),
892 __field( dev_t
, dev
)
893 __field( ino_t
, ino
)
894 __field( umode_t
, mode
)
895 __field( __u64
, i_blocks
)
896 __field( int, md_needed
)
897 __field( int, reserved_data_blocks
)
898 __field( int, reserved_meta_blocks
)
902 __entry
->dev
= inode
->i_sb
->s_dev
;
903 __entry
->ino
= inode
->i_ino
;
904 __entry
->mode
= inode
->i_mode
;
905 __entry
->i_blocks
= inode
->i_blocks
;
906 __entry
->md_needed
= md_needed
;
907 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
908 __entry
->reserved_meta_blocks
= EXT4_I(inode
)->i_reserved_meta_blocks
;
911 TP_printk("dev %s ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d",
912 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
913 __entry
->mode
, (unsigned long long) __entry
->i_blocks
,
914 __entry
->md_needed
, __entry
->reserved_data_blocks
,
915 __entry
->reserved_meta_blocks
)
918 TRACE_EVENT(ext4_da_release_space
,
919 TP_PROTO(struct inode
*inode
, int freed_blocks
),
921 TP_ARGS(inode
, freed_blocks
),
924 __field( dev_t
, dev
)
925 __field( ino_t
, ino
)
926 __field( umode_t
, mode
)
927 __field( __u64
, i_blocks
)
928 __field( int, freed_blocks
)
929 __field( int, reserved_data_blocks
)
930 __field( int, reserved_meta_blocks
)
931 __field( int, allocated_meta_blocks
)
935 __entry
->dev
= inode
->i_sb
->s_dev
;
936 __entry
->ino
= inode
->i_ino
;
937 __entry
->mode
= inode
->i_mode
;
938 __entry
->i_blocks
= inode
->i_blocks
;
939 __entry
->freed_blocks
= freed_blocks
;
940 __entry
->reserved_data_blocks
= EXT4_I(inode
)->i_reserved_data_blocks
;
941 __entry
->reserved_meta_blocks
= EXT4_I(inode
)->i_reserved_meta_blocks
;
942 __entry
->allocated_meta_blocks
= EXT4_I(inode
)->i_allocated_meta_blocks
;
945 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",
946 jbd2_dev_to_name(__entry
->dev
), (unsigned long) __entry
->ino
,
947 __entry
->mode
, (unsigned long long) __entry
->i_blocks
,
948 __entry
->freed_blocks
, __entry
->reserved_data_blocks
,
949 __entry
->reserved_meta_blocks
, __entry
->allocated_meta_blocks
)
952 DECLARE_EVENT_CLASS(ext4__bitmap_load
,
953 TP_PROTO(struct super_block
*sb
, unsigned long group
),
958 __field( dev_t
, dev
)
959 __field( __u32
, group
)
964 __entry
->dev
= sb
->s_dev
;
965 __entry
->group
= group
;
968 TP_printk("dev %s group %u",
969 jbd2_dev_to_name(__entry
->dev
), __entry
->group
)
972 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_bitmap_load
,
974 TP_PROTO(struct super_block
*sb
, unsigned long group
),
979 DEFINE_EVENT(ext4__bitmap_load
, ext4_mb_buddy_bitmap_load
,
981 TP_PROTO(struct super_block
*sb
, unsigned long group
),
986 #endif /* _TRACE_EXT4_H */
988 /* This part must be outside protection */
989 #include <trace/define_trace.h>