Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
[linux-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
15 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
16
17 TRACE_EVENT(ext4_free_inode,
18         TP_PROTO(struct inode *inode),
19
20         TP_ARGS(inode),
21
22         TP_STRUCT__entry(
23                 __field(        dev_t,  dev                     )
24                 __field(        ino_t,  ino                     )
25                 __field(        umode_t, mode                   )
26                 __field(        uid_t,  uid                     )
27                 __field(        gid_t,  gid                     )
28                 __field(        blkcnt_t, blocks                )
29         ),
30
31         TP_fast_assign(
32                 __entry->dev    = inode->i_sb->s_dev;
33                 __entry->ino    = inode->i_ino;
34                 __entry->mode   = inode->i_mode;
35                 __entry->uid    = inode->i_uid;
36                 __entry->gid    = inode->i_gid;
37                 __entry->blocks = inode->i_blocks;
38         ),
39
40         TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu",
41                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
42                   __entry->mode, __entry->uid, __entry->gid,
43                   (unsigned long long) __entry->blocks)
44 );
45
46 TRACE_EVENT(ext4_request_inode,
47         TP_PROTO(struct inode *dir, int mode),
48
49         TP_ARGS(dir, mode),
50
51         TP_STRUCT__entry(
52                 __field(        dev_t,  dev                     )
53                 __field(        ino_t,  dir                     )
54                 __field(        umode_t, mode                   )
55         ),
56
57         TP_fast_assign(
58                 __entry->dev    = dir->i_sb->s_dev;
59                 __entry->dir    = dir->i_ino;
60                 __entry->mode   = mode;
61         ),
62
63         TP_printk("dev %s dir %lu mode %d",
64                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->dir,
65                   __entry->mode)
66 );
67
68 TRACE_EVENT(ext4_allocate_inode,
69         TP_PROTO(struct inode *inode, struct inode *dir, int mode),
70
71         TP_ARGS(inode, dir, mode),
72
73         TP_STRUCT__entry(
74                 __field(        dev_t,  dev                     )
75                 __field(        ino_t,  ino                     )
76                 __field(        ino_t,  dir                     )
77                 __field(        umode_t, mode                   )
78         ),
79
80         TP_fast_assign(
81                 __entry->dev    = inode->i_sb->s_dev;
82                 __entry->ino    = inode->i_ino;
83                 __entry->dir    = dir->i_ino;
84                 __entry->mode   = mode;
85         ),
86
87         TP_printk("dev %s ino %lu dir %lu mode %d",
88                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
89                   (unsigned long) __entry->dir, __entry->mode)
90 );
91
92 TRACE_EVENT(ext4_write_begin,
93
94         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
95                  unsigned int flags),
96
97         TP_ARGS(inode, pos, len, flags),
98
99         TP_STRUCT__entry(
100                 __field(        dev_t,  dev                     )
101                 __field(        ino_t,  ino                     )
102                 __field(        loff_t, pos                     )
103                 __field(        unsigned int, len               )
104                 __field(        unsigned int, flags             )
105         ),
106
107         TP_fast_assign(
108                 __entry->dev    = inode->i_sb->s_dev;
109                 __entry->ino    = inode->i_ino;
110                 __entry->pos    = pos;
111                 __entry->len    = len;
112                 __entry->flags  = flags;
113         ),
114
115         TP_printk("dev %s ino %lu pos %llu len %u flags %u",
116                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
117                   __entry->pos, __entry->len, __entry->flags)
118 );
119
120 TRACE_EVENT(ext4_ordered_write_end,
121         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
122                         unsigned int copied),
123
124         TP_ARGS(inode, pos, len, copied),
125
126         TP_STRUCT__entry(
127                 __field(        dev_t,  dev                     )
128                 __field(        ino_t,  ino                     )
129                 __field(        loff_t, pos                     )
130                 __field(        unsigned int, len               )
131                 __field(        unsigned int, copied            )
132         ),
133
134         TP_fast_assign(
135                 __entry->dev    = inode->i_sb->s_dev;
136                 __entry->ino    = inode->i_ino;
137                 __entry->pos    = pos;
138                 __entry->len    = len;
139                 __entry->copied = copied;
140         ),
141
142         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
143                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
144                   __entry->pos, __entry->len, __entry->copied)
145 );
146
147 TRACE_EVENT(ext4_writeback_write_end,
148         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
149                  unsigned int copied),
150
151         TP_ARGS(inode, pos, len, copied),
152
153         TP_STRUCT__entry(
154                 __field(        dev_t,  dev                     )
155                 __field(        ino_t,  ino                     )
156                 __field(        loff_t, pos                     )
157                 __field(        unsigned int, len               )
158                 __field(        unsigned int, copied            )
159         ),
160
161         TP_fast_assign(
162                 __entry->dev    = inode->i_sb->s_dev;
163                 __entry->ino    = inode->i_ino;
164                 __entry->pos    = pos;
165                 __entry->len    = len;
166                 __entry->copied = copied;
167         ),
168
169         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
170                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
171                   __entry->pos, __entry->len, __entry->copied)
172 );
173
174 TRACE_EVENT(ext4_journalled_write_end,
175         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
176                  unsigned int copied),
177         TP_ARGS(inode, pos, len, copied),
178
179         TP_STRUCT__entry(
180                 __field(        dev_t,  dev                     )
181                 __field(        ino_t,  ino                     )
182                 __field(        loff_t, pos                     )
183                 __field(        unsigned int, len               )
184                 __field(        unsigned int, copied            )
185         ),
186
187         TP_fast_assign(
188                 __entry->dev    = inode->i_sb->s_dev;
189                 __entry->ino    = inode->i_ino;
190                 __entry->pos    = pos;
191                 __entry->len    = len;
192                 __entry->copied = copied;
193         ),
194
195         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
196                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
197                   __entry->pos, __entry->len, __entry->copied)
198 );
199
200 TRACE_EVENT(ext4_writepage,
201         TP_PROTO(struct inode *inode, struct page *page),
202
203         TP_ARGS(inode, page),
204
205         TP_STRUCT__entry(
206                 __field(        dev_t,  dev                     )
207                 __field(        ino_t,  ino                     )
208                 __field(        pgoff_t, index                  )
209
210         ),
211
212         TP_fast_assign(
213                 __entry->dev    = inode->i_sb->s_dev;
214                 __entry->ino    = inode->i_ino;
215                 __entry->index  = page->index;
216         ),
217
218         TP_printk("dev %s ino %lu page_index %lu",
219                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
220                   __entry->index)
221 );
222
223 TRACE_EVENT(ext4_da_writepages,
224         TP_PROTO(struct inode *inode, struct writeback_control *wbc),
225
226         TP_ARGS(inode, wbc),
227
228         TP_STRUCT__entry(
229                 __field(        dev_t,  dev                     )
230                 __field(        ino_t,  ino                     )
231                 __field(        long,   nr_to_write             )
232                 __field(        long,   pages_skipped           )
233                 __field(        loff_t, range_start             )
234                 __field(        loff_t, range_end               )
235                 __field(        char,   nonblocking             )
236                 __field(        char,   for_kupdate             )
237                 __field(        char,   for_reclaim             )
238                 __field(        char,   range_cyclic            )
239         ),
240
241         TP_fast_assign(
242                 __entry->dev            = inode->i_sb->s_dev;
243                 __entry->ino            = inode->i_ino;
244                 __entry->nr_to_write    = wbc->nr_to_write;
245                 __entry->pages_skipped  = wbc->pages_skipped;
246                 __entry->range_start    = wbc->range_start;
247                 __entry->range_end      = wbc->range_end;
248                 __entry->nonblocking    = wbc->nonblocking;
249                 __entry->for_kupdate    = wbc->for_kupdate;
250                 __entry->for_reclaim    = wbc->for_reclaim;
251                 __entry->range_cyclic   = wbc->range_cyclic;
252         ),
253
254         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",
255                   jbd2_dev_to_name(__entry->dev),
256                   (unsigned long) __entry->ino, __entry->nr_to_write,
257                   __entry->pages_skipped, __entry->range_start,
258                   __entry->range_end, __entry->nonblocking,
259                   __entry->for_kupdate, __entry->for_reclaim,
260                   __entry->range_cyclic)
261 );
262
263 TRACE_EVENT(ext4_da_write_pages,
264         TP_PROTO(struct inode *inode, struct mpage_da_data *mpd),
265
266         TP_ARGS(inode, mpd),
267
268         TP_STRUCT__entry(
269                 __field(        dev_t,  dev                     )
270                 __field(        ino_t,  ino                     )
271                 __field(        __u64,  b_blocknr               )
272                 __field(        __u32,  b_size                  )
273                 __field(        __u32,  b_state                 )
274                 __field(        unsigned long,  first_page      )
275                 __field(        int,    io_done                 )
276                 __field(        int,    pages_written           )
277         ),
278
279         TP_fast_assign(
280                 __entry->dev            = inode->i_sb->s_dev;
281                 __entry->ino            = inode->i_ino;
282                 __entry->b_blocknr      = mpd->b_blocknr;
283                 __entry->b_size         = mpd->b_size;
284                 __entry->b_state        = mpd->b_state;
285                 __entry->first_page     = mpd->first_page;
286                 __entry->io_done        = mpd->io_done;
287                 __entry->pages_written  = mpd->pages_written;
288         ),
289
290         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",
291                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
292                   __entry->b_blocknr, __entry->b_size,
293                   __entry->b_state, __entry->first_page,
294                   __entry->io_done, __entry->pages_written)
295 );
296
297 TRACE_EVENT(ext4_da_writepages_result,
298         TP_PROTO(struct inode *inode, struct writeback_control *wbc,
299                         int ret, int pages_written),
300
301         TP_ARGS(inode, wbc, ret, pages_written),
302
303         TP_STRUCT__entry(
304                 __field(        dev_t,  dev                     )
305                 __field(        ino_t,  ino                     )
306                 __field(        int,    ret                     )
307                 __field(        int,    pages_written           )
308                 __field(        long,   pages_skipped           )
309                 __field(        char,   encountered_congestion  )
310                 __field(        char,   more_io                 )       
311                 __field(        char,   no_nrwrite_index_update )
312         ),
313
314         TP_fast_assign(
315                 __entry->dev            = inode->i_sb->s_dev;
316                 __entry->ino            = inode->i_ino;
317                 __entry->ret            = ret;
318                 __entry->pages_written  = pages_written;
319                 __entry->pages_skipped  = wbc->pages_skipped;
320                 __entry->encountered_congestion = wbc->encountered_congestion;
321                 __entry->more_io        = wbc->more_io;
322                 __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update;
323         ),
324
325         TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d",
326                   jbd2_dev_to_name(__entry->dev),
327                   (unsigned long) __entry->ino, __entry->ret,
328                   __entry->pages_written, __entry->pages_skipped,
329                   __entry->encountered_congestion, __entry->more_io,
330                   __entry->no_nrwrite_index_update)
331 );
332
333 TRACE_EVENT(ext4_da_write_begin,
334         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
335                         unsigned int flags),
336
337         TP_ARGS(inode, pos, len, flags),
338
339         TP_STRUCT__entry(
340                 __field(        dev_t,  dev                     )
341                 __field(        ino_t,  ino                     )
342                 __field(        loff_t, pos                     )
343                 __field(        unsigned int, len               )
344                 __field(        unsigned int, flags             )
345         ),
346
347         TP_fast_assign(
348                 __entry->dev    = inode->i_sb->s_dev;
349                 __entry->ino    = inode->i_ino;
350                 __entry->pos    = pos;
351                 __entry->len    = len;
352                 __entry->flags  = flags;
353         ),
354
355         TP_printk("dev %s ino %lu pos %llu len %u flags %u",
356                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
357                   __entry->pos, __entry->len, __entry->flags)
358 );
359
360 TRACE_EVENT(ext4_da_write_end,
361         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
362                         unsigned int copied),
363
364         TP_ARGS(inode, pos, len, copied),
365
366         TP_STRUCT__entry(
367                 __field(        dev_t,  dev                     )
368                 __field(        ino_t,  ino                     )
369                 __field(        loff_t, pos                     )
370                 __field(        unsigned int, len               )
371                 __field(        unsigned int, copied            )
372         ),
373
374         TP_fast_assign(
375                 __entry->dev    = inode->i_sb->s_dev;
376                 __entry->ino    = inode->i_ino;
377                 __entry->pos    = pos;
378                 __entry->len    = len;
379                 __entry->copied = copied;
380         ),
381
382         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
383                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
384                   __entry->pos, __entry->len, __entry->copied)
385 );
386
387 TRACE_EVENT(ext4_discard_blocks,
388         TP_PROTO(struct super_block *sb, unsigned long long blk,
389                         unsigned long long count),
390
391         TP_ARGS(sb, blk, count),
392
393         TP_STRUCT__entry(
394                 __field(        dev_t,  dev                     )
395                 __field(        __u64,  blk                     )
396                 __field(        __u64,  count                   )
397
398         ),
399
400         TP_fast_assign(
401                 __entry->dev    = sb->s_dev;
402                 __entry->blk    = blk;
403                 __entry->count  = count;
404         ),
405
406         TP_printk("dev %s blk %llu count %llu",
407                   jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count)
408 );
409
410 TRACE_EVENT(ext4_mb_new_inode_pa,
411         TP_PROTO(struct ext4_allocation_context *ac,
412                  struct ext4_prealloc_space *pa),
413
414         TP_ARGS(ac, pa),
415
416         TP_STRUCT__entry(
417                 __field(        dev_t,  dev                     )
418                 __field(        ino_t,  ino                     )
419                 __field(        __u64,  pa_pstart               )
420                 __field(        __u32,  pa_len                  )
421                 __field(        __u64,  pa_lstart               )
422
423         ),
424
425         TP_fast_assign(
426                 __entry->dev            = ac->ac_sb->s_dev;
427                 __entry->ino            = ac->ac_inode->i_ino;
428                 __entry->pa_pstart      = pa->pa_pstart;
429                 __entry->pa_len         = pa->pa_len;
430                 __entry->pa_lstart      = pa->pa_lstart;
431         ),
432
433         TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
434                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
435                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
436 );
437
438 TRACE_EVENT(ext4_mb_new_group_pa,
439         TP_PROTO(struct ext4_allocation_context *ac,
440                  struct ext4_prealloc_space *pa),
441
442         TP_ARGS(ac, pa),
443
444         TP_STRUCT__entry(
445                 __field(        dev_t,  dev                     )
446                 __field(        ino_t,  ino                     )
447                 __field(        __u64,  pa_pstart               )
448                 __field(        __u32,  pa_len                  )
449                 __field(        __u64,  pa_lstart               )
450
451         ),
452
453         TP_fast_assign(
454                 __entry->dev            = ac->ac_sb->s_dev;
455                 __entry->ino            = ac->ac_inode->i_ino;
456                 __entry->pa_pstart      = pa->pa_pstart;
457                 __entry->pa_len         = pa->pa_len;
458                 __entry->pa_lstart      = pa->pa_lstart;
459         ),
460
461         TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
462                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
463                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
464 );
465
466 TRACE_EVENT(ext4_mb_release_inode_pa,
467         TP_PROTO(struct ext4_allocation_context *ac,
468                  struct ext4_prealloc_space *pa,
469                  unsigned long long block, unsigned int count),
470
471         TP_ARGS(ac, pa, block, count),
472
473         TP_STRUCT__entry(
474                 __field(        dev_t,  dev                     )
475                 __field(        ino_t,  ino                     )
476                 __field(        __u64,  block                   )
477                 __field(        __u32,  count                   )
478
479         ),
480
481         TP_fast_assign(
482                 __entry->dev            = ac->ac_sb->s_dev;
483                 __entry->ino            = ac->ac_inode->i_ino;
484                 __entry->block          = block;
485                 __entry->count          = count;
486         ),
487
488         TP_printk("dev %s ino %lu block %llu count %u",
489                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
490                   __entry->block, __entry->count)
491 );
492
493 TRACE_EVENT(ext4_mb_release_group_pa,
494         TP_PROTO(struct ext4_allocation_context *ac,
495                  struct ext4_prealloc_space *pa),
496
497         TP_ARGS(ac, pa),
498
499         TP_STRUCT__entry(
500                 __field(        dev_t,  dev                     )
501                 __field(        ino_t,  ino                     )
502                 __field(        __u64,  pa_pstart               )
503                 __field(        __u32,  pa_len                  )
504
505         ),
506
507         TP_fast_assign(
508                 __entry->dev            = ac->ac_sb->s_dev;
509                 __entry->ino            = ac->ac_inode->i_ino;
510                 __entry->pa_pstart      = pa->pa_pstart;
511                 __entry->pa_len         = pa->pa_len;
512         ),
513
514         TP_printk("dev %s pstart %llu len %u",
515                   jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len)
516 );
517
518 TRACE_EVENT(ext4_discard_preallocations,
519         TP_PROTO(struct inode *inode),
520
521         TP_ARGS(inode),
522
523         TP_STRUCT__entry(
524                 __field(        dev_t,  dev                     )
525                 __field(        ino_t,  ino                     )
526
527         ),
528
529         TP_fast_assign(
530                 __entry->dev    = inode->i_sb->s_dev;
531                 __entry->ino    = inode->i_ino;
532         ),
533
534         TP_printk("dev %s ino %lu",
535                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino)
536 );
537
538 TRACE_EVENT(ext4_mb_discard_preallocations,
539         TP_PROTO(struct super_block *sb, int needed),
540
541         TP_ARGS(sb, needed),
542
543         TP_STRUCT__entry(
544                 __field(        dev_t,  dev                     )
545                 __field(        int,    needed                  )
546
547         ),
548
549         TP_fast_assign(
550                 __entry->dev    = sb->s_dev;
551                 __entry->needed = needed;
552         ),
553
554         TP_printk("dev %s needed %d",
555                   jbd2_dev_to_name(__entry->dev), __entry->needed)
556 );
557
558 TRACE_EVENT(ext4_request_blocks,
559         TP_PROTO(struct ext4_allocation_request *ar),
560
561         TP_ARGS(ar),
562
563         TP_STRUCT__entry(
564                 __field(        dev_t,  dev                     )
565                 __field(        ino_t,  ino                     )
566                 __field(        unsigned int, flags             )
567                 __field(        unsigned int, len               )
568                 __field(        __u64,  logical                 )
569                 __field(        __u64,  goal                    )
570                 __field(        __u64,  lleft                   )
571                 __field(        __u64,  lright                  )
572                 __field(        __u64,  pleft                   )
573                 __field(        __u64,  pright                  )
574         ),
575
576         TP_fast_assign(
577                 __entry->dev    = ar->inode->i_sb->s_dev;
578                 __entry->ino    = ar->inode->i_ino;
579                 __entry->flags  = ar->flags;
580                 __entry->len    = ar->len;
581                 __entry->logical = ar->logical;
582                 __entry->goal   = ar->goal;
583                 __entry->lleft  = ar->lleft;
584                 __entry->lright = ar->lright;
585                 __entry->pleft  = ar->pleft;
586                 __entry->pright = ar->pright;
587         ),
588
589         TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
590                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
591                   __entry->flags, __entry->len,
592                   (unsigned long long) __entry->logical,
593                   (unsigned long long) __entry->goal,
594                   (unsigned long long) __entry->lleft,
595                   (unsigned long long) __entry->lright,
596                   (unsigned long long) __entry->pleft,
597                   (unsigned long long) __entry->pright)
598 );
599
600 TRACE_EVENT(ext4_allocate_blocks,
601         TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
602
603         TP_ARGS(ar, block),
604
605         TP_STRUCT__entry(
606                 __field(        dev_t,  dev                     )
607                 __field(        ino_t,  ino                     )
608                 __field(        __u64,  block                   )
609                 __field(        unsigned int, flags             )
610                 __field(        unsigned int, len               )
611                 __field(        __u64,  logical                 )
612                 __field(        __u64,  goal                    )
613                 __field(        __u64,  lleft                   )
614                 __field(        __u64,  lright                  )
615                 __field(        __u64,  pleft                   )
616                 __field(        __u64,  pright                  )
617         ),
618
619         TP_fast_assign(
620                 __entry->dev    = ar->inode->i_sb->s_dev;
621                 __entry->ino    = ar->inode->i_ino;
622                 __entry->block  = block;
623                 __entry->flags  = ar->flags;
624                 __entry->len    = ar->len;
625                 __entry->logical = ar->logical;
626                 __entry->goal   = ar->goal;
627                 __entry->lleft  = ar->lleft;
628                 __entry->lright = ar->lright;
629                 __entry->pleft  = ar->pleft;
630                 __entry->pright = ar->pright;
631         ),
632
633         TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
634                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
635                   __entry->flags, __entry->len, __entry->block,
636                   (unsigned long long) __entry->logical,
637                   (unsigned long long) __entry->goal,
638                   (unsigned long long) __entry->lleft,
639                   (unsigned long long) __entry->lright,
640                   (unsigned long long) __entry->pleft,
641                   (unsigned long long) __entry->pright)
642 );
643
644 TRACE_EVENT(ext4_free_blocks,
645         TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
646                         int metadata),
647
648         TP_ARGS(inode, block, count, metadata),
649
650         TP_STRUCT__entry(
651                 __field(        dev_t,  dev                     )
652                 __field(        ino_t,  ino                     )
653                 __field(        __u64,  block                   )
654                 __field(        unsigned long,  count           )
655                 __field(        int,    metadata                )
656
657         ),
658
659         TP_fast_assign(
660                 __entry->dev            = inode->i_sb->s_dev;
661                 __entry->ino            = inode->i_ino;
662                 __entry->block          = block;
663                 __entry->count          = count;
664                 __entry->metadata       = metadata;
665         ),
666
667         TP_printk("dev %s ino %lu block %llu count %lu metadata %d",
668                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
669                   __entry->block, __entry->count, __entry->metadata)
670 );
671
672 TRACE_EVENT(ext4_sync_file,
673         TP_PROTO(struct file *file, struct dentry *dentry, int datasync),
674
675         TP_ARGS(file, dentry, datasync),
676
677         TP_STRUCT__entry(
678                 __field(        dev_t,  dev                     )
679                 __field(        ino_t,  ino                     )
680                 __field(        ino_t,  parent                  )
681                 __field(        int,    datasync                )
682         ),
683
684         TP_fast_assign(
685                 __entry->dev            = dentry->d_inode->i_sb->s_dev;
686                 __entry->ino            = dentry->d_inode->i_ino;
687                 __entry->datasync       = datasync;
688                 __entry->parent         = dentry->d_parent->d_inode->i_ino;
689         ),
690
691         TP_printk("dev %s ino %ld parent %ld datasync %d ",
692                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
693                   (unsigned long) __entry->parent, __entry->datasync)
694 );
695
696 TRACE_EVENT(ext4_sync_fs,
697         TP_PROTO(struct super_block *sb, int wait),
698
699         TP_ARGS(sb, wait),
700
701         TP_STRUCT__entry(
702                 __field(        dev_t,  dev                     )
703                 __field(        int,    wait                    )
704
705         ),
706
707         TP_fast_assign(
708                 __entry->dev    = sb->s_dev;
709                 __entry->wait   = wait;
710         ),
711
712         TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry->dev),
713                   __entry->wait)
714 );
715
716 TRACE_EVENT(ext4_alloc_da_blocks,
717         TP_PROTO(struct inode *inode),
718
719         TP_ARGS(inode),
720
721         TP_STRUCT__entry(
722                 __field(        dev_t,  dev                     )
723                 __field(        ino_t,  ino                     )
724                 __field( unsigned int,  data_blocks     )
725                 __field( unsigned int,  meta_blocks     )
726         ),
727
728         TP_fast_assign(
729                 __entry->dev    = inode->i_sb->s_dev;
730                 __entry->ino    = inode->i_ino;
731                 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
732                 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
733         ),
734
735         TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u",
736                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
737                   __entry->data_blocks, __entry->meta_blocks)
738 );
739
740 #endif /* _TRACE_EXT4_H */
741
742 /* This part must be outside protection */
743 #include <trace/define_trace.h>