f4c62d330774c817a8c9fa25d83dc43356c68651
[sfrench/cifs-2.6.git] / include / trace / events / ext4.h
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
10 struct ext4_allocation_context;
11 struct ext4_allocation_request;
12 struct ext4_prealloc_space;
13 struct ext4_inode_info;
14 struct mpage_da_data;
15
16 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
17
18 TRACE_EVENT(ext4_free_inode,
19         TP_PROTO(struct inode *inode),
20
21         TP_ARGS(inode),
22
23         TP_STRUCT__entry(
24                 __field(        dev_t,  dev                     )
25                 __field(        ino_t,  ino                     )
26                 __field(        umode_t, mode                   )
27                 __field(        uid_t,  uid                     )
28                 __field(        gid_t,  gid                     )
29                 __field(        blkcnt_t, blocks                )
30         ),
31
32         TP_fast_assign(
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;
39         ),
40
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)
45 );
46
47 TRACE_EVENT(ext4_request_inode,
48         TP_PROTO(struct inode *dir, int mode),
49
50         TP_ARGS(dir, mode),
51
52         TP_STRUCT__entry(
53                 __field(        dev_t,  dev                     )
54                 __field(        ino_t,  dir                     )
55                 __field(        umode_t, mode                   )
56         ),
57
58         TP_fast_assign(
59                 __entry->dev    = dir->i_sb->s_dev;
60                 __entry->dir    = dir->i_ino;
61                 __entry->mode   = mode;
62         ),
63
64         TP_printk("dev %s dir %lu mode 0%o",
65                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->dir,
66                   __entry->mode)
67 );
68
69 TRACE_EVENT(ext4_allocate_inode,
70         TP_PROTO(struct inode *inode, struct inode *dir, int mode),
71
72         TP_ARGS(inode, dir, mode),
73
74         TP_STRUCT__entry(
75                 __field(        dev_t,  dev                     )
76                 __field(        ino_t,  ino                     )
77                 __field(        ino_t,  dir                     )
78                 __field(        umode_t, mode                   )
79         ),
80
81         TP_fast_assign(
82                 __entry->dev    = inode->i_sb->s_dev;
83                 __entry->ino    = inode->i_ino;
84                 __entry->dir    = dir->i_ino;
85                 __entry->mode   = mode;
86         ),
87
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)
91 );
92
93 TRACE_EVENT(ext4_write_begin,
94
95         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
96                  unsigned int flags),
97
98         TP_ARGS(inode, pos, len, flags),
99
100         TP_STRUCT__entry(
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             )
106         ),
107
108         TP_fast_assign(
109                 __entry->dev    = inode->i_sb->s_dev;
110                 __entry->ino    = inode->i_ino;
111                 __entry->pos    = pos;
112                 __entry->len    = len;
113                 __entry->flags  = flags;
114         ),
115
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)
119 );
120
121 TRACE_EVENT(ext4_ordered_write_end,
122         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
123                         unsigned int copied),
124
125         TP_ARGS(inode, pos, len, copied),
126
127         TP_STRUCT__entry(
128                 __field(        dev_t,  dev                     )
129                 __field(        ino_t,  ino                     )
130                 __field(        loff_t, pos                     )
131                 __field(        unsigned int, len               )
132                 __field(        unsigned int, copied            )
133         ),
134
135         TP_fast_assign(
136                 __entry->dev    = inode->i_sb->s_dev;
137                 __entry->ino    = inode->i_ino;
138                 __entry->pos    = pos;
139                 __entry->len    = len;
140                 __entry->copied = copied;
141         ),
142
143         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
144                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
145                   __entry->pos, __entry->len, __entry->copied)
146 );
147
148 TRACE_EVENT(ext4_writeback_write_end,
149         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
150                  unsigned int copied),
151
152         TP_ARGS(inode, pos, len, copied),
153
154         TP_STRUCT__entry(
155                 __field(        dev_t,  dev                     )
156                 __field(        ino_t,  ino                     )
157                 __field(        loff_t, pos                     )
158                 __field(        unsigned int, len               )
159                 __field(        unsigned int, copied            )
160         ),
161
162         TP_fast_assign(
163                 __entry->dev    = inode->i_sb->s_dev;
164                 __entry->ino    = inode->i_ino;
165                 __entry->pos    = pos;
166                 __entry->len    = len;
167                 __entry->copied = copied;
168         ),
169
170         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
171                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
172                   __entry->pos, __entry->len, __entry->copied)
173 );
174
175 TRACE_EVENT(ext4_journalled_write_end,
176         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
177                  unsigned int copied),
178         TP_ARGS(inode, pos, len, copied),
179
180         TP_STRUCT__entry(
181                 __field(        dev_t,  dev                     )
182                 __field(        ino_t,  ino                     )
183                 __field(        loff_t, pos                     )
184                 __field(        unsigned int, len               )
185                 __field(        unsigned int, copied            )
186         ),
187
188         TP_fast_assign(
189                 __entry->dev    = inode->i_sb->s_dev;
190                 __entry->ino    = inode->i_ino;
191                 __entry->pos    = pos;
192                 __entry->len    = len;
193                 __entry->copied = copied;
194         ),
195
196         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
197                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
198                   __entry->pos, __entry->len, __entry->copied)
199 );
200
201 TRACE_EVENT(ext4_writepage,
202         TP_PROTO(struct inode *inode, struct page *page),
203
204         TP_ARGS(inode, page),
205
206         TP_STRUCT__entry(
207                 __field(        dev_t,  dev                     )
208                 __field(        ino_t,  ino                     )
209                 __field(        pgoff_t, index                  )
210
211         ),
212
213         TP_fast_assign(
214                 __entry->dev    = inode->i_sb->s_dev;
215                 __entry->ino    = inode->i_ino;
216                 __entry->index  = page->index;
217         ),
218
219         TP_printk("dev %s ino %lu page_index %lu",
220                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
221                   __entry->index)
222 );
223
224 TRACE_EVENT(ext4_da_writepages,
225         TP_PROTO(struct inode *inode, struct writeback_control *wbc),
226
227         TP_ARGS(inode, wbc),
228
229         TP_STRUCT__entry(
230                 __field(        dev_t,  dev                     )
231                 __field(        ino_t,  ino                     )
232                 __field(        long,   nr_to_write             )
233                 __field(        long,   pages_skipped           )
234                 __field(        loff_t, range_start             )
235                 __field(        loff_t, range_end               )
236                 __field(        char,   nonblocking             )
237                 __field(        char,   for_kupdate             )
238                 __field(        char,   for_reclaim             )
239                 __field(        char,   range_cyclic            )
240                 __field(       pgoff_t, writeback_index         )
241         ),
242
243         TP_fast_assign(
244                 __entry->dev            = inode->i_sb->s_dev;
245                 __entry->ino            = inode->i_ino;
246                 __entry->nr_to_write    = wbc->nr_to_write;
247                 __entry->pages_skipped  = wbc->pages_skipped;
248                 __entry->range_start    = wbc->range_start;
249                 __entry->range_end      = wbc->range_end;
250                 __entry->nonblocking    = wbc->nonblocking;
251                 __entry->for_kupdate    = wbc->for_kupdate;
252                 __entry->for_reclaim    = wbc->for_reclaim;
253                 __entry->range_cyclic   = wbc->range_cyclic;
254                 __entry->writeback_index = inode->i_mapping->writeback_index;
255         ),
256
257         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",
258                   jbd2_dev_to_name(__entry->dev),
259                   (unsigned long) __entry->ino, __entry->nr_to_write,
260                   __entry->pages_skipped, __entry->range_start,
261                   __entry->range_end, __entry->nonblocking,
262                   __entry->for_kupdate, __entry->for_reclaim,
263                   __entry->range_cyclic,
264                   (unsigned long) __entry->writeback_index)
265 );
266
267 TRACE_EVENT(ext4_da_write_pages,
268         TP_PROTO(struct inode *inode, struct mpage_da_data *mpd),
269
270         TP_ARGS(inode, mpd),
271
272         TP_STRUCT__entry(
273                 __field(        dev_t,  dev                     )
274                 __field(        ino_t,  ino                     )
275                 __field(        __u64,  b_blocknr               )
276                 __field(        __u32,  b_size                  )
277                 __field(        __u32,  b_state                 )
278                 __field(        unsigned long,  first_page      )
279                 __field(        int,    io_done                 )
280                 __field(        int,    pages_written           )
281         ),
282
283         TP_fast_assign(
284                 __entry->dev            = inode->i_sb->s_dev;
285                 __entry->ino            = inode->i_ino;
286                 __entry->b_blocknr      = mpd->b_blocknr;
287                 __entry->b_size         = mpd->b_size;
288                 __entry->b_state        = mpd->b_state;
289                 __entry->first_page     = mpd->first_page;
290                 __entry->io_done        = mpd->io_done;
291                 __entry->pages_written  = mpd->pages_written;
292         ),
293
294         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",
295                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
296                   __entry->b_blocknr, __entry->b_size,
297                   __entry->b_state, __entry->first_page,
298                   __entry->io_done, __entry->pages_written)
299 );
300
301 TRACE_EVENT(ext4_da_writepages_result,
302         TP_PROTO(struct inode *inode, struct writeback_control *wbc,
303                         int ret, int pages_written),
304
305         TP_ARGS(inode, wbc, ret, pages_written),
306
307         TP_STRUCT__entry(
308                 __field(        dev_t,  dev                     )
309                 __field(        ino_t,  ino                     )
310                 __field(        int,    ret                     )
311                 __field(        int,    pages_written           )
312                 __field(        long,   pages_skipped           )
313                 __field(        char,   more_io                 )       
314                 __field(        char,   no_nrwrite_index_update )
315                 __field(       pgoff_t, writeback_index         )
316         ),
317
318         TP_fast_assign(
319                 __entry->dev            = inode->i_sb->s_dev;
320                 __entry->ino            = inode->i_ino;
321                 __entry->ret            = ret;
322                 __entry->pages_written  = pages_written;
323                 __entry->pages_skipped  = wbc->pages_skipped;
324                 __entry->more_io        = wbc->more_io;
325                 __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update;
326                 __entry->writeback_index = inode->i_mapping->writeback_index;
327         ),
328
329         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",
330                   jbd2_dev_to_name(__entry->dev),
331                   (unsigned long) __entry->ino, __entry->ret,
332                   __entry->pages_written, __entry->pages_skipped,
333                   __entry->more_io,
334                   __entry->no_nrwrite_index_update,
335                   (unsigned long) __entry->writeback_index)
336 );
337
338 TRACE_EVENT(ext4_da_write_begin,
339         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
340                         unsigned int flags),
341
342         TP_ARGS(inode, pos, len, flags),
343
344         TP_STRUCT__entry(
345                 __field(        dev_t,  dev                     )
346                 __field(        ino_t,  ino                     )
347                 __field(        loff_t, pos                     )
348                 __field(        unsigned int, len               )
349                 __field(        unsigned int, flags             )
350         ),
351
352         TP_fast_assign(
353                 __entry->dev    = inode->i_sb->s_dev;
354                 __entry->ino    = inode->i_ino;
355                 __entry->pos    = pos;
356                 __entry->len    = len;
357                 __entry->flags  = flags;
358         ),
359
360         TP_printk("dev %s ino %lu pos %llu len %u flags %u",
361                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
362                   __entry->pos, __entry->len, __entry->flags)
363 );
364
365 TRACE_EVENT(ext4_da_write_end,
366         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
367                         unsigned int copied),
368
369         TP_ARGS(inode, pos, len, copied),
370
371         TP_STRUCT__entry(
372                 __field(        dev_t,  dev                     )
373                 __field(        ino_t,  ino                     )
374                 __field(        loff_t, pos                     )
375                 __field(        unsigned int, len               )
376                 __field(        unsigned int, copied            )
377         ),
378
379         TP_fast_assign(
380                 __entry->dev    = inode->i_sb->s_dev;
381                 __entry->ino    = inode->i_ino;
382                 __entry->pos    = pos;
383                 __entry->len    = len;
384                 __entry->copied = copied;
385         ),
386
387         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
388                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
389                   __entry->pos, __entry->len, __entry->copied)
390 );
391
392 TRACE_EVENT(ext4_discard_blocks,
393         TP_PROTO(struct super_block *sb, unsigned long long blk,
394                         unsigned long long count),
395
396         TP_ARGS(sb, blk, count),
397
398         TP_STRUCT__entry(
399                 __field(        dev_t,  dev                     )
400                 __field(        __u64,  blk                     )
401                 __field(        __u64,  count                   )
402
403         ),
404
405         TP_fast_assign(
406                 __entry->dev    = sb->s_dev;
407                 __entry->blk    = blk;
408                 __entry->count  = count;
409         ),
410
411         TP_printk("dev %s blk %llu count %llu",
412                   jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count)
413 );
414
415 TRACE_EVENT(ext4_mb_new_inode_pa,
416         TP_PROTO(struct ext4_allocation_context *ac,
417                  struct ext4_prealloc_space *pa),
418
419         TP_ARGS(ac, pa),
420
421         TP_STRUCT__entry(
422                 __field(        dev_t,  dev                     )
423                 __field(        ino_t,  ino                     )
424                 __field(        __u64,  pa_pstart               )
425                 __field(        __u32,  pa_len                  )
426                 __field(        __u64,  pa_lstart               )
427
428         ),
429
430         TP_fast_assign(
431                 __entry->dev            = ac->ac_sb->s_dev;
432                 __entry->ino            = ac->ac_inode->i_ino;
433                 __entry->pa_pstart      = pa->pa_pstart;
434                 __entry->pa_len         = pa->pa_len;
435                 __entry->pa_lstart      = pa->pa_lstart;
436         ),
437
438         TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
439                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
440                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
441 );
442
443 TRACE_EVENT(ext4_mb_new_group_pa,
444         TP_PROTO(struct ext4_allocation_context *ac,
445                  struct ext4_prealloc_space *pa),
446
447         TP_ARGS(ac, pa),
448
449         TP_STRUCT__entry(
450                 __field(        dev_t,  dev                     )
451                 __field(        ino_t,  ino                     )
452                 __field(        __u64,  pa_pstart               )
453                 __field(        __u32,  pa_len                  )
454                 __field(        __u64,  pa_lstart               )
455
456         ),
457
458         TP_fast_assign(
459                 __entry->dev            = ac->ac_sb->s_dev;
460                 __entry->ino            = ac->ac_inode->i_ino;
461                 __entry->pa_pstart      = pa->pa_pstart;
462                 __entry->pa_len         = pa->pa_len;
463                 __entry->pa_lstart      = pa->pa_lstart;
464         ),
465
466         TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
467                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
468                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
469 );
470
471 TRACE_EVENT(ext4_mb_release_inode_pa,
472         TP_PROTO(struct ext4_allocation_context *ac,
473                  struct ext4_prealloc_space *pa,
474                  unsigned long long block, unsigned int count),
475
476         TP_ARGS(ac, pa, block, count),
477
478         TP_STRUCT__entry(
479                 __field(        dev_t,  dev                     )
480                 __field(        ino_t,  ino                     )
481                 __field(        __u64,  block                   )
482                 __field(        __u32,  count                   )
483
484         ),
485
486         TP_fast_assign(
487                 __entry->dev            = ac->ac_sb->s_dev;
488                 __entry->ino            = ac->ac_inode->i_ino;
489                 __entry->block          = block;
490                 __entry->count          = count;
491         ),
492
493         TP_printk("dev %s ino %lu block %llu count %u",
494                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
495                   __entry->block, __entry->count)
496 );
497
498 TRACE_EVENT(ext4_mb_release_group_pa,
499         TP_PROTO(struct ext4_allocation_context *ac,
500                  struct ext4_prealloc_space *pa),
501
502         TP_ARGS(ac, pa),
503
504         TP_STRUCT__entry(
505                 __field(        dev_t,  dev                     )
506                 __field(        ino_t,  ino                     )
507                 __field(        __u64,  pa_pstart               )
508                 __field(        __u32,  pa_len                  )
509
510         ),
511
512         TP_fast_assign(
513                 __entry->dev            = ac->ac_sb->s_dev;
514                 __entry->ino            = ac->ac_inode->i_ino;
515                 __entry->pa_pstart      = pa->pa_pstart;
516                 __entry->pa_len         = pa->pa_len;
517         ),
518
519         TP_printk("dev %s pstart %llu len %u",
520                   jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len)
521 );
522
523 TRACE_EVENT(ext4_discard_preallocations,
524         TP_PROTO(struct inode *inode),
525
526         TP_ARGS(inode),
527
528         TP_STRUCT__entry(
529                 __field(        dev_t,  dev                     )
530                 __field(        ino_t,  ino                     )
531
532         ),
533
534         TP_fast_assign(
535                 __entry->dev    = inode->i_sb->s_dev;
536                 __entry->ino    = inode->i_ino;
537         ),
538
539         TP_printk("dev %s ino %lu",
540                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino)
541 );
542
543 TRACE_EVENT(ext4_mb_discard_preallocations,
544         TP_PROTO(struct super_block *sb, int needed),
545
546         TP_ARGS(sb, needed),
547
548         TP_STRUCT__entry(
549                 __field(        dev_t,  dev                     )
550                 __field(        int,    needed                  )
551
552         ),
553
554         TP_fast_assign(
555                 __entry->dev    = sb->s_dev;
556                 __entry->needed = needed;
557         ),
558
559         TP_printk("dev %s needed %d",
560                   jbd2_dev_to_name(__entry->dev), __entry->needed)
561 );
562
563 TRACE_EVENT(ext4_request_blocks,
564         TP_PROTO(struct ext4_allocation_request *ar),
565
566         TP_ARGS(ar),
567
568         TP_STRUCT__entry(
569                 __field(        dev_t,  dev                     )
570                 __field(        ino_t,  ino                     )
571                 __field(        unsigned int, flags             )
572                 __field(        unsigned int, len               )
573                 __field(        __u64,  logical                 )
574                 __field(        __u64,  goal                    )
575                 __field(        __u64,  lleft                   )
576                 __field(        __u64,  lright                  )
577                 __field(        __u64,  pleft                   )
578                 __field(        __u64,  pright                  )
579         ),
580
581         TP_fast_assign(
582                 __entry->dev    = ar->inode->i_sb->s_dev;
583                 __entry->ino    = ar->inode->i_ino;
584                 __entry->flags  = ar->flags;
585                 __entry->len    = ar->len;
586                 __entry->logical = ar->logical;
587                 __entry->goal   = ar->goal;
588                 __entry->lleft  = ar->lleft;
589                 __entry->lright = ar->lright;
590                 __entry->pleft  = ar->pleft;
591                 __entry->pright = ar->pright;
592         ),
593
594         TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
595                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
596                   __entry->flags, __entry->len,
597                   (unsigned long long) __entry->logical,
598                   (unsigned long long) __entry->goal,
599                   (unsigned long long) __entry->lleft,
600                   (unsigned long long) __entry->lright,
601                   (unsigned long long) __entry->pleft,
602                   (unsigned long long) __entry->pright)
603 );
604
605 TRACE_EVENT(ext4_allocate_blocks,
606         TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
607
608         TP_ARGS(ar, block),
609
610         TP_STRUCT__entry(
611                 __field(        dev_t,  dev                     )
612                 __field(        ino_t,  ino                     )
613                 __field(        __u64,  block                   )
614                 __field(        unsigned int, flags             )
615                 __field(        unsigned int, len               )
616                 __field(        __u64,  logical                 )
617                 __field(        __u64,  goal                    )
618                 __field(        __u64,  lleft                   )
619                 __field(        __u64,  lright                  )
620                 __field(        __u64,  pleft                   )
621                 __field(        __u64,  pright                  )
622         ),
623
624         TP_fast_assign(
625                 __entry->dev    = ar->inode->i_sb->s_dev;
626                 __entry->ino    = ar->inode->i_ino;
627                 __entry->block  = block;
628                 __entry->flags  = ar->flags;
629                 __entry->len    = ar->len;
630                 __entry->logical = ar->logical;
631                 __entry->goal   = ar->goal;
632                 __entry->lleft  = ar->lleft;
633                 __entry->lright = ar->lright;
634                 __entry->pleft  = ar->pleft;
635                 __entry->pright = ar->pright;
636         ),
637
638         TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
639                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
640                   __entry->flags, __entry->len, __entry->block,
641                   (unsigned long long) __entry->logical,
642                   (unsigned long long) __entry->goal,
643                   (unsigned long long) __entry->lleft,
644                   (unsigned long long) __entry->lright,
645                   (unsigned long long) __entry->pleft,
646                   (unsigned long long) __entry->pright)
647 );
648
649 TRACE_EVENT(ext4_free_blocks,
650         TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
651                  int flags),
652
653         TP_ARGS(inode, block, count, flags),
654
655         TP_STRUCT__entry(
656                 __field(        dev_t,  dev                     )
657                 __field(        ino_t,  ino                     )
658                 __field(      umode_t, mode                     )
659                 __field(        __u64,  block                   )
660                 __field(        unsigned long,  count           )
661                 __field(         int,   flags                   )
662         ),
663
664         TP_fast_assign(
665                 __entry->dev            = inode->i_sb->s_dev;
666                 __entry->ino            = inode->i_ino;
667                 __entry->mode           = inode->i_mode;
668                 __entry->block          = block;
669                 __entry->count          = count;
670                 __entry->flags          = flags;
671         ),
672
673         TP_printk("dev %s ino %lu mode 0%o block %llu count %lu flags %d",
674                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
675                   __entry->mode, __entry->block, __entry->count,
676                   __entry->flags)
677 );
678
679 TRACE_EVENT(ext4_sync_file,
680         TP_PROTO(struct file *file, struct dentry *dentry, int datasync),
681
682         TP_ARGS(file, dentry, datasync),
683
684         TP_STRUCT__entry(
685                 __field(        dev_t,  dev                     )
686                 __field(        ino_t,  ino                     )
687                 __field(        ino_t,  parent                  )
688                 __field(        int,    datasync                )
689         ),
690
691         TP_fast_assign(
692                 __entry->dev            = dentry->d_inode->i_sb->s_dev;
693                 __entry->ino            = dentry->d_inode->i_ino;
694                 __entry->datasync       = datasync;
695                 __entry->parent         = dentry->d_parent->d_inode->i_ino;
696         ),
697
698         TP_printk("dev %s ino %ld parent %ld datasync %d ",
699                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
700                   (unsigned long) __entry->parent, __entry->datasync)
701 );
702
703 TRACE_EVENT(ext4_sync_fs,
704         TP_PROTO(struct super_block *sb, int wait),
705
706         TP_ARGS(sb, wait),
707
708         TP_STRUCT__entry(
709                 __field(        dev_t,  dev                     )
710                 __field(        int,    wait                    )
711
712         ),
713
714         TP_fast_assign(
715                 __entry->dev    = sb->s_dev;
716                 __entry->wait   = wait;
717         ),
718
719         TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry->dev),
720                   __entry->wait)
721 );
722
723 TRACE_EVENT(ext4_alloc_da_blocks,
724         TP_PROTO(struct inode *inode),
725
726         TP_ARGS(inode),
727
728         TP_STRUCT__entry(
729                 __field(        dev_t,  dev                     )
730                 __field(        ino_t,  ino                     )
731                 __field( unsigned int,  data_blocks     )
732                 __field( unsigned int,  meta_blocks     )
733         ),
734
735         TP_fast_assign(
736                 __entry->dev    = inode->i_sb->s_dev;
737                 __entry->ino    = inode->i_ino;
738                 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
739                 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
740         ),
741
742         TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u",
743                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
744                   __entry->data_blocks, __entry->meta_blocks)
745 );
746
747 TRACE_EVENT(ext4_mballoc_alloc,
748         TP_PROTO(struct ext4_allocation_context *ac),
749
750         TP_ARGS(ac),
751
752         TP_STRUCT__entry(
753                 __field(        dev_t,  dev                     )
754                 __field(        ino_t,  ino                     )
755                 __field(        __u16,  found                   )
756                 __field(        __u16,  groups                  )
757                 __field(        __u16,  buddy                   )
758                 __field(        __u16,  flags                   )
759                 __field(        __u16,  tail                    )
760                 __field(        __u8,   cr                      )
761                 __field(        __u32,  orig_logical            )
762                 __field(          int,  orig_start              )
763                 __field(        __u32,  orig_group              )
764                 __field(          int,  orig_len                )
765                 __field(        __u32,  goal_logical            )
766                 __field(          int,  goal_start              )
767                 __field(        __u32,  goal_group              )
768                 __field(          int,  goal_len                )
769                 __field(        __u32,  result_logical          )
770                 __field(          int,  result_start            )
771                 __field(        __u32,  result_group            )
772                 __field(          int,  result_len              )
773         ),
774
775         TP_fast_assign(
776                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
777                 __entry->ino            = ac->ac_inode->i_ino;
778                 __entry->found          = ac->ac_found;
779                 __entry->flags          = ac->ac_flags;
780                 __entry->groups         = ac->ac_groups_scanned;
781                 __entry->buddy          = ac->ac_buddy;
782                 __entry->tail           = ac->ac_tail;
783                 __entry->cr             = ac->ac_criteria;
784                 __entry->orig_logical   = ac->ac_o_ex.fe_logical;
785                 __entry->orig_start     = ac->ac_o_ex.fe_start;
786                 __entry->orig_group     = ac->ac_o_ex.fe_group;
787                 __entry->orig_len       = ac->ac_o_ex.fe_len;
788                 __entry->goal_logical   = ac->ac_g_ex.fe_logical;
789                 __entry->goal_start     = ac->ac_g_ex.fe_start;
790                 __entry->goal_group     = ac->ac_g_ex.fe_group;
791                 __entry->goal_len       = ac->ac_g_ex.fe_len;
792                 __entry->result_logical = ac->ac_f_ex.fe_logical;
793                 __entry->result_start   = ac->ac_f_ex.fe_start;
794                 __entry->result_group   = ac->ac_f_ex.fe_group;
795                 __entry->result_len     = ac->ac_f_ex.fe_len;
796         ),
797
798         TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
799                   "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
800                   "tail %u broken %u",
801                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
802                   __entry->orig_group, __entry->orig_start,
803                   __entry->orig_len, __entry->orig_logical,
804                   __entry->goal_group, __entry->goal_start,
805                   __entry->goal_len, __entry->goal_logical,
806                   __entry->result_group, __entry->result_start,
807                   __entry->result_len, __entry->result_logical,
808                   __entry->found, __entry->groups, __entry->cr,
809                   __entry->flags, __entry->tail,
810                   __entry->buddy ? 1 << __entry->buddy : 0)
811 );
812
813 TRACE_EVENT(ext4_mballoc_prealloc,
814         TP_PROTO(struct ext4_allocation_context *ac),
815
816         TP_ARGS(ac),
817
818         TP_STRUCT__entry(
819                 __field(        dev_t,  dev                     )
820                 __field(        ino_t,  ino                     )
821                 __field(        __u32,  orig_logical            )
822                 __field(          int,  orig_start              )
823                 __field(        __u32,  orig_group              )
824                 __field(          int,  orig_len                )
825                 __field(        __u32,  result_logical          )
826                 __field(          int,  result_start            )
827                 __field(        __u32,  result_group            )
828                 __field(          int,  result_len              )
829         ),
830
831         TP_fast_assign(
832                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
833                 __entry->ino            = ac->ac_inode->i_ino;
834                 __entry->orig_logical   = ac->ac_o_ex.fe_logical;
835                 __entry->orig_start     = ac->ac_o_ex.fe_start;
836                 __entry->orig_group     = ac->ac_o_ex.fe_group;
837                 __entry->orig_len       = ac->ac_o_ex.fe_len;
838                 __entry->result_logical = ac->ac_b_ex.fe_logical;
839                 __entry->result_start   = ac->ac_b_ex.fe_start;
840                 __entry->result_group   = ac->ac_b_ex.fe_group;
841                 __entry->result_len     = ac->ac_b_ex.fe_len;
842         ),
843
844         TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
845                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
846                   __entry->orig_group, __entry->orig_start,
847                   __entry->orig_len, __entry->orig_logical,
848                   __entry->result_group, __entry->result_start,
849                   __entry->result_len, __entry->result_logical)
850 );
851
852 TRACE_EVENT(ext4_mballoc_discard,
853         TP_PROTO(struct ext4_allocation_context *ac),
854
855         TP_ARGS(ac),
856
857         TP_STRUCT__entry(
858                 __field(        dev_t,  dev                     )
859                 __field(        ino_t,  ino                     )
860                 __field(        __u32,  result_logical          )
861                 __field(          int,  result_start            )
862                 __field(        __u32,  result_group            )
863                 __field(          int,  result_len              )
864         ),
865
866         TP_fast_assign(
867                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
868                 __entry->ino            = ac->ac_inode->i_ino;
869                 __entry->result_logical = ac->ac_b_ex.fe_logical;
870                 __entry->result_start   = ac->ac_b_ex.fe_start;
871                 __entry->result_group   = ac->ac_b_ex.fe_group;
872                 __entry->result_len     = ac->ac_b_ex.fe_len;
873         ),
874
875         TP_printk("dev %s inode %lu extent %u/%d/%u@%u ",
876                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
877                   __entry->result_group, __entry->result_start,
878                   __entry->result_len, __entry->result_logical)
879 );
880
881 TRACE_EVENT(ext4_mballoc_free,
882         TP_PROTO(struct ext4_allocation_context *ac),
883
884         TP_ARGS(ac),
885
886         TP_STRUCT__entry(
887                 __field(        dev_t,  dev                     )
888                 __field(        ino_t,  ino                     )
889                 __field(        __u32,  result_logical          )
890                 __field(          int,  result_start            )
891                 __field(        __u32,  result_group            )
892                 __field(          int,  result_len              )
893         ),
894
895         TP_fast_assign(
896                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
897                 __entry->ino            = ac->ac_inode->i_ino;
898                 __entry->result_logical = ac->ac_b_ex.fe_logical;
899                 __entry->result_start   = ac->ac_b_ex.fe_start;
900                 __entry->result_group   = ac->ac_b_ex.fe_group;
901                 __entry->result_len     = ac->ac_b_ex.fe_len;
902         ),
903
904         TP_printk("dev %s inode %lu extent %u/%d/%u@%u ",
905                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
906                   __entry->result_group, __entry->result_start,
907                   __entry->result_len, __entry->result_logical)
908 );
909
910 TRACE_EVENT(ext4_forget,
911         TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
912
913         TP_ARGS(inode, is_metadata, block),
914
915         TP_STRUCT__entry(
916                 __field(        dev_t,  dev                     )
917                 __field(        ino_t,  ino                     )
918                 __field(        umode_t, mode                   )
919                 __field(        int,    is_metadata             )
920                 __field(        __u64,  block                   )
921         ),
922
923         TP_fast_assign(
924                 __entry->dev    = inode->i_sb->s_dev;
925                 __entry->ino    = inode->i_ino;
926                 __entry->mode   = inode->i_mode;
927                 __entry->is_metadata = is_metadata;
928                 __entry->block  = block;
929         ),
930
931         TP_printk("dev %s ino %lu mode 0%o is_metadata %d block %llu",
932                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
933                   __entry->mode, __entry->is_metadata, __entry->block)
934 );
935
936 #endif /* _TRACE_EXT4_H */
937
938 /* This part must be outside protection */
939 #include <trace/define_trace.h>