Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ext4.h
Go to the documentation of this file.
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM ext4
3 
4 #if !defined(_TRACE_EXT4_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_EXT4_H
6 
7 #include <linux/writeback.h>
8 #include <linux/tracepoint.h>
9 
12 struct ext4_extent;
13 struct ext4_prealloc_space;
14 struct ext4_inode_info;
15 struct mpage_da_data;
16 struct ext4_map_blocks;
17 struct ext4_extent;
18 
19 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
20 
22  TP_PROTO(struct inode *inode),
23 
24  TP_ARGS(inode),
25 
27  __field( dev_t, dev )
28  __field( ino_t, ino )
29  __field( uid_t, uid )
30  __field( gid_t, gid )
31  __field( __u64, blocks )
32  __field( __u16, mode )
33  ),
34 
36  __entry->dev = inode->i_sb->s_dev;
37  __entry->ino = inode->i_ino;
38  __entry->uid = i_uid_read(inode);
39  __entry->gid = i_gid_read(inode);
40  __entry->blocks = inode->i_blocks;
41  __entry->mode = inode->i_mode;
42  ),
43 
44  TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
45  MAJOR(__entry->dev), MINOR(__entry->dev),
46  (unsigned long) __entry->ino, __entry->mode,
47  __entry->uid, __entry->gid, __entry->blocks)
48 );
49 
50 TRACE_EVENT(ext4_request_inode,
51  TP_PROTO(struct inode *dir, int mode),
52 
53  TP_ARGS(dir, mode),
54 
56  __field( dev_t, dev )
57  __field( ino_t, dir )
58  __field( __u16, mode )
59  ),
60 
62  __entry->dev = dir->i_sb->s_dev;
63  __entry->dir = dir->i_ino;
64  __entry->mode = mode;
65  ),
66 
67  TP_printk("dev %d,%d dir %lu mode 0%o",
68  MAJOR(__entry->dev), MINOR(__entry->dev),
69  (unsigned long) __entry->dir, __entry->mode)
70 );
71 
72 TRACE_EVENT(ext4_allocate_inode,
73  TP_PROTO(struct inode *inode, struct inode *dir, int mode),
74 
75  TP_ARGS(inode, dir, mode),
76 
78  __field( dev_t, dev )
79  __field( ino_t, ino )
80  __field( ino_t, dir )
81  __field( __u16, mode )
82  ),
83 
85  __entry->dev = inode->i_sb->s_dev;
86  __entry->ino = inode->i_ino;
87  __entry->dir = dir->i_ino;
88  __entry->mode = mode;
89  ),
90 
91  TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
92  MAJOR(__entry->dev), MINOR(__entry->dev),
93  (unsigned long) __entry->ino,
94  (unsigned long) __entry->dir, __entry->mode)
95 );
96 
98  TP_PROTO(struct inode *inode),
99 
100  TP_ARGS(inode),
101 
103  __field( dev_t, dev )
104  __field( ino_t, ino )
105  __field( int, nlink )
106  ),
107 
109  __entry->dev = inode->i_sb->s_dev;
110  __entry->ino = inode->i_ino;
111  __entry->nlink = inode->i_nlink;
112  ),
113 
114  TP_printk("dev %d,%d ino %lu nlink %d",
115  MAJOR(__entry->dev), MINOR(__entry->dev),
116  (unsigned long) __entry->ino, __entry->nlink)
117 );
118 
119 TRACE_EVENT(ext4_drop_inode,
120  TP_PROTO(struct inode *inode, int drop),
121 
122  TP_ARGS(inode, drop),
123 
125  __field( dev_t, dev )
126  __field( ino_t, ino )
127  __field( int, drop )
128  ),
129 
131  __entry->dev = inode->i_sb->s_dev;
132  __entry->ino = inode->i_ino;
133  __entry->drop = drop;
134  ),
135 
136  TP_printk("dev %d,%d ino %lu drop %d",
137  MAJOR(__entry->dev), MINOR(__entry->dev),
138  (unsigned long) __entry->ino, __entry->drop)
139 );
140 
142  TP_PROTO(struct inode *inode, unsigned long IP),
143 
144  TP_ARGS(inode, IP),
145 
147  __field( dev_t, dev )
148  __field( ino_t, ino )
149  __field(unsigned long, ip )
150  ),
151 
153  __entry->dev = inode->i_sb->s_dev;
154  __entry->ino = inode->i_ino;
155  __entry->ip = IP;
156  ),
157 
158  TP_printk("dev %d,%d ino %lu caller %pF",
159  MAJOR(__entry->dev), MINOR(__entry->dev),
160  (unsigned long) __entry->ino, (void *)__entry->ip)
161 );
162 
163 TRACE_EVENT(ext4_begin_ordered_truncate,
164  TP_PROTO(struct inode *inode, loff_t new_size),
165 
166  TP_ARGS(inode, new_size),
167 
169  __field( dev_t, dev )
170  __field( ino_t, ino )
171  __field( loff_t, new_size )
172  ),
173 
175  __entry->dev = inode->i_sb->s_dev;
176  __entry->ino = inode->i_ino;
177  __entry->new_size = new_size;
178  ),
179 
180  TP_printk("dev %d,%d ino %lu new_size %lld",
181  MAJOR(__entry->dev), MINOR(__entry->dev),
182  (unsigned long) __entry->ino,
183  __entry->new_size)
184 );
185 
186 DECLARE_EVENT_CLASS(ext4__write_begin,
187 
188  TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
189  unsigned int flags),
190 
191  TP_ARGS(inode, pos, len, flags),
192 
194  __field( dev_t, dev )
195  __field( ino_t, ino )
196  __field( loff_t, pos )
197  __field( unsigned int, len )
198  __field( unsigned int, flags )
199  ),
200 
202  __entry->dev = inode->i_sb->s_dev;
203  __entry->ino = inode->i_ino;
204  __entry->pos = pos;
205  __entry->len = len;
206  __entry->flags = flags;
207  ),
208 
209  TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
210  MAJOR(__entry->dev), MINOR(__entry->dev),
211  (unsigned long) __entry->ino,
212  __entry->pos, __entry->len, __entry->flags)
213 );
214 
215 DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
216 
217  TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
218  unsigned int flags),
219 
220  TP_ARGS(inode, pos, len, flags)
221 );
222 
223 DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
224 
225  TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
226  unsigned int flags),
227 
228  TP_ARGS(inode, pos, len, flags)
229 );
230 
231 DECLARE_EVENT_CLASS(ext4__write_end,
232  TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
233  unsigned int copied),
234 
235  TP_ARGS(inode, pos, len, copied),
236 
238  __field( dev_t, dev )
239  __field( ino_t, ino )
240  __field( loff_t, pos )
241  __field( unsigned int, len )
242  __field( unsigned int, copied )
243  ),
244 
246  __entry->dev = inode->i_sb->s_dev;
247  __entry->ino = inode->i_ino;
248  __entry->pos = pos;
249  __entry->len = len;
250  __entry->copied = copied;
251  ),
252 
253  TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
254  MAJOR(__entry->dev), MINOR(__entry->dev),
255  (unsigned long) __entry->ino,
256  __entry->pos, __entry->len, __entry->copied)
257 );
258 
259 DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end,
260 
261  TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
262  unsigned int copied),
263 
264  TP_ARGS(inode, pos, len, copied)
265 );
266 
267 DEFINE_EVENT(ext4__write_end, ext4_writeback_write_end,
268 
269  TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
270  unsigned int copied),
271 
272  TP_ARGS(inode, pos, len, copied)
273 );
274 
275 DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
276 
277  TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
278  unsigned int copied),
279 
280  TP_ARGS(inode, pos, len, copied)
281 );
282 
283 DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
284 
285  TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
286  unsigned int copied),
287 
288  TP_ARGS(inode, pos, len, copied)
289 );
290 
291 TRACE_EVENT(ext4_da_writepages,
292  TP_PROTO(struct inode *inode, struct writeback_control *wbc),
293 
294  TP_ARGS(inode, wbc),
295 
297  __field( dev_t, dev )
298  __field( ino_t, ino )
299  __field( long, nr_to_write )
300  __field( long, pages_skipped )
301  __field( loff_t, range_start )
302  __field( loff_t, range_end )
304  __field( int, sync_mode )
305  __field( char, for_kupdate )
306  __field( char, range_cyclic )
307  ),
308 
310  __entry->dev = inode->i_sb->s_dev;
311  __entry->ino = inode->i_ino;
312  __entry->nr_to_write = wbc->nr_to_write;
313  __entry->pages_skipped = wbc->pages_skipped;
314  __entry->range_start = wbc->range_start;
315  __entry->range_end = wbc->range_end;
316  __entry->writeback_index = inode->i_mapping->writeback_index;
317  __entry->sync_mode = wbc->sync_mode;
318  __entry->for_kupdate = wbc->for_kupdate;
319  __entry->range_cyclic = wbc->range_cyclic;
320  ),
321 
322  TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
323  "range_start %lld range_end %lld sync_mode %d "
324  "for_kupdate %d range_cyclic %d writeback_index %lu",
325  MAJOR(__entry->dev), MINOR(__entry->dev),
326  (unsigned long) __entry->ino, __entry->nr_to_write,
327  __entry->pages_skipped, __entry->range_start,
328  __entry->range_end, __entry->sync_mode,
329  __entry->for_kupdate, __entry->range_cyclic,
330  (unsigned long) __entry->writeback_index)
331 );
332 
333 TRACE_EVENT(ext4_da_write_pages,
334  TP_PROTO(struct inode *inode, struct mpage_da_data *mpd),
335 
336  TP_ARGS(inode, mpd),
337 
339  __field( dev_t, dev )
340  __field( ino_t, ino )
341  __field( __u64, b_blocknr )
342  __field( __u32, b_size )
343  __field( __u32, b_state )
344  __field( unsigned long, first_page )
345  __field( int, io_done )
346  __field( int, pages_written )
347  __field( int, sync_mode )
348  ),
349 
351  __entry->dev = inode->i_sb->s_dev;
352  __entry->ino = inode->i_ino;
353  __entry->b_blocknr = mpd->b_blocknr;
354  __entry->b_size = mpd->b_size;
355  __entry->b_state = mpd->b_state;
356  __entry->first_page = mpd->first_page;
357  __entry->io_done = mpd->io_done;
358  __entry->pages_written = mpd->pages_written;
359  __entry->sync_mode = mpd->wbc->sync_mode;
360  ),
361 
362  TP_printk("dev %d,%d ino %lu b_blocknr %llu b_size %u b_state 0x%04x "
363  "first_page %lu io_done %d pages_written %d sync_mode %d",
364  MAJOR(__entry->dev), MINOR(__entry->dev),
365  (unsigned long) __entry->ino,
366  __entry->b_blocknr, __entry->b_size,
367  __entry->b_state, __entry->first_page,
368  __entry->io_done, __entry->pages_written,
369  __entry->sync_mode
370  )
371 );
372 
373 TRACE_EVENT(ext4_da_writepages_result,
374  TP_PROTO(struct inode *inode, struct writeback_control *wbc,
375  int ret, int pages_written),
376 
377  TP_ARGS(inode, wbc, ret, pages_written),
378 
380  __field( dev_t, dev )
381  __field( ino_t, ino )
382  __field( int, ret )
383  __field( int, pages_written )
384  __field( long, pages_skipped )
386  __field( int, sync_mode )
387  ),
388 
390  __entry->dev = inode->i_sb->s_dev;
391  __entry->ino = inode->i_ino;
392  __entry->ret = ret;
393  __entry->pages_written = pages_written;
394  __entry->pages_skipped = wbc->pages_skipped;
395  __entry->writeback_index = inode->i_mapping->writeback_index;
396  __entry->sync_mode = wbc->sync_mode;
397  ),
398 
399  TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
400  "sync_mode %d writeback_index %lu",
401  MAJOR(__entry->dev), MINOR(__entry->dev),
402  (unsigned long) __entry->ino, __entry->ret,
403  __entry->pages_written, __entry->pages_skipped,
404  __entry->sync_mode,
405  (unsigned long) __entry->writeback_index)
406 );
407 
408 DECLARE_EVENT_CLASS(ext4__page_op,
409  TP_PROTO(struct page *page),
410 
411  TP_ARGS(page),
412 
414  __field( dev_t, dev )
415  __field( ino_t, ino )
416  __field( pgoff_t, index )
417 
418  ),
419 
421  __entry->dev = page->mapping->host->i_sb->s_dev;
422  __entry->ino = page->mapping->host->i_ino;
423  __entry->index = page->index;
424  ),
425 
426  TP_printk("dev %d,%d ino %lu page_index %lu",
427  MAJOR(__entry->dev), MINOR(__entry->dev),
428  (unsigned long) __entry->ino,
429  (unsigned long) __entry->index)
430 );
431 
432 DEFINE_EVENT(ext4__page_op, ext4_writepage,
433 
434  TP_PROTO(struct page *page),
435 
436  TP_ARGS(page)
437 );
438 
439 DEFINE_EVENT(ext4__page_op, ext4_readpage,
440 
441  TP_PROTO(struct page *page),
442 
443  TP_ARGS(page)
444 );
445 
446 DEFINE_EVENT(ext4__page_op, ext4_releasepage,
447 
448  TP_PROTO(struct page *page),
449 
450  TP_ARGS(page)
451 );
452 
453 TRACE_EVENT(ext4_invalidatepage,
454  TP_PROTO(struct page *page, unsigned long offset),
455 
456  TP_ARGS(page, offset),
457 
459  __field( dev_t, dev )
460  __field( ino_t, ino )
461  __field( pgoff_t, index )
462  __field( unsigned long, offset )
463 
464  ),
465 
467  __entry->dev = page->mapping->host->i_sb->s_dev;
468  __entry->ino = page->mapping->host->i_ino;
469  __entry->index = page->index;
470  __entry->offset = offset;
471  ),
472 
473  TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
474  MAJOR(__entry->dev), MINOR(__entry->dev),
475  (unsigned long) __entry->ino,
476  (unsigned long) __entry->index, __entry->offset)
477 );
478 
479 TRACE_EVENT(ext4_discard_blocks,
480  TP_PROTO(struct super_block *sb, unsigned long long blk,
481  unsigned long long count),
482 
483  TP_ARGS(sb, blk, count),
484 
486  __field( dev_t, dev )
487  __field( __u64, blk )
488  __field( __u64, count )
489 
490  ),
491 
493  __entry->dev = sb->s_dev;
494  __entry->blk = blk;
495  __entry->count = count;
496  ),
497 
498  TP_printk("dev %d,%d blk %llu count %llu",
499  MAJOR(__entry->dev), MINOR(__entry->dev),
500  __entry->blk, __entry->count)
501 );
502 
503 DECLARE_EVENT_CLASS(ext4__mb_new_pa,
505  struct ext4_prealloc_space *pa),
506 
507  TP_ARGS(ac, pa),
508 
510  __field( dev_t, dev )
511  __field( ino_t, ino )
512  __field( __u64, pa_pstart )
513  __field( __u64, pa_lstart )
514  __field( __u32, pa_len )
515 
516  ),
517 
519  __entry->dev = ac->ac_sb->s_dev;
520  __entry->ino = ac->ac_inode->i_ino;
521  __entry->pa_pstart = pa->pa_pstart;
522  __entry->pa_lstart = pa->pa_lstart;
523  __entry->pa_len = pa->pa_len;
524  ),
525 
526  TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
527  MAJOR(__entry->dev), MINOR(__entry->dev),
528  (unsigned long) __entry->ino,
529  __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
530 );
531 
532 DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
533 
535  struct ext4_prealloc_space *pa),
536 
537  TP_ARGS(ac, pa)
538 );
539 
540 DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
541 
543  struct ext4_prealloc_space *pa),
544 
545  TP_ARGS(ac, pa)
546 );
547 
548 TRACE_EVENT(ext4_mb_release_inode_pa,
549  TP_PROTO(struct ext4_prealloc_space *pa,
550  unsigned long long block, unsigned int count),
551 
552  TP_ARGS(pa, block, count),
553 
555  __field( dev_t, dev )
556  __field( ino_t, ino )
557  __field( __u64, block )
558  __field( __u32, count )
559 
560  ),
561 
563  __entry->dev = pa->pa_inode->i_sb->s_dev;
564  __entry->ino = pa->pa_inode->i_ino;
565  __entry->block = block;
566  __entry->count = count;
567  ),
568 
569  TP_printk("dev %d,%d ino %lu block %llu count %u",
570  MAJOR(__entry->dev), MINOR(__entry->dev),
571  (unsigned long) __entry->ino,
572  __entry->block, __entry->count)
573 );
574 
575 TRACE_EVENT(ext4_mb_release_group_pa,
576  TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa),
577 
578  TP_ARGS(sb, pa),
579 
581  __field( dev_t, dev )
582  __field( __u64, pa_pstart )
583  __field( __u32, pa_len )
584 
585  ),
586 
588  __entry->dev = sb->s_dev;
589  __entry->pa_pstart = pa->pa_pstart;
590  __entry->pa_len = pa->pa_len;
591  ),
592 
593  TP_printk("dev %d,%d pstart %llu len %u",
594  MAJOR(__entry->dev), MINOR(__entry->dev),
595  __entry->pa_pstart, __entry->pa_len)
596 );
597 
599  TP_PROTO(struct inode *inode),
600 
601  TP_ARGS(inode),
602 
604  __field( dev_t, dev )
605  __field( ino_t, ino )
606 
607  ),
608 
610  __entry->dev = inode->i_sb->s_dev;
611  __entry->ino = inode->i_ino;
612  ),
613 
614  TP_printk("dev %d,%d ino %lu",
615  MAJOR(__entry->dev), MINOR(__entry->dev),
616  (unsigned long) __entry->ino)
617 );
618 
619 TRACE_EVENT(ext4_mb_discard_preallocations,
620  TP_PROTO(struct super_block *sb, int needed),
621 
622  TP_ARGS(sb, needed),
623 
625  __field( dev_t, dev )
626  __field( int, needed )
627 
628  ),
629 
631  __entry->dev = sb->s_dev;
632  __entry->needed = needed;
633  ),
634 
635  TP_printk("dev %d,%d needed %d",
636  MAJOR(__entry->dev), MINOR(__entry->dev),
637  __entry->needed)
638 );
639 
640 TRACE_EVENT(ext4_request_blocks,
642 
643  TP_ARGS(ar),
644 
646  __field( dev_t, dev )
647  __field( ino_t, ino )
648  __field( unsigned int, len )
649  __field( __u32, logical )
650  __field( __u32, lleft )
651  __field( __u32, lright )
652  __field( __u64, goal )
653  __field( __u64, pleft )
654  __field( __u64, pright )
655  __field( unsigned int, flags )
656  ),
657 
659  __entry->dev = ar->inode->i_sb->s_dev;
660  __entry->ino = ar->inode->i_ino;
661  __entry->len = ar->len;
662  __entry->logical = ar->logical;
663  __entry->goal = ar->goal;
664  __entry->lleft = ar->lleft;
665  __entry->lright = ar->lright;
666  __entry->pleft = ar->pleft;
667  __entry->pright = ar->pright;
668  __entry->flags = ar->flags;
669  ),
670 
671  TP_printk("dev %d,%d ino %lu flags %u len %u lblk %u goal %llu "
672  "lleft %u lright %u pleft %llu pright %llu ",
673  MAJOR(__entry->dev), MINOR(__entry->dev),
674  (unsigned long) __entry->ino, __entry->flags,
675  __entry->len, __entry->logical, __entry->goal,
676  __entry->lleft, __entry->lright, __entry->pleft,
677  __entry->pright)
678 );
679 
680 TRACE_EVENT(ext4_allocate_blocks,
681  TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
682 
683  TP_ARGS(ar, block),
684 
686  __field( dev_t, dev )
687  __field( ino_t, ino )
688  __field( __u64, block )
689  __field( unsigned int, len )
690  __field( __u32, logical )
691  __field( __u32, lleft )
692  __field( __u32, lright )
693  __field( __u64, goal )
694  __field( __u64, pleft )
695  __field( __u64, pright )
696  __field( unsigned int, flags )
697  ),
698 
700  __entry->dev = ar->inode->i_sb->s_dev;
701  __entry->ino = ar->inode->i_ino;
702  __entry->block = block;
703  __entry->len = ar->len;
704  __entry->logical = ar->logical;
705  __entry->goal = ar->goal;
706  __entry->lleft = ar->lleft;
707  __entry->lright = ar->lright;
708  __entry->pleft = ar->pleft;
709  __entry->pright = ar->pright;
710  __entry->flags = ar->flags;
711  ),
712 
713  TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %u "
714  "goal %llu lleft %u lright %u pleft %llu pright %llu",
715  MAJOR(__entry->dev), MINOR(__entry->dev),
716  (unsigned long) __entry->ino, __entry->flags,
717  __entry->len, __entry->block, __entry->logical,
718  __entry->goal, __entry->lleft, __entry->lright,
719  __entry->pleft, __entry->pright)
720 );
721 
723  TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
724  int flags),
725 
726  TP_ARGS(inode, block, count, flags),
727 
729  __field( dev_t, dev )
730  __field( ino_t, ino )
731  __field( __u64, block )
732  __field( unsigned long, count )
733  __field( int, flags )
734  __field( __u16, mode )
735  ),
736 
738  __entry->dev = inode->i_sb->s_dev;
739  __entry->ino = inode->i_ino;
740  __entry->block = block;
741  __entry->count = count;
742  __entry->flags = flags;
743  __entry->mode = inode->i_mode;
744  ),
745 
746  TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %d",
747  MAJOR(__entry->dev), MINOR(__entry->dev),
748  (unsigned long) __entry->ino,
749  __entry->mode, __entry->block, __entry->count,
750  __entry->flags)
751 );
752 
753 TRACE_EVENT(ext4_sync_file_enter,
754  TP_PROTO(struct file *file, int datasync),
755 
756  TP_ARGS(file, datasync),
757 
759  __field( dev_t, dev )
760  __field( ino_t, ino )
761  __field( ino_t, parent )
762  __field( int, datasync )
763  ),
764 
766  struct dentry *dentry = file->f_path.dentry;
767 
768  __entry->dev = dentry->d_inode->i_sb->s_dev;
769  __entry->ino = dentry->d_inode->i_ino;
770  __entry->datasync = datasync;
771  __entry->parent = dentry->d_parent->d_inode->i_ino;
772  ),
773 
774  TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
775  MAJOR(__entry->dev), MINOR(__entry->dev),
776  (unsigned long) __entry->ino,
777  (unsigned long) __entry->parent, __entry->datasync)
778 );
779 
780 TRACE_EVENT(ext4_sync_file_exit,
781  TP_PROTO(struct inode *inode, int ret),
782 
783  TP_ARGS(inode, ret),
784 
786  __field( dev_t, dev )
787  __field( ino_t, ino )
788  __field( int, ret )
789  ),
790 
792  __entry->dev = inode->i_sb->s_dev;
793  __entry->ino = inode->i_ino;
794  __entry->ret = ret;
795  ),
796 
797  TP_printk("dev %d,%d ino %lu ret %d",
798  MAJOR(__entry->dev), MINOR(__entry->dev),
799  (unsigned long) __entry->ino,
800  __entry->ret)
801 );
802 
803 TRACE_EVENT(ext4_sync_fs,
804  TP_PROTO(struct super_block *sb, int wait),
805 
806  TP_ARGS(sb, wait),
807 
809  __field( dev_t, dev )
810  __field( int, wait )
811 
812  ),
813 
815  __entry->dev = sb->s_dev;
816  __entry->wait = wait;
817  ),
818 
819  TP_printk("dev %d,%d wait %d",
820  MAJOR(__entry->dev), MINOR(__entry->dev),
821  __entry->wait)
822 );
823 
825  TP_PROTO(struct inode *inode),
826 
827  TP_ARGS(inode),
828 
830  __field( dev_t, dev )
831  __field( ino_t, ino )
832  __field( unsigned int, data_blocks )
833  __field( unsigned int, meta_blocks )
834  ),
835 
837  __entry->dev = inode->i_sb->s_dev;
838  __entry->ino = inode->i_ino;
839  __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
840  __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
841  ),
842 
843  TP_printk("dev %d,%d ino %lu data_blocks %u meta_blocks %u",
844  MAJOR(__entry->dev), MINOR(__entry->dev),
845  (unsigned long) __entry->ino,
846  __entry->data_blocks, __entry->meta_blocks)
847 );
848 
849 TRACE_EVENT(ext4_mballoc_alloc,
850  TP_PROTO(struct ext4_allocation_context *ac),
851 
852  TP_ARGS(ac),
853 
855  __field( dev_t, dev )
856  __field( ino_t, ino )
857  __field( __u32, orig_logical )
858  __field( int, orig_start )
859  __field( __u32, orig_group )
860  __field( int, orig_len )
861  __field( __u32, goal_logical )
862  __field( int, goal_start )
863  __field( __u32, goal_group )
864  __field( int, goal_len )
865  __field( __u32, result_logical )
866  __field( int, result_start )
867  __field( __u32, result_group )
868  __field( int, result_len )
869  __field( __u16, found )
870  __field( __u16, groups )
871  __field( __u16, buddy )
872  __field( __u16, flags )
873  __field( __u16, tail )
874  __field( __u8, cr )
875  ),
876 
878  __entry->dev = ac->ac_inode->i_sb->s_dev;
879  __entry->ino = ac->ac_inode->i_ino;
880  __entry->orig_logical = ac->ac_o_ex.fe_logical;
881  __entry->orig_start = ac->ac_o_ex.fe_start;
882  __entry->orig_group = ac->ac_o_ex.fe_group;
883  __entry->orig_len = ac->ac_o_ex.fe_len;
884  __entry->goal_logical = ac->ac_g_ex.fe_logical;
885  __entry->goal_start = ac->ac_g_ex.fe_start;
886  __entry->goal_group = ac->ac_g_ex.fe_group;
887  __entry->goal_len = ac->ac_g_ex.fe_len;
888  __entry->result_logical = ac->ac_f_ex.fe_logical;
889  __entry->result_start = ac->ac_f_ex.fe_start;
890  __entry->result_group = ac->ac_f_ex.fe_group;
891  __entry->result_len = ac->ac_f_ex.fe_len;
892  __entry->found = ac->ac_found;
893  __entry->flags = ac->ac_flags;
894  __entry->groups = ac->ac_groups_scanned;
895  __entry->buddy = ac->ac_buddy;
896  __entry->tail = ac->ac_tail;
897  __entry->cr = ac->ac_criteria;
898  ),
899 
900  TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
901  "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
902  "tail %u broken %u",
903  MAJOR(__entry->dev), MINOR(__entry->dev),
904  (unsigned long) __entry->ino,
905  __entry->orig_group, __entry->orig_start,
906  __entry->orig_len, __entry->orig_logical,
907  __entry->goal_group, __entry->goal_start,
908  __entry->goal_len, __entry->goal_logical,
909  __entry->result_group, __entry->result_start,
910  __entry->result_len, __entry->result_logical,
911  __entry->found, __entry->groups, __entry->cr,
912  __entry->flags, __entry->tail,
913  __entry->buddy ? 1 << __entry->buddy : 0)
914 );
915 
916 TRACE_EVENT(ext4_mballoc_prealloc,
917  TP_PROTO(struct ext4_allocation_context *ac),
918 
919  TP_ARGS(ac),
920 
922  __field( dev_t, dev )
923  __field( ino_t, ino )
924  __field( __u32, orig_logical )
925  __field( int, orig_start )
926  __field( __u32, orig_group )
927  __field( int, orig_len )
928  __field( __u32, result_logical )
929  __field( int, result_start )
930  __field( __u32, result_group )
931  __field( int, result_len )
932  ),
933 
935  __entry->dev = ac->ac_inode->i_sb->s_dev;
936  __entry->ino = ac->ac_inode->i_ino;
937  __entry->orig_logical = ac->ac_o_ex.fe_logical;
938  __entry->orig_start = ac->ac_o_ex.fe_start;
939  __entry->orig_group = ac->ac_o_ex.fe_group;
940  __entry->orig_len = ac->ac_o_ex.fe_len;
941  __entry->result_logical = ac->ac_b_ex.fe_logical;
942  __entry->result_start = ac->ac_b_ex.fe_start;
943  __entry->result_group = ac->ac_b_ex.fe_group;
944  __entry->result_len = ac->ac_b_ex.fe_len;
945  ),
946 
947  TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
948  MAJOR(__entry->dev), MINOR(__entry->dev),
949  (unsigned long) __entry->ino,
950  __entry->orig_group, __entry->orig_start,
951  __entry->orig_len, __entry->orig_logical,
952  __entry->result_group, __entry->result_start,
953  __entry->result_len, __entry->result_logical)
954 );
955 
956 DECLARE_EVENT_CLASS(ext4__mballoc,
957  TP_PROTO(struct super_block *sb,
958  struct inode *inode,
961  ext4_grpblk_t len),
962 
963  TP_ARGS(sb, inode, group, start, len),
964 
966  __field( dev_t, dev )
967  __field( ino_t, ino )
968  __field( int, result_start )
969  __field( __u32, result_group )
970  __field( int, result_len )
971  ),
972 
974  __entry->dev = sb->s_dev;
975  __entry->ino = inode ? inode->i_ino : 0;
976  __entry->result_start = start;
977  __entry->result_group = group;
978  __entry->result_len = len;
979  ),
980 
981  TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
982  MAJOR(__entry->dev), MINOR(__entry->dev),
983  (unsigned long) __entry->ino,
984  __entry->result_group, __entry->result_start,
985  __entry->result_len)
986 );
987 
988 DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
989 
990  TP_PROTO(struct super_block *sb,
991  struct inode *inode,
992  ext4_group_t group,
993  ext4_grpblk_t start,
994  ext4_grpblk_t len),
995 
996  TP_ARGS(sb, inode, group, start, len)
997 );
998 
999 DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
1000 
1001  TP_PROTO(struct super_block *sb,
1002  struct inode *inode,
1003  ext4_group_t group,
1004  ext4_grpblk_t start,
1005  ext4_grpblk_t len),
1006 
1007  TP_ARGS(sb, inode, group, start, len)
1008 );
1009 
1011  TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
1012 
1013  TP_ARGS(inode, is_metadata, block),
1014 
1016  __field( dev_t, dev )
1017  __field( ino_t, ino )
1018  __field( __u64, block )
1019  __field( int, is_metadata )
1020  __field( __u16, mode )
1021  ),
1022 
1024  __entry->dev = inode->i_sb->s_dev;
1025  __entry->ino = inode->i_ino;
1026  __entry->block = block;
1027  __entry->is_metadata = is_metadata;
1028  __entry->mode = inode->i_mode;
1029  ),
1030 
1031  TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
1032  MAJOR(__entry->dev), MINOR(__entry->dev),
1033  (unsigned long) __entry->ino,
1034  __entry->mode, __entry->is_metadata, __entry->block)
1035 );
1036 
1038  TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
1039 
1040  TP_ARGS(inode, used_blocks, quota_claim),
1041 
1043  __field( dev_t, dev )
1044  __field( ino_t, ino )
1045  __field( __u64, i_blocks )
1046  __field( int, used_blocks )
1047  __field( int, reserved_data_blocks )
1048  __field( int, reserved_meta_blocks )
1049  __field( int, allocated_meta_blocks )
1050  __field( int, quota_claim )
1051  __field( __u16, mode )
1052  ),
1053 
1055  __entry->dev = inode->i_sb->s_dev;
1056  __entry->ino = inode->i_ino;
1057  __entry->i_blocks = inode->i_blocks;
1058  __entry->used_blocks = used_blocks;
1059  __entry->reserved_data_blocks =
1060  EXT4_I(inode)->i_reserved_data_blocks;
1061  __entry->reserved_meta_blocks =
1062  EXT4_I(inode)->i_reserved_meta_blocks;
1063  __entry->allocated_meta_blocks =
1064  EXT4_I(inode)->i_allocated_meta_blocks;
1065  __entry->quota_claim = quota_claim;
1066  __entry->mode = inode->i_mode;
1067  ),
1068 
1069  TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1070  "reserved_data_blocks %d reserved_meta_blocks %d "
1071  "allocated_meta_blocks %d quota_claim %d",
1072  MAJOR(__entry->dev), MINOR(__entry->dev),
1073  (unsigned long) __entry->ino,
1074  __entry->mode, __entry->i_blocks,
1075  __entry->used_blocks, __entry->reserved_data_blocks,
1076  __entry->reserved_meta_blocks, __entry->allocated_meta_blocks,
1077  __entry->quota_claim)
1078 );
1079 
1080 TRACE_EVENT(ext4_da_reserve_space,
1081  TP_PROTO(struct inode *inode, int md_needed),
1082 
1083  TP_ARGS(inode, md_needed),
1084 
1086  __field( dev_t, dev )
1087  __field( ino_t, ino )
1088  __field( __u64, i_blocks )
1089  __field( int, md_needed )
1090  __field( int, reserved_data_blocks )
1091  __field( int, reserved_meta_blocks )
1092  __field( __u16, mode )
1093  ),
1094 
1096  __entry->dev = inode->i_sb->s_dev;
1097  __entry->ino = inode->i_ino;
1098  __entry->i_blocks = inode->i_blocks;
1099  __entry->md_needed = md_needed;
1100  __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1101  __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1102  __entry->mode = inode->i_mode;
1103  ),
1104 
1105  TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu md_needed %d "
1106  "reserved_data_blocks %d reserved_meta_blocks %d",
1107  MAJOR(__entry->dev), MINOR(__entry->dev),
1108  (unsigned long) __entry->ino,
1109  __entry->mode, __entry->i_blocks,
1110  __entry->md_needed, __entry->reserved_data_blocks,
1111  __entry->reserved_meta_blocks)
1112 );
1113 
1114 TRACE_EVENT(ext4_da_release_space,
1115  TP_PROTO(struct inode *inode, int freed_blocks),
1116 
1117  TP_ARGS(inode, freed_blocks),
1118 
1120  __field( dev_t, dev )
1121  __field( ino_t, ino )
1122  __field( __u64, i_blocks )
1123  __field( int, freed_blocks )
1124  __field( int, reserved_data_blocks )
1125  __field( int, reserved_meta_blocks )
1126  __field( int, allocated_meta_blocks )
1127  __field( __u16, mode )
1128  ),
1129 
1131  __entry->dev = inode->i_sb->s_dev;
1132  __entry->ino = inode->i_ino;
1133  __entry->i_blocks = inode->i_blocks;
1134  __entry->freed_blocks = freed_blocks;
1135  __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1136  __entry->reserved_meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
1137  __entry->allocated_meta_blocks = EXT4_I(inode)->i_allocated_meta_blocks;
1138  __entry->mode = inode->i_mode;
1139  ),
1140 
1141  TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1142  "reserved_data_blocks %d reserved_meta_blocks %d "
1143  "allocated_meta_blocks %d",
1144  MAJOR(__entry->dev), MINOR(__entry->dev),
1145  (unsigned long) __entry->ino,
1146  __entry->mode, __entry->i_blocks,
1147  __entry->freed_blocks, __entry->reserved_data_blocks,
1148  __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1149 );
1150 
1151 DECLARE_EVENT_CLASS(ext4__bitmap_load,
1152  TP_PROTO(struct super_block *sb, unsigned long group),
1153 
1154  TP_ARGS(sb, group),
1155 
1157  __field( dev_t, dev )
1158  __field( __u32, group )
1159 
1160  ),
1161 
1163  __entry->dev = sb->s_dev;
1164  __entry->group = group;
1165  ),
1166 
1167  TP_printk("dev %d,%d group %u",
1168  MAJOR(__entry->dev), MINOR(__entry->dev),
1169  __entry->group)
1170 );
1171 
1172 DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1173 
1174  TP_PROTO(struct super_block *sb, unsigned long group),
1175 
1176  TP_ARGS(sb, group)
1177 );
1178 
1179 DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1180 
1181  TP_PROTO(struct super_block *sb, unsigned long group),
1182 
1183  TP_ARGS(sb, group)
1184 );
1185 
1186 DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1187 
1188  TP_PROTO(struct super_block *sb, unsigned long group),
1189 
1190  TP_ARGS(sb, group)
1191 );
1192 
1193 DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1194 
1195  TP_PROTO(struct super_block *sb, unsigned long group),
1196 
1197  TP_ARGS(sb, group)
1198 );
1199 
1200 TRACE_EVENT(ext4_direct_IO_enter,
1201  TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1202 
1203  TP_ARGS(inode, offset, len, rw),
1204 
1206  __field( dev_t, dev )
1207  __field( ino_t, ino )
1208  __field( loff_t, pos )
1209  __field( unsigned long, len )
1210  __field( int, rw )
1211  ),
1212 
1214  __entry->dev = inode->i_sb->s_dev;
1215  __entry->ino = inode->i_ino;
1216  __entry->pos = offset;
1217  __entry->len = len;
1218  __entry->rw = rw;
1219  ),
1220 
1221  TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
1222  MAJOR(__entry->dev), MINOR(__entry->dev),
1223  (unsigned long) __entry->ino,
1224  __entry->pos, __entry->len, __entry->rw)
1225 );
1226 
1227 TRACE_EVENT(ext4_direct_IO_exit,
1228  TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1229  int rw, int ret),
1230 
1231  TP_ARGS(inode, offset, len, rw, ret),
1232 
1234  __field( dev_t, dev )
1235  __field( ino_t, ino )
1236  __field( loff_t, pos )
1237  __field( unsigned long, len )
1238  __field( int, rw )
1239  __field( int, ret )
1240  ),
1241 
1243  __entry->dev = inode->i_sb->s_dev;
1244  __entry->ino = inode->i_ino;
1245  __entry->pos = offset;
1246  __entry->len = len;
1247  __entry->rw = rw;
1248  __entry->ret = ret;
1249  ),
1250 
1251  TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
1252  MAJOR(__entry->dev), MINOR(__entry->dev),
1253  (unsigned long) __entry->ino,
1254  __entry->pos, __entry->len,
1255  __entry->rw, __entry->ret)
1256 );
1257 
1258 TRACE_EVENT(ext4_fallocate_enter,
1259  TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1260 
1261  TP_ARGS(inode, offset, len, mode),
1262 
1264  __field( dev_t, dev )
1265  __field( ino_t, ino )
1266  __field( loff_t, pos )
1267  __field( loff_t, len )
1268  __field( int, mode )
1269  ),
1270 
1272  __entry->dev = inode->i_sb->s_dev;
1273  __entry->ino = inode->i_ino;
1274  __entry->pos = offset;
1275  __entry->len = len;
1276  __entry->mode = mode;
1277  ),
1278 
1279  TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
1280  MAJOR(__entry->dev), MINOR(__entry->dev),
1281  (unsigned long) __entry->ino, __entry->pos,
1282  __entry->len, __entry->mode)
1283 );
1284 
1285 TRACE_EVENT(ext4_fallocate_exit,
1286  TP_PROTO(struct inode *inode, loff_t offset,
1287  unsigned int max_blocks, int ret),
1288 
1289  TP_ARGS(inode, offset, max_blocks, ret),
1290 
1292  __field( dev_t, dev )
1293  __field( ino_t, ino )
1294  __field( loff_t, pos )
1295  __field( unsigned int, blocks )
1296  __field( int, ret )
1297  ),
1298 
1300  __entry->dev = inode->i_sb->s_dev;
1301  __entry->ino = inode->i_ino;
1302  __entry->pos = offset;
1303  __entry->blocks = max_blocks;
1304  __entry->ret = ret;
1305  ),
1306 
1307  TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
1308  MAJOR(__entry->dev), MINOR(__entry->dev),
1309  (unsigned long) __entry->ino,
1310  __entry->pos, __entry->blocks,
1311  __entry->ret)
1312 );
1313 
1314 TRACE_EVENT(ext4_unlink_enter,
1315  TP_PROTO(struct inode *parent, struct dentry *dentry),
1316 
1317  TP_ARGS(parent, dentry),
1318 
1320  __field( dev_t, dev )
1321  __field( ino_t, ino )
1322  __field( ino_t, parent )
1323  __field( loff_t, size )
1324  ),
1325 
1327  __entry->dev = dentry->d_inode->i_sb->s_dev;
1328  __entry->ino = dentry->d_inode->i_ino;
1329  __entry->parent = parent->i_ino;
1330  __entry->size = dentry->d_inode->i_size;
1331  ),
1332 
1333  TP_printk("dev %d,%d ino %lu size %lld parent %lu",
1334  MAJOR(__entry->dev), MINOR(__entry->dev),
1335  (unsigned long) __entry->ino, __entry->size,
1336  (unsigned long) __entry->parent)
1337 );
1338 
1339 TRACE_EVENT(ext4_unlink_exit,
1340  TP_PROTO(struct dentry *dentry, int ret),
1341 
1342  TP_ARGS(dentry, ret),
1343 
1345  __field( dev_t, dev )
1346  __field( ino_t, ino )
1347  __field( int, ret )
1348  ),
1349 
1351  __entry->dev = dentry->d_inode->i_sb->s_dev;
1352  __entry->ino = dentry->d_inode->i_ino;
1353  __entry->ret = ret;
1354  ),
1355 
1356  TP_printk("dev %d,%d ino %lu ret %d",
1357  MAJOR(__entry->dev), MINOR(__entry->dev),
1358  (unsigned long) __entry->ino,
1359  __entry->ret)
1360 );
1361 
1362 DECLARE_EVENT_CLASS(ext4__truncate,
1363  TP_PROTO(struct inode *inode),
1364 
1365  TP_ARGS(inode),
1366 
1368  __field( dev_t, dev )
1369  __field( ino_t, ino )
1370  __field( __u64, blocks )
1371  ),
1372 
1374  __entry->dev = inode->i_sb->s_dev;
1375  __entry->ino = inode->i_ino;
1376  __entry->blocks = inode->i_blocks;
1377  ),
1378 
1379  TP_printk("dev %d,%d ino %lu blocks %llu",
1380  MAJOR(__entry->dev), MINOR(__entry->dev),
1381  (unsigned long) __entry->ino, __entry->blocks)
1382 );
1383 
1384 DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1385 
1386  TP_PROTO(struct inode *inode),
1387 
1388  TP_ARGS(inode)
1389 );
1390 
1391 DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1392 
1393  TP_PROTO(struct inode *inode),
1394 
1395  TP_ARGS(inode)
1396 );
1397 
1398 /* 'ux' is the uninitialized extent. */
1399 TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
1400  TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1401  struct ext4_extent *ux),
1402 
1403  TP_ARGS(inode, map, ux),
1404 
1406  __field( dev_t, dev )
1407  __field( ino_t, ino )
1408  __field( ext4_lblk_t, m_lblk )
1409  __field( unsigned, m_len )
1410  __field( ext4_lblk_t, u_lblk )
1411  __field( unsigned, u_len )
1412  __field( ext4_fsblk_t, u_pblk )
1413  ),
1414 
1416  __entry->dev = inode->i_sb->s_dev;
1417  __entry->ino = inode->i_ino;
1418  __entry->m_lblk = map->m_lblk;
1419  __entry->m_len = map->m_len;
1420  __entry->u_lblk = le32_to_cpu(ux->ee_block);
1421  __entry->u_len = ext4_ext_get_actual_len(ux);
1422  __entry->u_pblk = ext4_ext_pblock(ux);
1423  ),
1424 
1425  TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1426  "u_pblk %llu",
1427  MAJOR(__entry->dev), MINOR(__entry->dev),
1428  (unsigned long) __entry->ino,
1429  __entry->m_lblk, __entry->m_len,
1430  __entry->u_lblk, __entry->u_len, __entry->u_pblk)
1431 );
1432 
1433 /*
1434  * 'ux' is the uninitialized extent.
1435  * 'ix' is the initialized extent to which blocks are transferred.
1436  */
1437 TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
1438  TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1439  struct ext4_extent *ux, struct ext4_extent *ix),
1440 
1441  TP_ARGS(inode, map, ux, ix),
1442 
1444  __field( dev_t, dev )
1445  __field( ino_t, ino )
1446  __field( ext4_lblk_t, m_lblk )
1447  __field( unsigned, m_len )
1448  __field( ext4_lblk_t, u_lblk )
1449  __field( unsigned, u_len )
1450  __field( ext4_fsblk_t, u_pblk )
1451  __field( ext4_lblk_t, i_lblk )
1452  __field( unsigned, i_len )
1453  __field( ext4_fsblk_t, i_pblk )
1454  ),
1455 
1457  __entry->dev = inode->i_sb->s_dev;
1458  __entry->ino = inode->i_ino;
1459  __entry->m_lblk = map->m_lblk;
1460  __entry->m_len = map->m_len;
1461  __entry->u_lblk = le32_to_cpu(ux->ee_block);
1462  __entry->u_len = ext4_ext_get_actual_len(ux);
1463  __entry->u_pblk = ext4_ext_pblock(ux);
1464  __entry->i_lblk = le32_to_cpu(ix->ee_block);
1465  __entry->i_len = ext4_ext_get_actual_len(ix);
1466  __entry->i_pblk = ext4_ext_pblock(ix);
1467  ),
1468 
1469  TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1470  "u_lblk %u u_len %u u_pblk %llu "
1471  "i_lblk %u i_len %u i_pblk %llu ",
1472  MAJOR(__entry->dev), MINOR(__entry->dev),
1473  (unsigned long) __entry->ino,
1474  __entry->m_lblk, __entry->m_len,
1475  __entry->u_lblk, __entry->u_len, __entry->u_pblk,
1476  __entry->i_lblk, __entry->i_len, __entry->i_pblk)
1477 );
1478 
1479 DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1480  TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1481  unsigned int len, unsigned int flags),
1482 
1483  TP_ARGS(inode, lblk, len, flags),
1484 
1486  __field( dev_t, dev )
1487  __field( ino_t, ino )
1488  __field( ext4_lblk_t, lblk )
1489  __field( unsigned int, len )
1490  __field( unsigned int, flags )
1491  ),
1492 
1494  __entry->dev = inode->i_sb->s_dev;
1495  __entry->ino = inode->i_ino;
1496  __entry->lblk = lblk;
1497  __entry->len = len;
1498  __entry->flags = flags;
1499  ),
1500 
1501  TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u",
1502  MAJOR(__entry->dev), MINOR(__entry->dev),
1503  (unsigned long) __entry->ino,
1504  __entry->lblk, __entry->len, __entry->flags)
1505 );
1506 
1507 DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1508  TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1509  unsigned len, unsigned flags),
1510 
1511  TP_ARGS(inode, lblk, len, flags)
1512 );
1513 
1514 DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1515  TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1516  unsigned len, unsigned flags),
1517 
1518  TP_ARGS(inode, lblk, len, flags)
1519 );
1520 
1521 DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1522  TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1523  ext4_fsblk_t pblk, unsigned int len, int ret),
1524 
1525  TP_ARGS(inode, lblk, pblk, len, ret),
1526 
1528  __field( dev_t, dev )
1529  __field( ino_t, ino )
1530  __field( ext4_fsblk_t, pblk )
1531  __field( ext4_lblk_t, lblk )
1532  __field( unsigned int, len )
1533  __field( int, ret )
1534  ),
1535 
1537  __entry->dev = inode->i_sb->s_dev;
1538  __entry->ino = inode->i_ino;
1539  __entry->pblk = pblk;
1540  __entry->lblk = lblk;
1541  __entry->len = len;
1542  __entry->ret = ret;
1543  ),
1544 
1545  TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d",
1546  MAJOR(__entry->dev), MINOR(__entry->dev),
1547  (unsigned long) __entry->ino,
1548  __entry->lblk, __entry->pblk,
1549  __entry->len, __entry->ret)
1550 );
1551 
1552 DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
1553  TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1554  ext4_fsblk_t pblk, unsigned len, int ret),
1555 
1556  TP_ARGS(inode, lblk, pblk, len, ret)
1557 );
1558 
1559 DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
1560  TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1561  ext4_fsblk_t pblk, unsigned len, int ret),
1562 
1563  TP_ARGS(inode, lblk, pblk, len, ret)
1564 );
1565 
1566 TRACE_EVENT(ext4_ext_load_extent,
1567  TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1568 
1569  TP_ARGS(inode, lblk, pblk),
1570 
1572  __field( dev_t, dev )
1573  __field( ino_t, ino )
1574  __field( ext4_fsblk_t, pblk )
1575  __field( ext4_lblk_t, lblk )
1576  ),
1577 
1579  __entry->dev = inode->i_sb->s_dev;
1580  __entry->ino = inode->i_ino;
1581  __entry->pblk = pblk;
1582  __entry->lblk = lblk;
1583  ),
1584 
1585  TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1586  MAJOR(__entry->dev), MINOR(__entry->dev),
1587  (unsigned long) __entry->ino,
1588  __entry->lblk, __entry->pblk)
1589 );
1590 
1591 TRACE_EVENT(ext4_load_inode,
1592  TP_PROTO(struct inode *inode),
1593 
1594  TP_ARGS(inode),
1595 
1597  __field( dev_t, dev )
1598  __field( ino_t, ino )
1599  ),
1600 
1602  __entry->dev = inode->i_sb->s_dev;
1603  __entry->ino = inode->i_ino;
1604  ),
1605 
1606  TP_printk("dev %d,%d ino %ld",
1607  MAJOR(__entry->dev), MINOR(__entry->dev),
1608  (unsigned long) __entry->ino)
1609 );
1610 
1611 TRACE_EVENT(ext4_journal_start,
1612  TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP),
1613 
1614  TP_ARGS(sb, nblocks, IP),
1615 
1617  __field( dev_t, dev )
1618  __field(unsigned long, ip )
1619  __field( int, nblocks )
1620  ),
1621 
1623  __entry->dev = sb->s_dev;
1624  __entry->ip = IP;
1625  __entry->nblocks = nblocks;
1626  ),
1627 
1628  TP_printk("dev %d,%d nblocks %d caller %pF",
1629  MAJOR(__entry->dev), MINOR(__entry->dev),
1630  __entry->nblocks, (void *)__entry->ip)
1631 );
1632 
1633 DECLARE_EVENT_CLASS(ext4__trim,
1634  TP_PROTO(struct super_block *sb,
1635  ext4_group_t group,
1636  ext4_grpblk_t start,
1637  ext4_grpblk_t len),
1638 
1639  TP_ARGS(sb, group, start, len),
1640 
1642  __field( int, dev_major )
1643  __field( int, dev_minor )
1644  __field( __u32, group )
1645  __field( int, start )
1646  __field( int, len )
1647  ),
1648 
1650  __entry->dev_major = MAJOR(sb->s_dev);
1651  __entry->dev_minor = MINOR(sb->s_dev);
1652  __entry->group = group;
1653  __entry->start = start;
1654  __entry->len = len;
1655  ),
1656 
1657  TP_printk("dev %d,%d group %u, start %d, len %d",
1658  __entry->dev_major, __entry->dev_minor,
1659  __entry->group, __entry->start, __entry->len)
1660 );
1661 
1662 DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1663 
1664  TP_PROTO(struct super_block *sb,
1665  ext4_group_t group,
1666  ext4_grpblk_t start,
1667  ext4_grpblk_t len),
1668 
1669  TP_ARGS(sb, group, start, len)
1670 );
1671 
1672 DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1673 
1674  TP_PROTO(struct super_block *sb,
1675  ext4_group_t group,
1676  ext4_grpblk_t start,
1677  ext4_grpblk_t len),
1678 
1679  TP_ARGS(sb, group, start, len)
1680 );
1681 
1682 TRACE_EVENT(ext4_ext_handle_uninitialized_extents,
1683  TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1684  unsigned int allocated, ext4_fsblk_t newblock),
1685 
1686  TP_ARGS(inode, map, allocated, newblock),
1687 
1689  __field( dev_t, dev )
1690  __field( ino_t, ino )
1691  __field( int, flags )
1692  __field( ext4_lblk_t, lblk )
1693  __field( ext4_fsblk_t, pblk )
1694  __field( unsigned int, len )
1695  __field( unsigned int, allocated )
1696  __field( ext4_fsblk_t, newblk )
1697  ),
1698 
1700  __entry->dev = inode->i_sb->s_dev;
1701  __entry->ino = inode->i_ino;
1702  __entry->flags = map->m_flags;
1703  __entry->lblk = map->m_lblk;
1704  __entry->pblk = map->m_pblk;
1705  __entry->len = map->m_len;
1706  __entry->allocated = allocated;
1707  __entry->newblk = newblock;
1708  ),
1709 
1710  TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %d"
1711  "allocated %d newblock %llu",
1712  MAJOR(__entry->dev), MINOR(__entry->dev),
1713  (unsigned long) __entry->ino,
1714  (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
1715  __entry->len, __entry->flags,
1716  (unsigned int) __entry->allocated,
1717  (unsigned long long) __entry->newblk)
1718 );
1719 
1720 TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1721  TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1722 
1723  TP_ARGS(sb, map, ret),
1724 
1726  __field( dev_t, dev )
1727  __field( unsigned int, flags )
1728  __field( ext4_lblk_t, lblk )
1729  __field( ext4_fsblk_t, pblk )
1730  __field( unsigned int, len )
1731  __field( int, ret )
1732  ),
1733 
1735  __entry->dev = sb->s_dev;
1736  __entry->flags = map->m_flags;
1737  __entry->lblk = map->m_lblk;
1738  __entry->pblk = map->m_pblk;
1739  __entry->len = map->m_len;
1740  __entry->ret = ret;
1741  ),
1742 
1743  TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %u ret %d",
1744  MAJOR(__entry->dev), MINOR(__entry->dev),
1745  __entry->lblk, (unsigned long long) __entry->pblk,
1746  __entry->len, __entry->flags, __entry->ret)
1747 );
1748 
1749 TRACE_EVENT(ext4_ext_put_in_cache,
1750  TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1751  ext4_fsblk_t start),
1752 
1753  TP_ARGS(inode, lblk, len, start),
1754 
1756  __field( dev_t, dev )
1757  __field( ino_t, ino )
1758  __field( ext4_lblk_t, lblk )
1759  __field( unsigned int, len )
1760  __field( ext4_fsblk_t, start )
1761  ),
1762 
1764  __entry->dev = inode->i_sb->s_dev;
1765  __entry->ino = inode->i_ino;
1766  __entry->lblk = lblk;
1767  __entry->len = len;
1768  __entry->start = start;
1769  ),
1770 
1771  TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1772  MAJOR(__entry->dev), MINOR(__entry->dev),
1773  (unsigned long) __entry->ino,
1774  (unsigned) __entry->lblk,
1775  __entry->len,
1776  (unsigned long long) __entry->start)
1777 );
1778 
1779 TRACE_EVENT(ext4_ext_in_cache,
1780  TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1781 
1782  TP_ARGS(inode, lblk, ret),
1783 
1785  __field( dev_t, dev )
1786  __field( ino_t, ino )
1787  __field( ext4_lblk_t, lblk )
1788  __field( int, ret )
1789  ),
1790 
1792  __entry->dev = inode->i_sb->s_dev;
1793  __entry->ino = inode->i_ino;
1794  __entry->lblk = lblk;
1795  __entry->ret = ret;
1796  ),
1797 
1798  TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1799  MAJOR(__entry->dev), MINOR(__entry->dev),
1800  (unsigned long) __entry->ino,
1801  (unsigned) __entry->lblk,
1802  __entry->ret)
1803 
1804 );
1805 
1806 TRACE_EVENT(ext4_find_delalloc_range,
1807  TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1808  int reverse, int found, ext4_lblk_t found_blk),
1809 
1810  TP_ARGS(inode, from, to, reverse, found, found_blk),
1811 
1813  __field( dev_t, dev )
1814  __field( ino_t, ino )
1815  __field( ext4_lblk_t, from )
1816  __field( ext4_lblk_t, to )
1817  __field( int, reverse )
1818  __field( int, found )
1819  __field( ext4_lblk_t, found_blk )
1820  ),
1821 
1823  __entry->dev = inode->i_sb->s_dev;
1824  __entry->ino = inode->i_ino;
1825  __entry->from = from;
1826  __entry->to = to;
1827  __entry->reverse = reverse;
1828  __entry->found = found;
1829  __entry->found_blk = found_blk;
1830  ),
1831 
1832  TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1833  "(blk = %u)",
1834  MAJOR(__entry->dev), MINOR(__entry->dev),
1835  (unsigned long) __entry->ino,
1836  (unsigned) __entry->from, (unsigned) __entry->to,
1837  __entry->reverse, __entry->found,
1838  (unsigned) __entry->found_blk)
1839 );
1840 
1841 TRACE_EVENT(ext4_get_reserved_cluster_alloc,
1842  TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
1843 
1844  TP_ARGS(inode, lblk, len),
1845 
1847  __field( dev_t, dev )
1848  __field( ino_t, ino )
1849  __field( ext4_lblk_t, lblk )
1850  __field( unsigned int, len )
1851  ),
1852 
1854  __entry->dev = inode->i_sb->s_dev;
1855  __entry->ino = inode->i_ino;
1856  __entry->lblk = lblk;
1857  __entry->len = len;
1858  ),
1859 
1860  TP_printk("dev %d,%d ino %lu lblk %u len %u",
1861  MAJOR(__entry->dev), MINOR(__entry->dev),
1862  (unsigned long) __entry->ino,
1863  (unsigned) __entry->lblk,
1864  __entry->len)
1865 );
1866 
1867 TRACE_EVENT(ext4_ext_show_extent,
1868  TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
1869  unsigned short len),
1870 
1871  TP_ARGS(inode, lblk, pblk, len),
1872 
1874  __field( dev_t, dev )
1875  __field( ino_t, ino )
1876  __field( ext4_fsblk_t, pblk )
1877  __field( ext4_lblk_t, lblk )
1878  __field( unsigned short, len )
1879  ),
1880 
1882  __entry->dev = inode->i_sb->s_dev;
1883  __entry->ino = inode->i_ino;
1884  __entry->pblk = pblk;
1885  __entry->lblk = lblk;
1886  __entry->len = len;
1887  ),
1888 
1889  TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
1890  MAJOR(__entry->dev), MINOR(__entry->dev),
1891  (unsigned long) __entry->ino,
1892  (unsigned) __entry->lblk,
1893  (unsigned long long) __entry->pblk,
1894  (unsigned short) __entry->len)
1895 );
1896 
1897 TRACE_EVENT(ext4_remove_blocks,
1898  TP_PROTO(struct inode *inode, struct ext4_extent *ex,
1899  ext4_lblk_t from, ext4_fsblk_t to,
1900  ext4_fsblk_t partial_cluster),
1901 
1902  TP_ARGS(inode, ex, from, to, partial_cluster),
1903 
1905  __field( dev_t, dev )
1906  __field( ino_t, ino )
1907  __field( ext4_lblk_t, from )
1908  __field( ext4_lblk_t, to )
1909  __field( ext4_fsblk_t, partial )
1910  __field( ext4_fsblk_t, ee_pblk )
1911  __field( ext4_lblk_t, ee_lblk )
1912  __field( unsigned short, ee_len )
1913  ),
1914 
1916  __entry->dev = inode->i_sb->s_dev;
1917  __entry->ino = inode->i_ino;
1918  __entry->from = from;
1919  __entry->to = to;
1920  __entry->partial = partial_cluster;
1921  __entry->ee_pblk = ext4_ext_pblock(ex);
1922  __entry->ee_lblk = cpu_to_le32(ex->ee_block);
1923  __entry->ee_len = ext4_ext_get_actual_len(ex);
1924  ),
1925 
1926  TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
1927  "from %u to %u partial_cluster %u",
1928  MAJOR(__entry->dev), MINOR(__entry->dev),
1929  (unsigned long) __entry->ino,
1930  (unsigned) __entry->ee_lblk,
1931  (unsigned long long) __entry->ee_pblk,
1932  (unsigned short) __entry->ee_len,
1933  (unsigned) __entry->from,
1934  (unsigned) __entry->to,
1935  (unsigned) __entry->partial)
1936 );
1937 
1938 TRACE_EVENT(ext4_ext_rm_leaf,
1939  TP_PROTO(struct inode *inode, ext4_lblk_t start,
1940  struct ext4_extent *ex, ext4_fsblk_t partial_cluster),
1941 
1942  TP_ARGS(inode, start, ex, partial_cluster),
1943 
1945  __field( dev_t, dev )
1946  __field( ino_t, ino )
1947  __field( ext4_fsblk_t, partial )
1948  __field( ext4_lblk_t, start )
1949  __field( ext4_lblk_t, ee_lblk )
1950  __field( ext4_fsblk_t, ee_pblk )
1951  __field( short, ee_len )
1952  ),
1953 
1955  __entry->dev = inode->i_sb->s_dev;
1956  __entry->ino = inode->i_ino;
1957  __entry->partial = partial_cluster;
1958  __entry->start = start;
1959  __entry->ee_lblk = le32_to_cpu(ex->ee_block);
1960  __entry->ee_pblk = ext4_ext_pblock(ex);
1961  __entry->ee_len = ext4_ext_get_actual_len(ex);
1962  ),
1963 
1964  TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
1965  "partial_cluster %u",
1966  MAJOR(__entry->dev), MINOR(__entry->dev),
1967  (unsigned long) __entry->ino,
1968  (unsigned) __entry->start,
1969  (unsigned) __entry->ee_lblk,
1970  (unsigned long long) __entry->ee_pblk,
1971  (unsigned short) __entry->ee_len,
1972  (unsigned) __entry->partial)
1973 );
1974 
1975 TRACE_EVENT(ext4_ext_rm_idx,
1976  TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
1977 
1978  TP_ARGS(inode, pblk),
1979 
1981  __field( dev_t, dev )
1982  __field( ino_t, ino )
1983  __field( ext4_fsblk_t, pblk )
1984  ),
1985 
1987  __entry->dev = inode->i_sb->s_dev;
1988  __entry->ino = inode->i_ino;
1989  __entry->pblk = pblk;
1990  ),
1991 
1992  TP_printk("dev %d,%d ino %lu index_pblk %llu",
1993  MAJOR(__entry->dev), MINOR(__entry->dev),
1994  (unsigned long) __entry->ino,
1995  (unsigned long long) __entry->pblk)
1996 );
1997 
1998 TRACE_EVENT(ext4_ext_remove_space,
1999  TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth),
2000 
2001  TP_ARGS(inode, start, depth),
2002 
2004  __field( dev_t, dev )
2005  __field( ino_t, ino )
2006  __field( ext4_lblk_t, start )
2007  __field( int, depth )
2008  ),
2009 
2011  __entry->dev = inode->i_sb->s_dev;
2012  __entry->ino = inode->i_ino;
2013  __entry->start = start;
2014  __entry->depth = depth;
2015  ),
2016 
2017  TP_printk("dev %d,%d ino %lu since %u depth %d",
2018  MAJOR(__entry->dev), MINOR(__entry->dev),
2019  (unsigned long) __entry->ino,
2020  (unsigned) __entry->start,
2021  __entry->depth)
2022 );
2023 
2024 TRACE_EVENT(ext4_ext_remove_space_done,
2025  TP_PROTO(struct inode *inode, ext4_lblk_t start, int depth,
2026  ext4_lblk_t partial, unsigned short eh_entries),
2027 
2028  TP_ARGS(inode, start, depth, partial, eh_entries),
2029 
2031  __field( dev_t, dev )
2032  __field( ino_t, ino )
2033  __field( ext4_lblk_t, start )
2034  __field( int, depth )
2035  __field( ext4_lblk_t, partial )
2036  __field( unsigned short, eh_entries )
2037  ),
2038 
2040  __entry->dev = inode->i_sb->s_dev;
2041  __entry->ino = inode->i_ino;
2042  __entry->start = start;
2043  __entry->depth = depth;
2044  __entry->partial = partial;
2045  __entry->eh_entries = eh_entries;
2046  ),
2047 
2048  TP_printk("dev %d,%d ino %lu since %u depth %d partial %u "
2049  "remaining_entries %u",
2050  MAJOR(__entry->dev), MINOR(__entry->dev),
2051  (unsigned long) __entry->ino,
2052  (unsigned) __entry->start,
2053  __entry->depth,
2054  (unsigned) __entry->partial,
2055  (unsigned short) __entry->eh_entries)
2056 );
2057 
2058 #endif /* _TRACE_EXT4_H */
2059 
2060 /* This part must be outside protection */
2061 #include <trace/define_trace.h>