]> nv-tegra.nvidia Code Review - linux-2.6.git/blob - include/trace/events/ext4.h
ext4: Add a stub for mpage_da_data in the trace header
[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 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 %d 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 %d",
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 %d",
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,   encountered_congestion  )
314                 __field(        char,   more_io                 )       
315                 __field(        char,   no_nrwrite_index_update )
316                 __field(       pgoff_t, writeback_index         )
317         ),
318
319         TP_fast_assign(
320                 __entry->dev            = inode->i_sb->s_dev;
321                 __entry->ino            = inode->i_ino;
322                 __entry->ret            = ret;
323                 __entry->pages_written  = pages_written;
324                 __entry->pages_skipped  = wbc->pages_skipped;
325                 __entry->encountered_congestion = wbc->encountered_congestion;
326                 __entry->more_io        = wbc->more_io;
327                 __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update;
328                 __entry->writeback_index = inode->i_mapping->writeback_index;
329         ),
330
331         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",
332                   jbd2_dev_to_name(__entry->dev),
333                   (unsigned long) __entry->ino, __entry->ret,
334                   __entry->pages_written, __entry->pages_skipped,
335                   __entry->encountered_congestion, __entry->more_io,
336                   __entry->no_nrwrite_index_update,
337                   (unsigned long) __entry->writeback_index)
338 );
339
340 TRACE_EVENT(ext4_da_write_begin,
341         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
342                         unsigned int flags),
343
344         TP_ARGS(inode, pos, len, flags),
345
346         TP_STRUCT__entry(
347                 __field(        dev_t,  dev                     )
348                 __field(        ino_t,  ino                     )
349                 __field(        loff_t, pos                     )
350                 __field(        unsigned int, len               )
351                 __field(        unsigned int, flags             )
352         ),
353
354         TP_fast_assign(
355                 __entry->dev    = inode->i_sb->s_dev;
356                 __entry->ino    = inode->i_ino;
357                 __entry->pos    = pos;
358                 __entry->len    = len;
359                 __entry->flags  = flags;
360         ),
361
362         TP_printk("dev %s ino %lu pos %llu len %u flags %u",
363                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
364                   __entry->pos, __entry->len, __entry->flags)
365 );
366
367 TRACE_EVENT(ext4_da_write_end,
368         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
369                         unsigned int copied),
370
371         TP_ARGS(inode, pos, len, copied),
372
373         TP_STRUCT__entry(
374                 __field(        dev_t,  dev                     )
375                 __field(        ino_t,  ino                     )
376                 __field(        loff_t, pos                     )
377                 __field(        unsigned int, len               )
378                 __field(        unsigned int, copied            )
379         ),
380
381         TP_fast_assign(
382                 __entry->dev    = inode->i_sb->s_dev;
383                 __entry->ino    = inode->i_ino;
384                 __entry->pos    = pos;
385                 __entry->len    = len;
386                 __entry->copied = copied;
387         ),
388
389         TP_printk("dev %s ino %lu pos %llu len %u copied %u",
390                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
391                   __entry->pos, __entry->len, __entry->copied)
392 );
393
394 TRACE_EVENT(ext4_discard_blocks,
395         TP_PROTO(struct super_block *sb, unsigned long long blk,
396                         unsigned long long count),
397
398         TP_ARGS(sb, blk, count),
399
400         TP_STRUCT__entry(
401                 __field(        dev_t,  dev                     )
402                 __field(        __u64,  blk                     )
403                 __field(        __u64,  count                   )
404
405         ),
406
407         TP_fast_assign(
408                 __entry->dev    = sb->s_dev;
409                 __entry->blk    = blk;
410                 __entry->count  = count;
411         ),
412
413         TP_printk("dev %s blk %llu count %llu",
414                   jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count)
415 );
416
417 TRACE_EVENT(ext4_mb_new_inode_pa,
418         TP_PROTO(struct ext4_allocation_context *ac,
419                  struct ext4_prealloc_space *pa),
420
421         TP_ARGS(ac, pa),
422
423         TP_STRUCT__entry(
424                 __field(        dev_t,  dev                     )
425                 __field(        ino_t,  ino                     )
426                 __field(        __u64,  pa_pstart               )
427                 __field(        __u32,  pa_len                  )
428                 __field(        __u64,  pa_lstart               )
429
430         ),
431
432         TP_fast_assign(
433                 __entry->dev            = ac->ac_sb->s_dev;
434                 __entry->ino            = ac->ac_inode->i_ino;
435                 __entry->pa_pstart      = pa->pa_pstart;
436                 __entry->pa_len         = pa->pa_len;
437                 __entry->pa_lstart      = pa->pa_lstart;
438         ),
439
440         TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
441                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
442                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
443 );
444
445 TRACE_EVENT(ext4_mb_new_group_pa,
446         TP_PROTO(struct ext4_allocation_context *ac,
447                  struct ext4_prealloc_space *pa),
448
449         TP_ARGS(ac, pa),
450
451         TP_STRUCT__entry(
452                 __field(        dev_t,  dev                     )
453                 __field(        ino_t,  ino                     )
454                 __field(        __u64,  pa_pstart               )
455                 __field(        __u32,  pa_len                  )
456                 __field(        __u64,  pa_lstart               )
457
458         ),
459
460         TP_fast_assign(
461                 __entry->dev            = ac->ac_sb->s_dev;
462                 __entry->ino            = ac->ac_inode->i_ino;
463                 __entry->pa_pstart      = pa->pa_pstart;
464                 __entry->pa_len         = pa->pa_len;
465                 __entry->pa_lstart      = pa->pa_lstart;
466         ),
467
468         TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu",
469                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
470                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
471 );
472
473 TRACE_EVENT(ext4_mb_release_inode_pa,
474         TP_PROTO(struct ext4_allocation_context *ac,
475                  struct ext4_prealloc_space *pa,
476                  unsigned long long block, unsigned int count),
477
478         TP_ARGS(ac, pa, block, count),
479
480         TP_STRUCT__entry(
481                 __field(        dev_t,  dev                     )
482                 __field(        ino_t,  ino                     )
483                 __field(        __u64,  block                   )
484                 __field(        __u32,  count                   )
485
486         ),
487
488         TP_fast_assign(
489                 __entry->dev            = ac->ac_sb->s_dev;
490                 __entry->ino            = ac->ac_inode->i_ino;
491                 __entry->block          = block;
492                 __entry->count          = count;
493         ),
494
495         TP_printk("dev %s ino %lu block %llu count %u",
496                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
497                   __entry->block, __entry->count)
498 );
499
500 TRACE_EVENT(ext4_mb_release_group_pa,
501         TP_PROTO(struct ext4_allocation_context *ac,
502                  struct ext4_prealloc_space *pa),
503
504         TP_ARGS(ac, pa),
505
506         TP_STRUCT__entry(
507                 __field(        dev_t,  dev                     )
508                 __field(        ino_t,  ino                     )
509                 __field(        __u64,  pa_pstart               )
510                 __field(        __u32,  pa_len                  )
511
512         ),
513
514         TP_fast_assign(
515                 __entry->dev            = ac->ac_sb->s_dev;
516                 __entry->ino            = ac->ac_inode->i_ino;
517                 __entry->pa_pstart      = pa->pa_pstart;
518                 __entry->pa_len         = pa->pa_len;
519         ),
520
521         TP_printk("dev %s pstart %llu len %u",
522                   jbd2_dev_to_name(__entry->dev), __entry->pa_pstart, __entry->pa_len)
523 );
524
525 TRACE_EVENT(ext4_discard_preallocations,
526         TP_PROTO(struct inode *inode),
527
528         TP_ARGS(inode),
529
530         TP_STRUCT__entry(
531                 __field(        dev_t,  dev                     )
532                 __field(        ino_t,  ino                     )
533
534         ),
535
536         TP_fast_assign(
537                 __entry->dev    = inode->i_sb->s_dev;
538                 __entry->ino    = inode->i_ino;
539         ),
540
541         TP_printk("dev %s ino %lu",
542                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino)
543 );
544
545 TRACE_EVENT(ext4_mb_discard_preallocations,
546         TP_PROTO(struct super_block *sb, int needed),
547
548         TP_ARGS(sb, needed),
549
550         TP_STRUCT__entry(
551                 __field(        dev_t,  dev                     )
552                 __field(        int,    needed                  )
553
554         ),
555
556         TP_fast_assign(
557                 __entry->dev    = sb->s_dev;
558                 __entry->needed = needed;
559         ),
560
561         TP_printk("dev %s needed %d",
562                   jbd2_dev_to_name(__entry->dev), __entry->needed)
563 );
564
565 TRACE_EVENT(ext4_request_blocks,
566         TP_PROTO(struct ext4_allocation_request *ar),
567
568         TP_ARGS(ar),
569
570         TP_STRUCT__entry(
571                 __field(        dev_t,  dev                     )
572                 __field(        ino_t,  ino                     )
573                 __field(        unsigned int, flags             )
574                 __field(        unsigned int, len               )
575                 __field(        __u64,  logical                 )
576                 __field(        __u64,  goal                    )
577                 __field(        __u64,  lleft                   )
578                 __field(        __u64,  lright                  )
579                 __field(        __u64,  pleft                   )
580                 __field(        __u64,  pright                  )
581         ),
582
583         TP_fast_assign(
584                 __entry->dev    = ar->inode->i_sb->s_dev;
585                 __entry->ino    = ar->inode->i_ino;
586                 __entry->flags  = ar->flags;
587                 __entry->len    = ar->len;
588                 __entry->logical = ar->logical;
589                 __entry->goal   = ar->goal;
590                 __entry->lleft  = ar->lleft;
591                 __entry->lright = ar->lright;
592                 __entry->pleft  = ar->pleft;
593                 __entry->pright = ar->pright;
594         ),
595
596         TP_printk("dev %s ino %lu flags %u len %u lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
597                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
598                   __entry->flags, __entry->len,
599                   (unsigned long long) __entry->logical,
600                   (unsigned long long) __entry->goal,
601                   (unsigned long long) __entry->lleft,
602                   (unsigned long long) __entry->lright,
603                   (unsigned long long) __entry->pleft,
604                   (unsigned long long) __entry->pright)
605 );
606
607 TRACE_EVENT(ext4_allocate_blocks,
608         TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
609
610         TP_ARGS(ar, block),
611
612         TP_STRUCT__entry(
613                 __field(        dev_t,  dev                     )
614                 __field(        ino_t,  ino                     )
615                 __field(        __u64,  block                   )
616                 __field(        unsigned int, flags             )
617                 __field(        unsigned int, len               )
618                 __field(        __u64,  logical                 )
619                 __field(        __u64,  goal                    )
620                 __field(        __u64,  lleft                   )
621                 __field(        __u64,  lright                  )
622                 __field(        __u64,  pleft                   )
623                 __field(        __u64,  pright                  )
624         ),
625
626         TP_fast_assign(
627                 __entry->dev    = ar->inode->i_sb->s_dev;
628                 __entry->ino    = ar->inode->i_ino;
629                 __entry->block  = block;
630                 __entry->flags  = ar->flags;
631                 __entry->len    = ar->len;
632                 __entry->logical = ar->logical;
633                 __entry->goal   = ar->goal;
634                 __entry->lleft  = ar->lleft;
635                 __entry->lright = ar->lright;
636                 __entry->pleft  = ar->pleft;
637                 __entry->pright = ar->pright;
638         ),
639
640         TP_printk("dev %s ino %lu flags %u len %u block %llu lblk %llu goal %llu lleft %llu lright %llu pleft %llu pright %llu ",
641                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
642                   __entry->flags, __entry->len, __entry->block,
643                   (unsigned long long) __entry->logical,
644                   (unsigned long long) __entry->goal,
645                   (unsigned long long) __entry->lleft,
646                   (unsigned long long) __entry->lright,
647                   (unsigned long long) __entry->pleft,
648                   (unsigned long long) __entry->pright)
649 );
650
651 TRACE_EVENT(ext4_free_blocks,
652         TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
653                         int metadata),
654
655         TP_ARGS(inode, block, count, metadata),
656
657         TP_STRUCT__entry(
658                 __field(        dev_t,  dev                     )
659                 __field(        ino_t,  ino                     )
660                 __field(        __u64,  block                   )
661                 __field(        unsigned long,  count           )
662                 __field(        int,    metadata                )
663
664         ),
665
666         TP_fast_assign(
667                 __entry->dev            = inode->i_sb->s_dev;
668                 __entry->ino            = inode->i_ino;
669                 __entry->block          = block;
670                 __entry->count          = count;
671                 __entry->metadata       = metadata;
672         ),
673
674         TP_printk("dev %s ino %lu block %llu count %lu metadata %d",
675                   jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino,
676                   __entry->block, __entry->count, __entry->metadata)
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 #endif /* _TRACE_EXT4_H */
911
912 /* This part must be outside protection */
913 #include <trace/define_trace.h>