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),
24 __field( int, dev_major )
25 __field( int, dev_minor )
27 __field( umode_t, mode )
30 __field( blkcnt_t, blocks )
34 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
35 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
36 __entry->ino = inode->i_ino;
37 __entry->mode = inode->i_mode;
38 __entry->uid = inode->i_uid;
39 __entry->gid = inode->i_gid;
40 __entry->blocks = inode->i_blocks;
43 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
44 __entry->dev_major, __entry->dev_minor,
45 (unsigned long) __entry->ino, __entry->mode,
46 __entry->uid, __entry->gid,
47 (unsigned long long) __entry->blocks)
50 TRACE_EVENT(ext4_request_inode,
51 TP_PROTO(struct inode *dir, int mode),
56 __field( int, dev_major )
57 __field( int, dev_minor )
59 __field( umode_t, mode )
63 __entry->dev_major = MAJOR(dir->i_sb->s_dev);
64 __entry->dev_minor = MINOR(dir->i_sb->s_dev);
65 __entry->dir = dir->i_ino;
69 TP_printk("dev %d,%d dir %lu mode 0%o",
70 __entry->dev_major, __entry->dev_minor,
71 (unsigned long) __entry->dir, __entry->mode)
74 TRACE_EVENT(ext4_allocate_inode,
75 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
77 TP_ARGS(inode, dir, mode),
80 __field( int, dev_major )
81 __field( int, dev_minor )
84 __field( umode_t, mode )
88 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
89 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
90 __entry->ino = inode->i_ino;
91 __entry->dir = dir->i_ino;
95 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
96 __entry->dev_major, __entry->dev_minor,
97 (unsigned long) __entry->ino,
98 (unsigned long) __entry->dir, __entry->mode)
101 TRACE_EVENT(ext4_evict_inode,
102 TP_PROTO(struct inode *inode),
107 __field( int, dev_major )
108 __field( int, dev_minor )
109 __field( ino_t, ino )
110 __field( int, nlink )
114 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
115 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
116 __entry->ino = inode->i_ino;
117 __entry->nlink = inode->i_nlink;
120 TP_printk("dev %d,%d ino %lu nlink %d",
121 __entry->dev_major, __entry->dev_minor,
122 (unsigned long) __entry->ino, __entry->nlink)
125 TRACE_EVENT(ext4_drop_inode,
126 TP_PROTO(struct inode *inode, int drop),
128 TP_ARGS(inode, drop),
131 __field( int, dev_major )
132 __field( int, dev_minor )
133 __field( ino_t, ino )
138 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
139 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
140 __entry->ino = inode->i_ino;
141 __entry->drop = drop;
144 TP_printk("dev %d,%d ino %lu drop %d",
145 __entry->dev_major, __entry->dev_minor,
146 (unsigned long) __entry->ino, __entry->drop)
149 TRACE_EVENT(ext4_mark_inode_dirty,
150 TP_PROTO(struct inode *inode, unsigned long IP),
155 __field( int, dev_major )
156 __field( int, dev_minor )
157 __field( ino_t, ino )
158 __field(unsigned long, ip )
162 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
163 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
164 __entry->ino = inode->i_ino;
168 TP_printk("dev %d,%d ino %lu caller %pF",
169 __entry->dev_major, __entry->dev_minor,
170 (unsigned long) __entry->ino, (void *)__entry->ip)
173 TRACE_EVENT(ext4_begin_ordered_truncate,
174 TP_PROTO(struct inode *inode, loff_t new_size),
176 TP_ARGS(inode, new_size),
179 __field( int, dev_major )
180 __field( int, dev_minor )
181 __field( ino_t, ino )
182 __field( loff_t, new_size )
186 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
187 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
188 __entry->ino = inode->i_ino;
189 __entry->new_size = new_size;
192 TP_printk("dev %d,%d ino %lu new_size %lld",
193 __entry->dev_major, __entry->dev_minor,
194 (unsigned long) __entry->ino,
195 (long long) __entry->new_size)
198 DECLARE_EVENT_CLASS(ext4__write_begin,
200 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
203 TP_ARGS(inode, pos, len, flags),
206 __field( int, dev_major )
207 __field( int, dev_minor )
208 __field( ino_t, ino )
209 __field( loff_t, pos )
210 __field( unsigned int, len )
211 __field( unsigned int, flags )
215 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
216 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
217 __entry->ino = inode->i_ino;
220 __entry->flags = flags;
223 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u",
224 __entry->dev_major, __entry->dev_minor,
225 (unsigned long) __entry->ino,
226 __entry->pos, __entry->len, __entry->flags)
229 DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
231 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
234 TP_ARGS(inode, pos, len, flags)
237 DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
239 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
242 TP_ARGS(inode, pos, len, flags)
245 DECLARE_EVENT_CLASS(ext4__write_end,
246 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
247 unsigned int copied),
249 TP_ARGS(inode, pos, len, copied),
252 __field( int, dev_major )
253 __field( int, dev_minor )
254 __field( ino_t, ino )
255 __field( loff_t, pos )
256 __field( unsigned int, len )
257 __field( unsigned int, copied )
261 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
262 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
263 __entry->ino = inode->i_ino;
266 __entry->copied = copied;
269 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u",
270 __entry->dev_major, __entry->dev_minor,
271 (unsigned long) __entry->ino, __entry->pos,
272 __entry->len, __entry->copied)
275 DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end,
277 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
278 unsigned int copied),
280 TP_ARGS(inode, pos, len, copied)
283 DEFINE_EVENT(ext4__write_end, ext4_writeback_write_end,
285 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
286 unsigned int copied),
288 TP_ARGS(inode, pos, len, copied)
291 DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
293 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
294 unsigned int copied),
296 TP_ARGS(inode, pos, len, copied)
299 DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
301 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
302 unsigned int copied),
304 TP_ARGS(inode, pos, len, copied)
307 TRACE_EVENT(ext4_writepage,
308 TP_PROTO(struct inode *inode, struct page *page),
310 TP_ARGS(inode, page),
313 __field( int, dev_major )
314 __field( int, dev_minor )
315 __field( ino_t, ino )
316 __field( pgoff_t, index )
321 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
322 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
323 __entry->ino = inode->i_ino;
324 __entry->index = page->index;
327 TP_printk("dev %d,%d ino %lu page_index %lu",
328 __entry->dev_major, __entry->dev_minor,
329 (unsigned long) __entry->ino, __entry->index)
332 TRACE_EVENT(ext4_da_writepages,
333 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
338 __field( int, dev_major )
339 __field( int, dev_minor )
340 __field( ino_t, ino )
341 __field( long, nr_to_write )
342 __field( long, pages_skipped )
343 __field( loff_t, range_start )
344 __field( loff_t, range_end )
345 __field( char, for_kupdate )
346 __field( char, for_reclaim )
347 __field( char, range_cyclic )
348 __field( pgoff_t, writeback_index )
352 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
353 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
354 __entry->ino = inode->i_ino;
355 __entry->nr_to_write = wbc->nr_to_write;
356 __entry->pages_skipped = wbc->pages_skipped;
357 __entry->range_start = wbc->range_start;
358 __entry->range_end = wbc->range_end;
359 __entry->for_kupdate = wbc->for_kupdate;
360 __entry->for_reclaim = wbc->for_reclaim;
361 __entry->range_cyclic = wbc->range_cyclic;
362 __entry->writeback_index = inode->i_mapping->writeback_index;
365 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
366 "range_start %llu range_end %llu "
367 "for_kupdate %d for_reclaim %d "
368 "range_cyclic %d writeback_index %lu",
369 __entry->dev_major, __entry->dev_minor,
370 (unsigned long) __entry->ino, __entry->nr_to_write,
371 __entry->pages_skipped, __entry->range_start,
373 __entry->for_kupdate, __entry->for_reclaim,
374 __entry->range_cyclic,
375 (unsigned long) __entry->writeback_index)
378 TRACE_EVENT(ext4_da_write_pages,
379 TP_PROTO(struct inode *inode, struct mpage_da_data *mpd),
384 __field( int, dev_major )
385 __field( int, dev_minor )
386 __field( ino_t, ino )
387 __field( __u64, b_blocknr )
388 __field( __u32, b_size )
389 __field( __u32, b_state )
390 __field( unsigned long, first_page )
391 __field( int, io_done )
392 __field( int, pages_written )
396 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
397 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
398 __entry->ino = inode->i_ino;
399 __entry->b_blocknr = mpd->b_blocknr;
400 __entry->b_size = mpd->b_size;
401 __entry->b_state = mpd->b_state;
402 __entry->first_page = mpd->first_page;
403 __entry->io_done = mpd->io_done;
404 __entry->pages_written = mpd->pages_written;
407 TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x first_page %lu io_done %d pages_written %d",
408 __entry->dev_major, __entry->dev_minor,
409 (unsigned long) __entry->ino,
410 __entry->b_blocknr, __entry->b_size,
411 __entry->b_state, __entry->first_page,
412 __entry->io_done, __entry->pages_written)
415 TRACE_EVENT(ext4_da_writepages_result,
416 TP_PROTO(struct inode *inode, struct writeback_control *wbc,
417 int ret, int pages_written),
419 TP_ARGS(inode, wbc, ret, pages_written),
422 __field( int, dev_major )
423 __field( int, dev_minor )
424 __field( ino_t, ino )
426 __field( int, pages_written )
427 __field( long, pages_skipped )
428 __field( char, more_io )
429 __field( pgoff_t, writeback_index )
433 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
434 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
435 __entry->ino = inode->i_ino;
437 __entry->pages_written = pages_written;
438 __entry->pages_skipped = wbc->pages_skipped;
439 __entry->more_io = wbc->more_io;
440 __entry->writeback_index = inode->i_mapping->writeback_index;
443 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld more_io %d writeback_index %lu",
444 __entry->dev_major, __entry->dev_minor,
445 (unsigned long) __entry->ino, __entry->ret,
446 __entry->pages_written, __entry->pages_skipped,
448 (unsigned long) __entry->writeback_index)
451 TRACE_EVENT(ext4_discard_blocks,
452 TP_PROTO(struct super_block *sb, unsigned long long blk,
453 unsigned long long count),
455 TP_ARGS(sb, blk, count),
458 __field( int, dev_major )
459 __field( int, dev_minor )
460 __field( __u64, blk )
461 __field( __u64, count )
466 __entry->dev_major = MAJOR(sb->s_dev);
467 __entry->dev_minor = MINOR(sb->s_dev);
469 __entry->count = count;
472 TP_printk("dev %d,%d blk %llu count %llu",
473 __entry->dev_major, __entry->dev_minor,
474 __entry->blk, __entry->count)
477 DECLARE_EVENT_CLASS(ext4__mb_new_pa,
478 TP_PROTO(struct ext4_allocation_context *ac,
479 struct ext4_prealloc_space *pa),
484 __field( int, dev_major )
485 __field( int, dev_minor )
486 __field( ino_t, ino )
487 __field( __u64, pa_pstart )
488 __field( __u32, pa_len )
489 __field( __u64, pa_lstart )
494 __entry->dev_major = MAJOR(ac->ac_sb->s_dev);
495 __entry->dev_minor = MINOR(ac->ac_sb->s_dev);
496 __entry->ino = ac->ac_inode->i_ino;
497 __entry->pa_pstart = pa->pa_pstart;
498 __entry->pa_len = pa->pa_len;
499 __entry->pa_lstart = pa->pa_lstart;
502 TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
503 __entry->dev_major, __entry->dev_minor,
504 (unsigned long) __entry->ino, __entry->pa_pstart,
505 __entry->pa_len, __entry->pa_lstart)
508 DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
510 TP_PROTO(struct ext4_allocation_context *ac,
511 struct ext4_prealloc_space *pa),
516 DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
518 TP_PROTO(struct ext4_allocation_context *ac,
519 struct ext4_prealloc_space *pa),
524 TRACE_EVENT(ext4_mb_release_inode_pa,
525 TP_PROTO(struct super_block *sb,
527 struct ext4_prealloc_space *pa,
528 unsigned long long block, unsigned int count),
530 TP_ARGS(sb, inode, pa, block, count),
533 __field( int, dev_major )
534 __field( int, dev_minor )
535 __field( ino_t, ino )
536 __field( __u64, block )
537 __field( __u32, count )
542 __entry->dev_major = MAJOR(sb->s_dev);
543 __entry->dev_minor = MINOR(sb->s_dev);
544 __entry->ino = inode->i_ino;
545 __entry->block = block;
546 __entry->count = count;
549 TP_printk("dev %d,%d ino %lu block %llu count %u",
550 __entry->dev_major, __entry->dev_minor,
551 (unsigned long) __entry->ino, __entry->block, __entry->count)
554 TRACE_EVENT(ext4_mb_release_group_pa,
555 TP_PROTO(struct super_block *sb,
556 struct ext4_prealloc_space *pa),
561 __field( int, dev_major )
562 __field( int, dev_minor )
563 __field( __u64, pa_pstart )
564 __field( __u32, pa_len )
569 __entry->dev_major = MAJOR(sb->s_dev);
570 __entry->dev_minor = MINOR(sb->s_dev);
571 __entry->pa_pstart = pa->pa_pstart;
572 __entry->pa_len = pa->pa_len;
575 TP_printk("dev %d,%d pstart %llu len %u",
576 __entry->dev_major, __entry->dev_minor,
577 __entry->pa_pstart, __entry->pa_len)
580 TRACE_EVENT(ext4_discard_preallocations,
581 TP_PROTO(struct inode *inode),
586 __field( int, dev_major )
587 __field( int, dev_minor )
588 __field( ino_t, ino )
593 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
594 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
595 __entry->ino = inode->i_ino;
598 TP_printk("dev %d,%d ino %lu",
599 __entry->dev_major, __entry->dev_minor,
600 (unsigned long) __entry->ino)
603 TRACE_EVENT(ext4_mb_discard_preallocations,
604 TP_PROTO(struct super_block *sb, int needed),
609 __field( int, dev_major )
610 __field( int, dev_minor )
611 __field( int, needed )
616 __entry->dev_major = MAJOR(sb->s_dev);
617 __entry->dev_minor = MINOR(sb->s_dev);
618 __entry->needed = needed;
621 TP_printk("dev %d,%d needed %d",
622 __entry->dev_major, __entry->dev_minor, __entry->needed)
625 TRACE_EVENT(ext4_request_blocks,
626 TP_PROTO(struct ext4_allocation_request *ar),
631 __field( int, dev_major )
632 __field( int, dev_minor )
633 __field( ino_t, ino )
634 __field( unsigned int, flags )
635 __field( unsigned int, len )
636 __field( __u64, logical )
637 __field( __u64, goal )
638 __field( __u64, lleft )
639 __field( __u64, lright )
640 __field( __u64, pleft )
641 __field( __u64, pright )
645 __entry->dev_major = MAJOR(ar->inode->i_sb->s_dev);
646 __entry->dev_minor = MINOR(ar->inode->i_sb->s_dev);
647 __entry->ino = ar->inode->i_ino;
648 __entry->flags = ar->flags;
649 __entry->len = ar->len;
650 __entry->logical = ar->logical;
651 __entry->goal = ar->goal;
652 __entry->lleft = ar->lleft;
653 __entry->lright = ar->lright;
654 __entry->pleft = ar->pleft;
655 __entry->pright = ar->pright;
658 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
659 __entry->dev_major, __entry->dev_minor,
660 (unsigned long) __entry->ino,
661 __entry->flags, __entry->len,
662 (unsigned long long) __entry->logical,
663 (unsigned long long) __entry->goal,
664 (unsigned long long) __entry->lleft,
665 (unsigned long long) __entry->lright,
666 (unsigned long long) __entry->pleft,
667 (unsigned long long) __entry->pright)
670 TRACE_EVENT(ext4_allocate_blocks,
671 TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
676 __field( int, dev_major )
677 __field( int, dev_minor )
678 __field( ino_t, ino )
679 __field( __u64, block )
680 __field( unsigned int, flags )
681 __field( unsigned int, len )
682 __field( __u64, logical )
683 __field( __u64, goal )
684 __field( __u64, lleft )
685 __field( __u64, lright )
686 __field( __u64, pleft )
687 __field( __u64, pright )
691 __entry->dev_major = MAJOR(ar->inode->i_sb->s_dev);
692 __entry->dev_minor = MINOR(ar->inode->i_sb->s_dev);
693 __entry->ino = ar->inode->i_ino;
694 __entry->block = block;
695 __entry->flags = ar->flags;
696 __entry->len = ar->len;
697 __entry->logical = ar->logical;
698 __entry->goal = ar->goal;
699 __entry->lleft = ar->lleft;
700 __entry->lright = ar->lright;
701 __entry->pleft = ar->pleft;
702 __entry->pright = ar->pright;
705 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
706 __entry->dev_major, __entry->dev_minor,
707 (unsigned long) __entry->ino, __entry->flags,
708 __entry->len, __entry->block,
709 (unsigned long long) __entry->logical,
710 (unsigned long long) __entry->goal,
711 (unsigned long long) __entry->lleft,
712 (unsigned long long) __entry->lright,
713 (unsigned long long) __entry->pleft,
714 (unsigned long long) __entry->pright)
717 TRACE_EVENT(ext4_free_blocks,
718 TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
721 TP_ARGS(inode, block, count, flags),
724 __field( int, dev_major )
725 __field( int, dev_minor )
726 __field( ino_t, ino )
727 __field( umode_t, mode )
728 __field( __u64, block )
729 __field( unsigned long, count )
730 __field( int, flags )
734 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
735 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
736 __entry->ino = inode->i_ino;
737 __entry->mode = inode->i_mode;
738 __entry->block = block;
739 __entry->count = count;
740 __entry->flags = flags;
743 TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d",
744 __entry->dev_major, __entry->dev_minor,
745 (unsigned long) __entry->ino,
746 __entry->mode, __entry->block, __entry->count,
750 TRACE_EVENT(ext4_sync_file,
751 TP_PROTO(struct file *file, int datasync),
753 TP_ARGS(file, datasync),
756 __field( int, dev_major )
757 __field( int, dev_minor )
758 __field( ino_t, ino )
759 __field( ino_t, parent )
760 __field( int, datasync )
764 struct dentry *dentry = file->f_path.dentry;
766 __entry->dev_major = MAJOR(dentry->d_inode->i_sb->s_dev);
767 __entry->dev_minor = MINOR(dentry->d_inode->i_sb->s_dev);
768 __entry->ino = dentry->d_inode->i_ino;
769 __entry->datasync = datasync;
770 __entry->parent = dentry->d_parent->d_inode->i_ino;
773 TP_printk("dev %d,%d ino %ld parent %ld datasync %d ",
774 __entry->dev_major, __entry->dev_minor,
775 (unsigned long) __entry->ino,
776 (unsigned long) __entry->parent, __entry->datasync)
779 TRACE_EVENT(ext4_sync_fs,
780 TP_PROTO(struct super_block *sb, int wait),
785 __field( int, dev_major )
786 __field( int, dev_minor )
792 __entry->dev_major = MAJOR(sb->s_dev);
793 __entry->dev_minor = MINOR(sb->s_dev);
794 __entry->wait = wait;
797 TP_printk("dev %d,%d wait %d", __entry->dev_major,
798 __entry->dev_minor, __entry->wait)
801 TRACE_EVENT(ext4_alloc_da_blocks,
802 TP_PROTO(struct inode *inode),
807 __field( int, dev_major )
808 __field( int, dev_minor )
809 __field( ino_t, ino )
810 __field( unsigned int, data_blocks )
811 __field( unsigned int, meta_blocks )
815 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
816 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
817 __entry->ino = inode->i_ino;
818 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
819 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
822 TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
823 __entry->dev_major, __entry->dev_minor,
824 (unsigned long) __entry->ino,
825 __entry->data_blocks, __entry->meta_blocks)
828 TRACE_EVENT(ext4_mballoc_alloc,
829 TP_PROTO(struct ext4_allocation_context *ac),
834 __field( int, dev_major )
835 __field( int, dev_minor )
836 __field( ino_t, ino )
837 __field( __u16, found )
838 __field( __u16, groups )
839 __field( __u16, buddy )
840 __field( __u16, flags )
841 __field( __u16, tail )
843 __field( __u32, orig_logical )
844 __field( int, orig_start )
845 __field( __u32, orig_group )
846 __field( int, orig_len )
847 __field( __u32, goal_logical )
848 __field( int, goal_start )
849 __field( __u32, goal_group )
850 __field( int, goal_len )
851 __field( __u32, result_logical )
852 __field( int, result_start )
853 __field( __u32, result_group )
854 __field( int, result_len )
858 __entry->dev_major = MAJOR(ac->ac_inode->i_sb->s_dev);
859 __entry->dev_minor = MINOR(ac->ac_inode->i_sb->s_dev);
860 __entry->ino = ac->ac_inode->i_ino;
861 __entry->found = ac->ac_found;
862 __entry->flags = ac->ac_flags;
863 __entry->groups = ac->ac_groups_scanned;
864 __entry->buddy = ac->ac_buddy;
865 __entry->tail = ac->ac_tail;
866 __entry->cr = ac->ac_criteria;
867 __entry->orig_logical = ac->ac_o_ex.fe_logical;
868 __entry->orig_start = ac->ac_o_ex.fe_start;
869 __entry->orig_group = ac->ac_o_ex.fe_group;
870 __entry->orig_len = ac->ac_o_ex.fe_len;
871 __entry->goal_logical = ac->ac_g_ex.fe_logical;
872 __entry->goal_start = ac->ac_g_ex.fe_start;
873 __entry->goal_group = ac->ac_g_ex.fe_group;
874 __entry->goal_len = ac->ac_g_ex.fe_len;
875 __entry->result_logical = ac->ac_f_ex.fe_logical;
876 __entry->result_start = ac->ac_f_ex.fe_start;
877 __entry->result_group = ac->ac_f_ex.fe_group;
878 __entry->result_len = ac->ac_f_ex.fe_len;
881 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
882 "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
884 __entry->dev_major, __entry->dev_minor,
885 (unsigned long) __entry->ino,
886 __entry->orig_group, __entry->orig_start,
887 __entry->orig_len, __entry->orig_logical,
888 __entry->goal_group, __entry->goal_start,
889 __entry->goal_len, __entry->goal_logical,
890 __entry->result_group, __entry->result_start,
891 __entry->result_len, __entry->result_logical,
892 __entry->found, __entry->groups, __entry->cr,
893 __entry->flags, __entry->tail,
894 __entry->buddy ? 1 << __entry->buddy : 0)
897 TRACE_EVENT(ext4_mballoc_prealloc,
898 TP_PROTO(struct ext4_allocation_context *ac),
903 __field( int, dev_major )
904 __field( int, dev_minor )
905 __field( ino_t, ino )
906 __field( __u32, orig_logical )
907 __field( int, orig_start )
908 __field( __u32, orig_group )
909 __field( int, orig_len )
910 __field( __u32, result_logical )
911 __field( int, result_start )
912 __field( __u32, result_group )
913 __field( int, result_len )
917 __entry->dev_major = MAJOR(ac->ac_inode->i_sb->s_dev);
918 __entry->dev_minor = MINOR(ac->ac_inode->i_sb->s_dev);
919 __entry->ino = ac->ac_inode->i_ino;
920 __entry->orig_logical = ac->ac_o_ex.fe_logical;
921 __entry->orig_start = ac->ac_o_ex.fe_start;
922 __entry->orig_group = ac->ac_o_ex.fe_group;
923 __entry->orig_len = ac->ac_o_ex.fe_len;
924 __entry->result_logical = ac->ac_b_ex.fe_logical;
925 __entry->result_start = ac->ac_b_ex.fe_start;
926 __entry->result_group = ac->ac_b_ex.fe_group;
927 __entry->result_len = ac->ac_b_ex.fe_len;
930 TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
931 __entry->dev_major, __entry->dev_minor,
932 (unsigned long) __entry->ino,
933 __entry->orig_group, __entry->orig_start,
934 __entry->orig_len, __entry->orig_logical,
935 __entry->result_group, __entry->result_start,
936 __entry->result_len, __entry->result_logical)
939 DECLARE_EVENT_CLASS(ext4__mballoc,
940 TP_PROTO(struct super_block *sb,
946 TP_ARGS(sb, inode, group, start, len),
949 __field( int, dev_major )
950 __field( int, dev_minor )
951 __field( ino_t, ino )
952 __field( int, result_start )
953 __field( __u32, result_group )
954 __field( int, result_len )
958 __entry->dev_major = MAJOR(sb->s_dev);
959 __entry->dev_minor = MINOR(sb->s_dev);
960 __entry->ino = inode ? inode->i_ino : 0;
961 __entry->result_start = start;
962 __entry->result_group = group;
963 __entry->result_len = len;
966 TP_printk("dev %d,%d inode %lu extent %u/%d/%u ",
967 __entry->dev_major, __entry->dev_minor,
968 (unsigned long) __entry->ino,
969 __entry->result_group, __entry->result_start,
973 DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
975 TP_PROTO(struct super_block *sb,
981 TP_ARGS(sb, inode, group, start, len)
984 DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
986 TP_PROTO(struct super_block *sb,
992 TP_ARGS(sb, inode, group, start, len)
995 TRACE_EVENT(ext4_forget,
996 TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
998 TP_ARGS(inode, is_metadata, block),
1001 __field( int, dev_major )
1002 __field( int, dev_minor )
1003 __field( ino_t, ino )
1004 __field( umode_t, mode )
1005 __field( int, is_metadata )
1006 __field( __u64, block )
1010 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
1011 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
1012 __entry->ino = inode->i_ino;
1013 __entry->mode = inode->i_mode;
1014 __entry->is_metadata = is_metadata;
1015 __entry->block = block;
1018 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
1019 __entry->dev_major, __entry->dev_minor,
1020 (unsigned long) __entry->ino, __entry->mode,
1021 __entry->is_metadata, __entry->block)
1024 TRACE_EVENT(ext4_da_update_reserve_space,
1025 TP_PROTO(struct inode *inode, int used_blocks),
1027 TP_ARGS(inode, used_blocks),
1030 __field( int, dev_major )
1031 __field( int, dev_minor )
1032 __field( ino_t, ino )
1033 __field( umode_t, mode )
1034 __field( __u64, i_blocks )
1035 __field( int, used_blocks )
1036 __field( int, reserved_data_blocks )
1037 __field( int, reserved_meta_blocks )
1038 __field( int, allocated_meta_blocks )
1042 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
1043 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
1044 __entry->ino = inode->i_ino;
1045 __entry->mode = inode->i_mode;
1046 __entry->i_blocks = inode->i_blocks;
1047 __entry->used_blocks = used_blocks;
1048 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1049 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1050 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
1053 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d",
1054 __entry->dev_major, __entry->dev_minor,
1055 (unsigned long) __entry->ino, __entry->mode,
1056 (unsigned long long) __entry->i_blocks,
1057 __entry->used_blocks, __entry->reserved_data_blocks,
1058 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1061 TRACE_EVENT(ext4_da_reserve_space,
1062 TP_PROTO(struct inode *inode, int md_needed),
1064 TP_ARGS(inode, md_needed),
1067 __field( int, dev_major )
1068 __field( int, dev_minor )
1069 __field( ino_t, ino )
1070 __field( umode_t, mode )
1071 __field( __u64, i_blocks )
1072 __field( int, md_needed )
1073 __field( int, reserved_data_blocks )
1074 __field( int, reserved_meta_blocks )
1078 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
1079 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
1080 __entry->ino = inode->i_ino;
1081 __entry->mode = inode->i_mode;
1082 __entry->i_blocks = inode->i_blocks;
1083 __entry->md_needed = md_needed;
1084 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1085 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1088 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d reserved_data_blocks %d reserved_meta_blocks %d",
1089 __entry->dev_major, __entry->dev_minor,
1090 (unsigned long) __entry->ino,
1091 __entry->mode, (unsigned long long) __entry->i_blocks,
1092 __entry->md_needed, __entry->reserved_data_blocks,
1093 __entry->reserved_meta_blocks)
1096 TRACE_EVENT(ext4_da_release_space,
1097 TP_PROTO(struct inode *inode, int freed_blocks),
1099 TP_ARGS(inode, freed_blocks),
1102 __field( int, dev_major )
1103 __field( int, dev_minor )
1104 __field( ino_t, ino )
1105 __field( umode_t, mode )
1106 __field( __u64, i_blocks )
1107 __field( int, freed_blocks )
1108 __field( int, reserved_data_blocks )
1109 __field( int, reserved_meta_blocks )
1110 __field( int, allocated_meta_blocks )
1114 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
1115 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
1116 __entry->ino = inode->i_ino;
1117 __entry->mode = inode->i_mode;
1118 __entry->i_blocks = inode->i_blocks;
1119 __entry->freed_blocks = freed_blocks;
1120 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1121 __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1122 __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
1125 TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d reserved_data_blocks %d reserved_meta_blocks %d allocated_meta_blocks %d",
1126 __entry->dev_major, __entry->dev_minor,
1127 (unsigned long) __entry->ino,
1128 __entry->mode, (unsigned long long) __entry->i_blocks,
1129 __entry->freed_blocks, __entry->reserved_data_blocks,
1130 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1133 DECLARE_EVENT_CLASS(ext4__bitmap_load,
1134 TP_PROTO(struct super_block *sb, unsigned long group),
1139 __field( int, dev_major )
1140 __field( int, dev_minor )
1141 __field( __u32, group )
1146 __entry->dev_major = MAJOR(sb->s_dev);
1147 __entry->dev_minor = MINOR(sb->s_dev);
1148 __entry->group = group;
1151 TP_printk("dev %d,%d group %u",
1152 __entry->dev_major, __entry->dev_minor, __entry->group)
1155 DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1157 TP_PROTO(struct super_block *sb, unsigned long group),
1162 DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1164 TP_PROTO(struct super_block *sb, unsigned long group),
1169 #endif /* _TRACE_EXT4_H */
1171 /* This part must be outside protection */
1172 #include <trace/define_trace.h>