]> nv-tegra.nvidia Code Review - linux-2.6.git/blob - include/trace/events/ext4.h
b8320256dc5d229f68f933434bbfde0dfb440eb9
[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                 __field(       pgoff_t, writeback_index         )
240         ),
241
242         TP_fast_assign(
243                 __entry->dev            = inode->i_sb->s_dev;
244                 __entry->ino            = inode->i_ino;
245                 __entry->nr_to_write    = wbc->nr_to_write;
246                 __entry->pages_skipped  = wbc->pages_skipped;
247                 __entry->range_start    = wbc->range_start;
248                 __entry->range_end      = wbc->range_end;
249                 __entry->nonblocking    = wbc->nonblocking;
250                 __entry->for_kupdate    = wbc->for_kupdate;
251                 __entry->for_reclaim    = wbc->for_reclaim;
252                 __entry->range_cyclic   = wbc->range_cyclic;
253                 __entry->writeback_index = inode->i_mapping->writeback_index;
254         ),
255
256         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",
257                   jbd2_dev_to_name(__entry->dev),
258                   (unsigned long) __entry->ino, __entry->nr_to_write,
259                   __entry->pages_skipped, __entry->range_start,
260                   __entry->range_end, __entry->nonblocking,
261                   __entry->for_kupdate, __entry->for_reclaim,
262                   __entry->range_cyclic,
263                   (unsigned long) __entry->writeback_index)
264 );
265
266 TRACE_EVENT(ext4_da_write_pages,
267         TP_PROTO(struct inode *inode, struct mpage_da_data *mpd),
268
269         TP_ARGS(inode, mpd),
270
271         TP_STRUCT__entry(
272                 __field(        dev_t,  dev                     )
273                 __field(        ino_t,  ino                     )
274                 __field(        __u64,  b_blocknr               )
275                 __field(        __u32,  b_size                  )
276                 __field(        __u32,  b_state                 )
277                 __field(        unsigned long,  first_page      )
278                 __field(        int,    io_done                 )
279                 __field(        int,    pages_written           )
280         ),
281
282         TP_fast_assign(
283                 __entry->dev            = inode->i_sb->s_dev;
284                 __entry->ino            = inode->i_ino;
285                 __entry->b_blocknr      = mpd->b_blocknr;
286                 __entry->b_size         = mpd->b_size;
287                 __entry->b_state        = mpd->b_state;
288                 __entry->first_page     = mpd->first_page;
289                 __entry->io_done        = mpd->io_done;
290                 __entry->pages_written  = mpd->pages_written;
291         ),
292
293         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",
294                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
295                   __entry->b_blocknr, __entry->b_size,
296                   __entry->b_state, __entry->first_page,
297                   __entry->io_done, __entry->pages_written)
298 );
299
300 TRACE_EVENT(ext4_da_writepages_result,
301         TP_PROTO(struct inode *inode, struct writeback_control *wbc,
302                         int ret, int pages_written),
303
304         TP_ARGS(inode, wbc, ret, pages_written),
305
306         TP_STRUCT__entry(
307                 __field(        dev_t,  dev                     )
308                 __field(        ino_t,  ino                     )
309                 __field(        int,    ret                     )
310                 __field(        int,    pages_written           )
311                 __field(        long,   pages_skipped           )
312                 __field(        char,   encountered_congestion  )
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->encountered_congestion = wbc->encountered_congestion;
325                 __entry->more_io        = wbc->more_io;
326                 __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update;
327                 __entry->writeback_index = inode->i_mapping->writeback_index;
328         ),
329
330         TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d writeback_index %lu",
331                   jbd2_dev_to_name(__entry->dev),
332                   (unsigned long) __entry->ino, __entry->ret,
333                   __entry->pages_written, __entry->pages_skipped,
334                   __entry->encountered_congestion, __entry->more_io,
335                   __entry->no_nrwrite_index_update,
336                   (unsigned long) __entry->writeback_index)
337 );
338
339 TRACE_EVENT(ext4_da_write_begin,
340         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
341                         unsigned int flags),
342
343         TP_ARGS(inode, pos, len, flags),
344
345         TP_STRUCT__entry(
346                 __field(        dev_t,  dev                     )
347                 __field(        ino_t,  ino                     )
348                 __field(        loff_t, pos                     )
349                 __field(        unsigned int, len               )
350                 __field(        unsigned int, flags             )
351         ),
352
353         TP_fast_assign(
354                 __entry->dev    = inode->i_sb->s_dev;
355                 __entry->ino    = inode->i_ino;
356                 __entry->pos    = pos;
357                 __entry->len    = len;
358                 __entry->flags  = flags;
359         ),
360
361         TP_printk("dev %s ino %lu pos %llu len %u flags %u",
362                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
363                   __entry->pos, __entry->len, __entry->flags)
364 );
365
366 TRACE_EVENT(ext4_da_write_end,
367         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
368                         unsigned int copied),
369
370         TP_ARGS(inode, pos, len, copied),
371
372         TP_STRUCT__entry(
373                 __field(        dev_t,  dev                     )
374                 __field(        ino_t,  ino                     )
375                 __field(        loff_t, pos                     )
376                 __field(        unsigned int, len               )
377                 __field(        unsigned int, copied            )
378         ),
379
380         TP_fast_assign(
381                 __entry->dev    = inode->i_sb->s_dev;
382                 __entry->ino    = inode->i_ino;
383                 __entry->pos    = pos;
384                 __entry->len    = len;
385                 __entry->copied = copied;
386         ),
387
388         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
389                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
390                   __entry->pos, __entry->len, __entry->copied)
391 );
392
393 TRACE_EVENT(ext4_discard_blocks,
394         TP_PROTO(struct super_block *sb, unsigned long long blk,
395                         unsigned long long count),
396
397         TP_ARGS(sb, blk, count),
398
399         TP_STRUCT__entry(
400                 __field(        dev_t,  dev                     )
401                 __field(        __u64,  blk                     )
402                 __field(        __u64,  count                   )
403
404         ),
405
406         TP_fast_assign(
407                 __entry->dev    = sb->s_dev;
408                 __entry->blk    = blk;
409                 __entry->count  = count;
410         ),
411
412         TP_printk("dev %s blk %llu count %llu",
413                   jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count)
414 );
415
416 TRACE_EVENT(ext4_mb_new_inode_pa,
417         TP_PROTO(struct ext4_allocation_context *ac,
418                  struct ext4_prealloc_space *pa),
419
420         TP_ARGS(ac, pa),
421
422         TP_STRUCT__entry(
423                 __field(        dev_t,  dev                     )
424                 __field(        ino_t,  ino                     )
425                 __field(        __u64,  pa_pstart               )
426                 __field(        __u32,  pa_len                  )
427                 __field(        __u64,  pa_lstart               )
428
429         ),
430
431         TP_fast_assign(
432                 __entry->dev            = ac->ac_sb->s_dev;
433                 __entry->ino            = ac->ac_inode->i_ino;
434                 __entry->pa_pstart      = pa->pa_pstart;
435                 __entry->pa_len         = pa->pa_len;
436                 __entry->pa_lstart      = pa->pa_lstart;
437         ),
438
439         TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
440                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
441                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
442 );
443
444 TRACE_EVENT(ext4_mb_new_group_pa,
445         TP_PROTO(struct ext4_allocation_context *ac,
446                  struct ext4_prealloc_space *pa),
447
448         TP_ARGS(ac, pa),
449
450         TP_STRUCT__entry(
451                 __field(        dev_t,  dev                     )
452                 __field(        ino_t,  ino                     )
453                 __field(        __u64,  pa_pstart               )
454                 __field(        __u32,  pa_len                  )
455                 __field(        __u64,  pa_lstart               )
456
457         ),
458
459         TP_fast_assign(
460                 __entry->dev            = ac->ac_sb->s_dev;
461                 __entry->ino            = ac->ac_inode->i_ino;
462                 __entry->pa_pstart      = pa->pa_pstart;
463                 __entry->pa_len         = pa->pa_len;
464                 __entry->pa_lstart      = pa->pa_lstart;
465         ),
466
467         TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
468                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
469                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
470 );
471
472 TRACE_EVENT(ext4_mb_release_inode_pa,
473         TP_PROTO(struct ext4_allocation_context *ac,
474                  struct ext4_prealloc_space *pa,
475                  unsigned long long block, unsigned int count),
476
477         TP_ARGS(ac, pa, block, count),
478
479         TP_STRUCT__entry(
480                 __field(        dev_t,  dev                     )
481                 __field(        ino_t,  ino                     )
482                 __field(        __u64,  block                   )
483                 __field(        __u32,  count                   )
484
485         ),
486
487         TP_fast_assign(
488                 __entry->dev            = ac->ac_sb->s_dev;
489                 __entry->ino            = ac->ac_inode->i_ino;
490                 __entry->block          = block;
491                 __entry->count          = count;
492         ),
493
494         TP_printk("dev %s ino %lu block %llu count %u",
495                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
496                   __entry->block, __entry->count)
497 );
498
499 TRACE_EVENT(ext4_mb_release_group_pa,
500         TP_PROTO(struct ext4_allocation_context *ac,
501                  struct ext4_prealloc_space *pa),
502
503         TP_ARGS(ac, pa),
504
505         TP_STRUCT__entry(
506                 __field(        dev_t,  dev                     )
507                 __field(        ino_t,  ino                     )
508                 __field(        __u64,  pa_pstart               )
509                 __field(        __u32,  pa_len                  )
510
511         ),
512
513         TP_fast_assign(
514                 __entry->dev            = ac->ac_sb->s_dev;
515                 __entry->ino            = ac->ac_inode->i_ino;
516                 __entry->pa_pstart      = pa->pa_pstart;
517                 __entry->pa_len         = pa->pa_len;
518         ),
519
520         TP_printk("dev %s pstart %llu len %u",
521                   jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len)
522 );
523
524 TRACE_EVENT(ext4_discard_preallocations,
525         TP_PROTO(struct inode *inode),
526
527         TP_ARGS(inode),
528
529         TP_STRUCT__entry(
530                 __field(        dev_t,  dev                     )
531                 __field(        ino_t,  ino                     )
532
533         ),
534
535         TP_fast_assign(
536                 __entry->dev    = inode->i_sb->s_dev;
537                 __entry->ino    = inode->i_ino;
538         ),
539
540         TP_printk("dev %s ino %lu",
541                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino)
542 );
543
544 TRACE_EVENT(ext4_mb_discard_preallocations,
545         TP_PROTO(struct super_block *sb, int needed),
546
547         TP_ARGS(sb, needed),
548
549         TP_STRUCT__entry(
550                 __field(        dev_t,  dev                     )
551                 __field(        int,    needed                  )
552
553         ),
554
555         TP_fast_assign(
556                 __entry->dev    = sb->s_dev;
557                 __entry->needed = needed;
558         ),
559
560         TP_printk("dev %s needed %d",
561                   jbd2_dev_to_name(__entry->dev), __entry->needed)
562 );
563
564 TRACE_EVENT(ext4_request_blocks,
565         TP_PROTO(struct ext4_allocation_request *ar),
566
567         TP_ARGS(ar),
568
569         TP_STRUCT__entry(
570                 __field(        dev_t,  dev                     )
571                 __field(        ino_t,  ino                     )
572                 __field(        unsigned int, flags             )
573                 __field(        unsigned int, len               )
574                 __field(        __u64,  logical                 )
575                 __field(        __u64,  goal                    )
576                 __field(        __u64,  lleft                   )
577                 __field(        __u64,  lright                  )
578                 __field(        __u64,  pleft                   )
579                 __field(        __u64,  pright                  )
580         ),
581
582         TP_fast_assign(
583                 __entry->dev    = ar->inode->i_sb->s_dev;
584                 __entry->ino    = ar->inode->i_ino;
585                 __entry->flags  = ar->flags;
586                 __entry->len    = ar->len;
587                 __entry->logical = ar->logical;
588                 __entry->goal   = ar->goal;
589                 __entry->lleft  = ar->lleft;
590                 __entry->lright = ar->lright;
591                 __entry->pleft  = ar->pleft;
592                 __entry->pright = ar->pright;
593         ),
594
595         TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
596                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
597                   __entry->flags, __entry->len,
598                   (unsigned long long) __entry->logical,
599                   (unsigned long long) __entry->goal,
600                   (unsigned long long) __entry->lleft,
601                   (unsigned long long) __entry->lright,
602                   (unsigned long long) __entry->pleft,
603                   (unsigned long long) __entry->pright)
604 );
605
606 TRACE_EVENT(ext4_allocate_blocks,
607         TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
608
609         TP_ARGS(ar, block),
610
611         TP_STRUCT__entry(
612                 __field(        dev_t,  dev                     )
613                 __field(        ino_t,  ino                     )
614                 __field(        __u64,  block                   )
615                 __field(        unsigned int, flags             )
616                 __field(        unsigned int, len               )
617                 __field(        __u64,  logical                 )
618                 __field(        __u64,  goal                    )
619                 __field(        __u64,  lleft                   )
620                 __field(        __u64,  lright                  )
621                 __field(        __u64,  pleft                   )
622                 __field(        __u64,  pright                  )
623         ),
624
625         TP_fast_assign(
626                 __entry->dev    = ar->inode->i_sb->s_dev;
627                 __entry->ino    = ar->inode->i_ino;
628                 __entry->block  = block;
629                 __entry->flags  = ar->flags;
630                 __entry->len    = ar->len;
631                 __entry->logical = ar->logical;
632                 __entry->goal   = ar->goal;
633                 __entry->lleft  = ar->lleft;
634                 __entry->lright = ar->lright;
635                 __entry->pleft  = ar->pleft;
636                 __entry->pright = ar->pright;
637         ),
638
639         TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
640                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
641                   __entry->flags, __entry->len, __entry->block,
642                   (unsigned long long) __entry->logical,
643                   (unsigned long long) __entry->goal,
644                   (unsigned long long) __entry->lleft,
645                   (unsigned long long) __entry->lright,
646                   (unsigned long long) __entry->pleft,
647                   (unsigned long long) __entry->pright)
648 );
649
650 TRACE_EVENT(ext4_free_blocks,
651         TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
652                         int metadata),
653
654         TP_ARGS(inode, block, count, metadata),
655
656         TP_STRUCT__entry(
657                 __field(        dev_t,  dev                     )
658                 __field(        ino_t,  ino                     )
659                 __field(        __u64,  block                   )
660                 __field(        unsigned long,  count           )
661                 __field(        int,    metadata                )
662
663         ),
664
665         TP_fast_assign(
666                 __entry->dev            = inode->i_sb->s_dev;
667                 __entry->ino            = inode->i_ino;
668                 __entry->block          = block;
669                 __entry->count          = count;
670                 __entry->metadata       = metadata;
671         ),
672
673         TP_printk("dev %s ino %lu block %llu count %lu metadata %d",
674                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
675                   __entry->block, __entry->count, __entry->metadata)
676 );
677
678 TRACE_EVENT(ext4_sync_file,
679         TP_PROTO(struct file *file, struct dentry *dentry, int datasync),
680
681         TP_ARGS(file, dentry, datasync),
682
683         TP_STRUCT__entry(
684                 __field(        dev_t,  dev                     )
685                 __field(        ino_t,  ino                     )
686                 __field(        ino_t,  parent                  )
687                 __field(        int,    datasync                )
688         ),
689
690         TP_fast_assign(
691                 __entry->dev            = dentry->d_inode->i_sb->s_dev;
692                 __entry->ino            = dentry->d_inode->i_ino;
693                 __entry->datasync       = datasync;
694                 __entry->parent         = dentry->d_parent->d_inode->i_ino;
695         ),
696
697         TP_printk("dev %s ino %ld parent %ld datasync %d ",
698                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
699                   (unsigned long) __entry->parent, __entry->datasync)
700 );
701
702 TRACE_EVENT(ext4_sync_fs,
703         TP_PROTO(struct super_block *sb, int wait),
704
705         TP_ARGS(sb, wait),
706
707         TP_STRUCT__entry(
708                 __field(        dev_t,  dev                     )
709                 __field(        int,    wait                    )
710
711         ),
712
713         TP_fast_assign(
714                 __entry->dev    = sb->s_dev;
715                 __entry->wait   = wait;
716         ),
717
718         TP_printk("dev %s wait %d", jbd2_dev_to_name(__entry->dev),
719                   __entry->wait)
720 );
721
722 TRACE_EVENT(ext4_alloc_da_blocks,
723         TP_PROTO(struct inode *inode),
724
725         TP_ARGS(inode),
726
727         TP_STRUCT__entry(
728                 __field(        dev_t,  dev                     )
729                 __field(        ino_t,  ino                     )
730                 __field( unsigned int,  data_blocks     )
731                 __field( unsigned int,  meta_blocks     )
732         ),
733
734         TP_fast_assign(
735                 __entry->dev    = inode->i_sb->s_dev;
736                 __entry->ino    = inode->i_ino;
737                 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
738                 __entry->meta_blocks = EXT4_I(inode)->i_reserved_meta_blocks;
739         ),
740
741         TP_printk("dev %s ino %lu data_blocks %u meta_blocks %u",
742                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
743                   __entry->data_blocks, __entry->meta_blocks)
744 );
745
746 TRACE_EVENT(ext4_mballoc_alloc,
747         TP_PROTO(struct ext4_allocation_context *ac),
748
749         TP_ARGS(ac),
750
751         TP_STRUCT__entry(
752                 __field(        dev_t,  dev                     )
753                 __field(        ino_t,  ino                     )
754                 __field(        __u16,  found                   )
755                 __field(        __u16,  groups                  )
756                 __field(        __u16,  buddy                   )
757                 __field(        __u16,  flags                   )
758                 __field(        __u16,  tail                    )
759                 __field(        __u8,   cr                      )
760                 __field(        __u32,  orig_logical            )
761                 __field(          int,  orig_start              )
762                 __field(        __u32,  orig_group              )
763                 __field(          int,  orig_len                )
764                 __field(        __u32,  goal_logical            )
765                 __field(          int,  goal_start              )
766                 __field(        __u32,  goal_group              )
767                 __field(          int,  goal_len                )
768                 __field(        __u32,  result_logical          )
769                 __field(          int,  result_start            )
770                 __field(        __u32,  result_group            )
771                 __field(          int,  result_len              )
772         ),
773
774         TP_fast_assign(
775                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
776                 __entry->ino            = ac->ac_inode->i_ino;
777                 __entry->found          = ac->ac_found;
778                 __entry->flags          = ac->ac_flags;
779                 __entry->groups         = ac->ac_groups_scanned;
780                 __entry->buddy          = ac->ac_buddy;
781                 __entry->tail           = ac->ac_tail;
782                 __entry->cr             = ac->ac_criteria;
783                 __entry->orig_logical   = ac->ac_o_ex.fe_logical;
784                 __entry->orig_start     = ac->ac_o_ex.fe_start;
785                 __entry->orig_group     = ac->ac_o_ex.fe_group;
786                 __entry->orig_len       = ac->ac_o_ex.fe_len;
787                 __entry->goal_logical   = ac->ac_g_ex.fe_logical;
788                 __entry->goal_start     = ac->ac_g_ex.fe_start;
789                 __entry->goal_group     = ac->ac_g_ex.fe_group;
790                 __entry->goal_len       = ac->ac_g_ex.fe_len;
791                 __entry->result_logical = ac->ac_f_ex.fe_logical;
792                 __entry->result_start   = ac->ac_f_ex.fe_start;
793                 __entry->result_group   = ac->ac_f_ex.fe_group;
794                 __entry->result_len     = ac->ac_f_ex.fe_len;
795         ),
796
797         TP_printk("dev %s inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
798                   "result %u/%d/%u@%u blks %u grps %u cr %u flags 0x%04x "
799                   "tail %u broken %u",
800                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
801                   __entry->orig_group, __entry->orig_start,
802                   __entry->orig_len, __entry->orig_logical,
803                   __entry->goal_group, __entry->goal_start,
804                   __entry->goal_len, __entry->goal_logical,
805                   __entry->result_group, __entry->result_start,
806                   __entry->result_len, __entry->result_logical,
807                   __entry->found, __entry->groups, __entry->cr,
808                   __entry->flags, __entry->tail,
809                   __entry->buddy ? 1 << __entry->buddy : 0)
810 );
811
812 TRACE_EVENT(ext4_mballoc_prealloc,
813         TP_PROTO(struct ext4_allocation_context *ac),
814
815         TP_ARGS(ac),
816
817         TP_STRUCT__entry(
818                 __field(        dev_t,  dev                     )
819                 __field(        ino_t,  ino                     )
820                 __field(        __u32,  orig_logical            )
821                 __field(          int,  orig_start              )
822                 __field(        __u32,  orig_group              )
823                 __field(          int,  orig_len                )
824                 __field(        __u32,  result_logical          )
825                 __field(          int,  result_start            )
826                 __field(        __u32,  result_group            )
827                 __field(          int,  result_len              )
828         ),
829
830         TP_fast_assign(
831                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
832                 __entry->ino            = ac->ac_inode->i_ino;
833                 __entry->orig_logical   = ac->ac_o_ex.fe_logical;
834                 __entry->orig_start     = ac->ac_o_ex.fe_start;
835                 __entry->orig_group     = ac->ac_o_ex.fe_group;
836                 __entry->orig_len       = ac->ac_o_ex.fe_len;
837                 __entry->result_logical = ac->ac_b_ex.fe_logical;
838                 __entry->result_start   = ac->ac_b_ex.fe_start;
839                 __entry->result_group   = ac->ac_b_ex.fe_group;
840                 __entry->result_len     = ac->ac_b_ex.fe_len;
841         ),
842
843         TP_printk("dev %s inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
844                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
845                   __entry->orig_group, __entry->orig_start,
846                   __entry->orig_len, __entry->orig_logical,
847                   __entry->result_group, __entry->result_start,
848                   __entry->result_len, __entry->result_logical)
849 );
850
851 TRACE_EVENT(ext4_mballoc_discard,
852         TP_PROTO(struct ext4_allocation_context *ac),
853
854         TP_ARGS(ac),
855
856         TP_STRUCT__entry(
857                 __field(        dev_t,  dev                     )
858                 __field(        ino_t,  ino                     )
859                 __field(        __u32,  result_logical          )
860                 __field(          int,  result_start            )
861                 __field(        __u32,  result_group            )
862                 __field(          int,  result_len              )
863         ),
864
865         TP_fast_assign(
866                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
867                 __entry->ino            = ac->ac_inode->i_ino;
868                 __entry->result_logical = ac->ac_b_ex.fe_logical;
869                 __entry->result_start   = ac->ac_b_ex.fe_start;
870                 __entry->result_group   = ac->ac_b_ex.fe_group;
871                 __entry->result_len     = ac->ac_b_ex.fe_len;
872         ),
873
874         TP_printk("dev %s inode %lu extent %u/%d/%u@%u ",
875                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
876                   __entry->result_group, __entry->result_start,
877                   __entry->result_len, __entry->result_logical)
878 );
879
880 TRACE_EVENT(ext4_mballoc_free,
881         TP_PROTO(struct ext4_allocation_context *ac),
882
883         TP_ARGS(ac),
884
885         TP_STRUCT__entry(
886                 __field(        dev_t,  dev                     )
887                 __field(        ino_t,  ino                     )
888                 __field(        __u32,  result_logical          )
889                 __field(          int,  result_start            )
890                 __field(        __u32,  result_group            )
891                 __field(          int,  result_len              )
892         ),
893
894         TP_fast_assign(
895                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
896                 __entry->ino            = ac->ac_inode->i_ino;
897                 __entry->result_logical = ac->ac_b_ex.fe_logical;
898                 __entry->result_start   = ac->ac_b_ex.fe_start;
899                 __entry->result_group   = ac->ac_b_ex.fe_group;
900                 __entry->result_len     = ac->ac_b_ex.fe_len;
901         ),
902
903         TP_printk("dev %s inode %lu extent %u/%d/%u@%u ",
904                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
905                   __entry->result_group, __entry->result_start,
906                   __entry->result_len, __entry->result_logical)
907 );
908
909 #endif /* _TRACE_EXT4_H */
910
911 /* This part must be outside protection */
912 #include <trace/define_trace.h>