~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/trace/events/ext4.h

Version: ~ [ linux-5.15-rc1 ] ~ [ linux-5.14.5 ] ~ [ linux-5.13.18 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.66 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.147 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.206 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.246 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.282 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.283 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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_extent;
 13 struct ext4_prealloc_space;
 14 struct ext4_inode_info;
 15 struct mpage_da_data;
 16 struct ext4_map_blocks;
 17 struct extent_status;
 18 struct ext4_fsmap;
 19 
 20 #define EXT4_I(inode) (container_of(inode, struct ext4_inode_info, vfs_inode))
 21 
 22 #define show_mballoc_flags(flags) __print_flags(flags, "|",     \
 23         { EXT4_MB_HINT_MERGE,           "HINT_MERGE" },         \
 24         { EXT4_MB_HINT_RESERVED,        "HINT_RESV" },          \
 25         { EXT4_MB_HINT_METADATA,        "HINT_MDATA" },         \
 26         { EXT4_MB_HINT_FIRST,           "HINT_FIRST" },         \
 27         { EXT4_MB_HINT_BEST,            "HINT_BEST" },          \
 28         { EXT4_MB_HINT_DATA,            "HINT_DATA" },          \
 29         { EXT4_MB_HINT_NOPREALLOC,      "HINT_NOPREALLOC" },    \
 30         { EXT4_MB_HINT_GROUP_ALLOC,     "HINT_GRP_ALLOC" },     \
 31         { EXT4_MB_HINT_GOAL_ONLY,       "HINT_GOAL_ONLY" },     \
 32         { EXT4_MB_HINT_TRY_GOAL,        "HINT_TRY_GOAL" },      \
 33         { EXT4_MB_DELALLOC_RESERVED,    "DELALLOC_RESV" },      \
 34         { EXT4_MB_STREAM_ALLOC,         "STREAM_ALLOC" },       \
 35         { EXT4_MB_USE_ROOT_BLOCKS,      "USE_ROOT_BLKS" },      \
 36         { EXT4_MB_USE_RESERVED,         "USE_RESV" })
 37 
 38 #define show_map_flags(flags) __print_flags(flags, "|",                 \
 39         { EXT4_GET_BLOCKS_CREATE,               "CREATE" },             \
 40         { EXT4_GET_BLOCKS_UNWRIT_EXT,           "UNWRIT" },             \
 41         { EXT4_GET_BLOCKS_DELALLOC_RESERVE,     "DELALLOC" },           \
 42         { EXT4_GET_BLOCKS_PRE_IO,               "PRE_IO" },             \
 43         { EXT4_GET_BLOCKS_CONVERT,              "CONVERT" },            \
 44         { EXT4_GET_BLOCKS_METADATA_NOFAIL,      "METADATA_NOFAIL" },    \
 45         { EXT4_GET_BLOCKS_NO_NORMALIZE,         "NO_NORMALIZE" },       \
 46         { EXT4_GET_BLOCKS_KEEP_SIZE,            "KEEP_SIZE" },          \
 47         { EXT4_GET_BLOCKS_ZERO,                 "ZERO" })
 48 
 49 #define show_mflags(flags) __print_flags(flags, "",     \
 50         { EXT4_MAP_NEW,         "N" },                  \
 51         { EXT4_MAP_MAPPED,      "M" },                  \
 52         { EXT4_MAP_UNWRITTEN,   "U" },                  \
 53         { EXT4_MAP_BOUNDARY,    "B" })
 54 
 55 #define show_free_flags(flags) __print_flags(flags, "|",        \
 56         { EXT4_FREE_BLOCKS_METADATA,            "METADATA" },   \
 57         { EXT4_FREE_BLOCKS_FORGET,              "FORGET" },     \
 58         { EXT4_FREE_BLOCKS_VALIDATED,           "VALIDATED" },  \
 59         { EXT4_FREE_BLOCKS_NO_QUOT_UPDATE,      "NO_QUOTA" },   \
 60         { EXT4_FREE_BLOCKS_NOFREE_FIRST_CLUSTER,"1ST_CLUSTER" },\
 61         { EXT4_FREE_BLOCKS_NOFREE_LAST_CLUSTER, "LAST_CLUSTER" })
 62 
 63 #define show_extent_status(status) __print_flags(status, "",    \
 64         { EXTENT_STATUS_WRITTEN,        "W" },                  \
 65         { EXTENT_STATUS_UNWRITTEN,      "U" },                  \
 66         { EXTENT_STATUS_DELAYED,        "D" },                  \
 67         { EXTENT_STATUS_HOLE,           "H" })
 68 
 69 #define show_falloc_mode(mode) __print_flags(mode, "|",         \
 70         { FALLOC_FL_KEEP_SIZE,          "KEEP_SIZE"},           \
 71         { FALLOC_FL_PUNCH_HOLE,         "PUNCH_HOLE"},          \
 72         { FALLOC_FL_NO_HIDE_STALE,      "NO_HIDE_STALE"},       \
 73         { FALLOC_FL_COLLAPSE_RANGE,     "COLLAPSE_RANGE"},      \
 74         { FALLOC_FL_ZERO_RANGE,         "ZERO_RANGE"})
 75 
 76 
 77 TRACE_EVENT(ext4_other_inode_update_time,
 78         TP_PROTO(struct inode *inode, ino_t orig_ino),
 79 
 80         TP_ARGS(inode, orig_ino),
 81 
 82         TP_STRUCT__entry(
 83                 __field(        dev_t,  dev                     )
 84                 __field(        ino_t,  ino                     )
 85                 __field(        ino_t,  orig_ino                )
 86                 __field(        uid_t,  uid                     )
 87                 __field(        gid_t,  gid                     )
 88                 __field(        __u16, mode                     )
 89         ),
 90 
 91         TP_fast_assign(
 92                 __entry->orig_ino = orig_ino;
 93                 __entry->dev    = inode->i_sb->s_dev;
 94                 __entry->ino    = inode->i_ino;
 95                 __entry->uid    = i_uid_read(inode);
 96                 __entry->gid    = i_gid_read(inode);
 97                 __entry->mode   = inode->i_mode;
 98         ),
 99 
100         TP_printk("dev %d,%d orig_ino %lu ino %lu mode 0%o uid %u gid %u",
101                   MAJOR(__entry->dev), MINOR(__entry->dev),
102                   (unsigned long) __entry->orig_ino,
103                   (unsigned long) __entry->ino, __entry->mode,
104                   __entry->uid, __entry->gid)
105 );
106 
107 TRACE_EVENT(ext4_free_inode,
108         TP_PROTO(struct inode *inode),
109 
110         TP_ARGS(inode),
111 
112         TP_STRUCT__entry(
113                 __field(        dev_t,  dev                     )
114                 __field(        ino_t,  ino                     )
115                 __field(        uid_t,  uid                     )
116                 __field(        gid_t,  gid                     )
117                 __field(        __u64, blocks                   )
118                 __field(        __u16, mode                     )
119         ),
120 
121         TP_fast_assign(
122                 __entry->dev    = inode->i_sb->s_dev;
123                 __entry->ino    = inode->i_ino;
124                 __entry->uid    = i_uid_read(inode);
125                 __entry->gid    = i_gid_read(inode);
126                 __entry->blocks = inode->i_blocks;
127                 __entry->mode   = inode->i_mode;
128         ),
129 
130         TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
131                   MAJOR(__entry->dev), MINOR(__entry->dev),
132                   (unsigned long) __entry->ino, __entry->mode,
133                   __entry->uid, __entry->gid, __entry->blocks)
134 );
135 
136 TRACE_EVENT(ext4_request_inode,
137         TP_PROTO(struct inode *dir, int mode),
138 
139         TP_ARGS(dir, mode),
140 
141         TP_STRUCT__entry(
142                 __field(        dev_t,  dev                     )
143                 __field(        ino_t,  dir                     )
144                 __field(        __u16, mode                     )
145         ),
146 
147         TP_fast_assign(
148                 __entry->dev    = dir->i_sb->s_dev;
149                 __entry->dir    = dir->i_ino;
150                 __entry->mode   = mode;
151         ),
152 
153         TP_printk("dev %d,%d dir %lu mode 0%o",
154                   MAJOR(__entry->dev), MINOR(__entry->dev),
155                   (unsigned long) __entry->dir, __entry->mode)
156 );
157 
158 TRACE_EVENT(ext4_allocate_inode,
159         TP_PROTO(struct inode *inode, struct inode *dir, int mode),
160 
161         TP_ARGS(inode, dir, mode),
162 
163         TP_STRUCT__entry(
164                 __field(        dev_t,  dev                     )
165                 __field(        ino_t,  ino                     )
166                 __field(        ino_t,  dir                     )
167                 __field(        __u16,  mode                    )
168         ),
169 
170         TP_fast_assign(
171                 __entry->dev    = inode->i_sb->s_dev;
172                 __entry->ino    = inode->i_ino;
173                 __entry->dir    = dir->i_ino;
174                 __entry->mode   = mode;
175         ),
176 
177         TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
178                   MAJOR(__entry->dev), MINOR(__entry->dev),
179                   (unsigned long) __entry->ino,
180                   (unsigned long) __entry->dir, __entry->mode)
181 );
182 
183 TRACE_EVENT(ext4_evict_inode,
184         TP_PROTO(struct inode *inode),
185 
186         TP_ARGS(inode),
187 
188         TP_STRUCT__entry(
189                 __field(        dev_t,  dev                     )
190                 __field(        ino_t,  ino                     )
191                 __field(        int,    nlink                   )
192         ),
193 
194         TP_fast_assign(
195                 __entry->dev    = inode->i_sb->s_dev;
196                 __entry->ino    = inode->i_ino;
197                 __entry->nlink  = inode->i_nlink;
198         ),
199 
200         TP_printk("dev %d,%d ino %lu nlink %d",
201                   MAJOR(__entry->dev), MINOR(__entry->dev),
202                   (unsigned long) __entry->ino, __entry->nlink)
203 );
204 
205 TRACE_EVENT(ext4_drop_inode,
206         TP_PROTO(struct inode *inode, int drop),
207 
208         TP_ARGS(inode, drop),
209 
210         TP_STRUCT__entry(
211                 __field(        dev_t,  dev                     )
212                 __field(        ino_t,  ino                     )
213                 __field(        int,    drop                    )
214         ),
215 
216         TP_fast_assign(
217                 __entry->dev    = inode->i_sb->s_dev;
218                 __entry->ino    = inode->i_ino;
219                 __entry->drop   = drop;
220         ),
221 
222         TP_printk("dev %d,%d ino %lu drop %d",
223                   MAJOR(__entry->dev), MINOR(__entry->dev),
224                   (unsigned long) __entry->ino, __entry->drop)
225 );
226 
227 TRACE_EVENT(ext4_mark_inode_dirty,
228         TP_PROTO(struct inode *inode, unsigned long IP),
229 
230         TP_ARGS(inode, IP),
231 
232         TP_STRUCT__entry(
233                 __field(        dev_t,  dev                     )
234                 __field(        ino_t,  ino                     )
235                 __field(unsigned long,  ip                      )
236         ),
237 
238         TP_fast_assign(
239                 __entry->dev    = inode->i_sb->s_dev;
240                 __entry->ino    = inode->i_ino;
241                 __entry->ip     = IP;
242         ),
243 
244         TP_printk("dev %d,%d ino %lu caller %pS",
245                   MAJOR(__entry->dev), MINOR(__entry->dev),
246                   (unsigned long) __entry->ino, (void *)__entry->ip)
247 );
248 
249 TRACE_EVENT(ext4_begin_ordered_truncate,
250         TP_PROTO(struct inode *inode, loff_t new_size),
251 
252         TP_ARGS(inode, new_size),
253 
254         TP_STRUCT__entry(
255                 __field(        dev_t,  dev                     )
256                 __field(        ino_t,  ino                     )
257                 __field(        loff_t, new_size                )
258         ),
259 
260         TP_fast_assign(
261                 __entry->dev            = inode->i_sb->s_dev;
262                 __entry->ino            = inode->i_ino;
263                 __entry->new_size       = new_size;
264         ),
265 
266         TP_printk("dev %d,%d ino %lu new_size %lld",
267                   MAJOR(__entry->dev), MINOR(__entry->dev),
268                   (unsigned long) __entry->ino,
269                   __entry->new_size)
270 );
271 
272 DECLARE_EVENT_CLASS(ext4__write_begin,
273 
274         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
275                  unsigned int flags),
276 
277         TP_ARGS(inode, pos, len, flags),
278 
279         TP_STRUCT__entry(
280                 __field(        dev_t,  dev                     )
281                 __field(        ino_t,  ino                     )
282                 __field(        loff_t, pos                     )
283                 __field(        unsigned int, len               )
284                 __field(        unsigned int, flags             )
285         ),
286 
287         TP_fast_assign(
288                 __entry->dev    = inode->i_sb->s_dev;
289                 __entry->ino    = inode->i_ino;
290                 __entry->pos    = pos;
291                 __entry->len    = len;
292                 __entry->flags  = flags;
293         ),
294 
295         TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
296                   MAJOR(__entry->dev), MINOR(__entry->dev),
297                   (unsigned long) __entry->ino,
298                   __entry->pos, __entry->len, __entry->flags)
299 );
300 
301 DEFINE_EVENT(ext4__write_begin, ext4_write_begin,
302 
303         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
304                  unsigned int flags),
305 
306         TP_ARGS(inode, pos, len, flags)
307 );
308 
309 DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin,
310 
311         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
312                  unsigned int flags),
313 
314         TP_ARGS(inode, pos, len, flags)
315 );
316 
317 DECLARE_EVENT_CLASS(ext4__write_end,
318         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
319                         unsigned int copied),
320 
321         TP_ARGS(inode, pos, len, copied),
322 
323         TP_STRUCT__entry(
324                 __field(        dev_t,  dev                     )
325                 __field(        ino_t,  ino                     )
326                 __field(        loff_t, pos                     )
327                 __field(        unsigned int, len               )
328                 __field(        unsigned int, copied            )
329         ),
330 
331         TP_fast_assign(
332                 __entry->dev    = inode->i_sb->s_dev;
333                 __entry->ino    = inode->i_ino;
334                 __entry->pos    = pos;
335                 __entry->len    = len;
336                 __entry->copied = copied;
337         ),
338 
339         TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
340                   MAJOR(__entry->dev), MINOR(__entry->dev),
341                   (unsigned long) __entry->ino,
342                   __entry->pos, __entry->len, __entry->copied)
343 );
344 
345 DEFINE_EVENT(ext4__write_end, ext4_write_end,
346 
347         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
348                  unsigned int copied),
349 
350         TP_ARGS(inode, pos, len, copied)
351 );
352 
353 DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end,
354 
355         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
356                  unsigned int copied),
357 
358         TP_ARGS(inode, pos, len, copied)
359 );
360 
361 DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
362 
363         TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
364                  unsigned int copied),
365 
366         TP_ARGS(inode, pos, len, copied)
367 );
368 
369 TRACE_EVENT(ext4_writepages,
370         TP_PROTO(struct inode *inode, struct writeback_control *wbc),
371 
372         TP_ARGS(inode, wbc),
373 
374         TP_STRUCT__entry(
375                 __field(        dev_t,  dev                     )
376                 __field(        ino_t,  ino                     )
377                 __field(        long,   nr_to_write             )
378                 __field(        long,   pages_skipped           )
379                 __field(        loff_t, range_start             )
380                 __field(        loff_t, range_end               )
381                 __field(       pgoff_t, writeback_index         )
382                 __field(        int,    sync_mode               )
383                 __field(        char,   for_kupdate             )
384                 __field(        char,   range_cyclic            )
385         ),
386 
387         TP_fast_assign(
388                 __entry->dev            = inode->i_sb->s_dev;
389                 __entry->ino            = inode->i_ino;
390                 __entry->nr_to_write    = wbc->nr_to_write;
391                 __entry->pages_skipped  = wbc->pages_skipped;
392                 __entry->range_start    = wbc->range_start;
393                 __entry->range_end      = wbc->range_end;
394                 __entry->writeback_index = inode->i_mapping->writeback_index;
395                 __entry->sync_mode      = wbc->sync_mode;
396                 __entry->for_kupdate    = wbc->for_kupdate;
397                 __entry->range_cyclic   = wbc->range_cyclic;
398         ),
399 
400         TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
401                   "range_start %lld range_end %lld sync_mode %d "
402                   "for_kupdate %d range_cyclic %d writeback_index %lu",
403                   MAJOR(__entry->dev), MINOR(__entry->dev),
404                   (unsigned long) __entry->ino, __entry->nr_to_write,
405                   __entry->pages_skipped, __entry->range_start,
406                   __entry->range_end, __entry->sync_mode,
407                   __entry->for_kupdate, __entry->range_cyclic,
408                   (unsigned long) __entry->writeback_index)
409 );
410 
411 TRACE_EVENT(ext4_da_write_pages,
412         TP_PROTO(struct inode *inode, pgoff_t first_page,
413                  struct writeback_control *wbc),
414 
415         TP_ARGS(inode, first_page, wbc),
416 
417         TP_STRUCT__entry(
418                 __field(        dev_t,  dev                     )
419                 __field(        ino_t,  ino                     )
420                 __field(      pgoff_t,  first_page              )
421                 __field(         long,  nr_to_write             )
422                 __field(          int,  sync_mode               )
423         ),
424 
425         TP_fast_assign(
426                 __entry->dev            = inode->i_sb->s_dev;
427                 __entry->ino            = inode->i_ino;
428                 __entry->first_page     = first_page;
429                 __entry->nr_to_write    = wbc->nr_to_write;
430                 __entry->sync_mode      = wbc->sync_mode;
431         ),
432 
433         TP_printk("dev %d,%d ino %lu first_page %lu nr_to_write %ld "
434                   "sync_mode %d",
435                   MAJOR(__entry->dev), MINOR(__entry->dev),
436                   (unsigned long) __entry->ino, __entry->first_page,
437                   __entry->nr_to_write, __entry->sync_mode)
438 );
439 
440 TRACE_EVENT(ext4_da_write_pages_extent,
441         TP_PROTO(struct inode *inode, struct ext4_map_blocks *map),
442 
443         TP_ARGS(inode, map),
444 
445         TP_STRUCT__entry(
446                 __field(        dev_t,  dev                     )
447                 __field(        ino_t,  ino                     )
448                 __field(        __u64,  lblk                    )
449                 __field(        __u32,  len                     )
450                 __field(        __u32,  flags                   )
451         ),
452 
453         TP_fast_assign(
454                 __entry->dev            = inode->i_sb->s_dev;
455                 __entry->ino            = inode->i_ino;
456                 __entry->lblk           = map->m_lblk;
457                 __entry->len            = map->m_len;
458                 __entry->flags          = map->m_flags;
459         ),
460 
461         TP_printk("dev %d,%d ino %lu lblk %llu len %u flags %s",
462                   MAJOR(__entry->dev), MINOR(__entry->dev),
463                   (unsigned long) __entry->ino, __entry->lblk, __entry->len,
464                   show_mflags(__entry->flags))
465 );
466 
467 TRACE_EVENT(ext4_writepages_result,
468         TP_PROTO(struct inode *inode, struct writeback_control *wbc,
469                         int ret, int pages_written),
470 
471         TP_ARGS(inode, wbc, ret, pages_written),
472 
473         TP_STRUCT__entry(
474                 __field(        dev_t,  dev                     )
475                 __field(        ino_t,  ino                     )
476                 __field(        int,    ret                     )
477                 __field(        int,    pages_written           )
478                 __field(        long,   pages_skipped           )
479                 __field(       pgoff_t, writeback_index         )
480                 __field(        int,    sync_mode               )
481         ),
482 
483         TP_fast_assign(
484                 __entry->dev            = inode->i_sb->s_dev;
485                 __entry->ino            = inode->i_ino;
486                 __entry->ret            = ret;
487                 __entry->pages_written  = pages_written;
488                 __entry->pages_skipped  = wbc->pages_skipped;
489                 __entry->writeback_index = inode->i_mapping->writeback_index;
490                 __entry->sync_mode      = wbc->sync_mode;
491         ),
492 
493         TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
494                   "sync_mode %d writeback_index %lu",
495                   MAJOR(__entry->dev), MINOR(__entry->dev),
496                   (unsigned long) __entry->ino, __entry->ret,
497                   __entry->pages_written, __entry->pages_skipped,
498                   __entry->sync_mode,
499                   (unsigned long) __entry->writeback_index)
500 );
501 
502 DECLARE_EVENT_CLASS(ext4__page_op,
503         TP_PROTO(struct page *page),
504 
505         TP_ARGS(page),
506 
507         TP_STRUCT__entry(
508                 __field(        dev_t,  dev                     )
509                 __field(        ino_t,  ino                     )
510                 __field(        pgoff_t, index                  )
511 
512         ),
513 
514         TP_fast_assign(
515                 __entry->dev    = page->mapping->host->i_sb->s_dev;
516                 __entry->ino    = page->mapping->host->i_ino;
517                 __entry->index  = page->index;
518         ),
519 
520         TP_printk("dev %d,%d ino %lu page_index %lu",
521                   MAJOR(__entry->dev), MINOR(__entry->dev),
522                   (unsigned long) __entry->ino,
523                   (unsigned long) __entry->index)
524 );
525 
526 DEFINE_EVENT(ext4__page_op, ext4_writepage,
527 
528         TP_PROTO(struct page *page),
529 
530         TP_ARGS(page)
531 );
532 
533 DEFINE_EVENT(ext4__page_op, ext4_readpage,
534 
535         TP_PROTO(struct page *page),
536 
537         TP_ARGS(page)
538 );
539 
540 DEFINE_EVENT(ext4__page_op, ext4_releasepage,
541 
542         TP_PROTO(struct page *page),
543 
544         TP_ARGS(page)
545 );
546 
547 DECLARE_EVENT_CLASS(ext4_invalidatepage_op,
548         TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
549 
550         TP_ARGS(page, offset, length),
551 
552         TP_STRUCT__entry(
553                 __field(        dev_t,  dev                     )
554                 __field(        ino_t,  ino                     )
555                 __field(        pgoff_t, index                  )
556                 __field(        unsigned int, offset            )
557                 __field(        unsigned int, length            )
558         ),
559 
560         TP_fast_assign(
561                 __entry->dev    = page->mapping->host->i_sb->s_dev;
562                 __entry->ino    = page->mapping->host->i_ino;
563                 __entry->index  = page->index;
564                 __entry->offset = offset;
565                 __entry->length = length;
566         ),
567 
568         TP_printk("dev %d,%d ino %lu page_index %lu offset %u length %u",
569                   MAJOR(__entry->dev), MINOR(__entry->dev),
570                   (unsigned long) __entry->ino,
571                   (unsigned long) __entry->index,
572                   __entry->offset, __entry->length)
573 );
574 
575 DEFINE_EVENT(ext4_invalidatepage_op, ext4_invalidatepage,
576         TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
577 
578         TP_ARGS(page, offset, length)
579 );
580 
581 DEFINE_EVENT(ext4_invalidatepage_op, ext4_journalled_invalidatepage,
582         TP_PROTO(struct page *page, unsigned int offset, unsigned int length),
583 
584         TP_ARGS(page, offset, length)
585 );
586 
587 TRACE_EVENT(ext4_discard_blocks,
588         TP_PROTO(struct super_block *sb, unsigned long long blk,
589                         unsigned long long count),
590 
591         TP_ARGS(sb, blk, count),
592 
593         TP_STRUCT__entry(
594                 __field(        dev_t,  dev                     )
595                 __field(        __u64,  blk                     )
596                 __field(        __u64,  count                   )
597 
598         ),
599 
600         TP_fast_assign(
601                 __entry->dev    = sb->s_dev;
602                 __entry->blk    = blk;
603                 __entry->count  = count;
604         ),
605 
606         TP_printk("dev %d,%d blk %llu count %llu",
607                   MAJOR(__entry->dev), MINOR(__entry->dev),
608                   __entry->blk, __entry->count)
609 );
610 
611 DECLARE_EVENT_CLASS(ext4__mb_new_pa,
612         TP_PROTO(struct ext4_allocation_context *ac,
613                  struct ext4_prealloc_space *pa),
614 
615         TP_ARGS(ac, pa),
616 
617         TP_STRUCT__entry(
618                 __field(        dev_t,  dev                     )
619                 __field(        ino_t,  ino                     )
620                 __field(        __u64,  pa_pstart               )
621                 __field(        __u64,  pa_lstart               )
622                 __field(        __u32,  pa_len                  )
623 
624         ),
625 
626         TP_fast_assign(
627                 __entry->dev            = ac->ac_sb->s_dev;
628                 __entry->ino            = ac->ac_inode->i_ino;
629                 __entry->pa_pstart      = pa->pa_pstart;
630                 __entry->pa_lstart      = pa->pa_lstart;
631                 __entry->pa_len         = pa->pa_len;
632         ),
633 
634         TP_printk("dev %d,%d ino %lu pstart %llu len %u lstart %llu",
635                   MAJOR(__entry->dev), MINOR(__entry->dev),
636                   (unsigned long) __entry->ino,
637                   __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart)
638 );
639 
640 DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa,
641 
642         TP_PROTO(struct ext4_allocation_context *ac,
643                  struct ext4_prealloc_space *pa),
644 
645         TP_ARGS(ac, pa)
646 );
647 
648 DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
649 
650         TP_PROTO(struct ext4_allocation_context *ac,
651                  struct ext4_prealloc_space *pa),
652 
653         TP_ARGS(ac, pa)
654 );
655 
656 TRACE_EVENT(ext4_mb_release_inode_pa,
657         TP_PROTO(struct ext4_prealloc_space *pa,
658                  unsigned long long block, unsigned int count),
659 
660         TP_ARGS(pa, block, count),
661 
662         TP_STRUCT__entry(
663                 __field(        dev_t,  dev                     )
664                 __field(        ino_t,  ino                     )
665                 __field(        __u64,  block                   )
666                 __field(        __u32,  count                   )
667 
668         ),
669 
670         TP_fast_assign(
671                 __entry->dev            = pa->pa_inode->i_sb->s_dev;
672                 __entry->ino            = pa->pa_inode->i_ino;
673                 __entry->block          = block;
674                 __entry->count          = count;
675         ),
676 
677         TP_printk("dev %d,%d ino %lu block %llu count %u",
678                   MAJOR(__entry->dev), MINOR(__entry->dev),
679                   (unsigned long) __entry->ino,
680                   __entry->block, __entry->count)
681 );
682 
683 TRACE_EVENT(ext4_mb_release_group_pa,
684         TP_PROTO(struct super_block *sb, struct ext4_prealloc_space *pa),
685 
686         TP_ARGS(sb, pa),
687 
688         TP_STRUCT__entry(
689                 __field(        dev_t,  dev                     )
690                 __field(        __u64,  pa_pstart               )
691                 __field(        __u32,  pa_len                  )
692 
693         ),
694 
695         TP_fast_assign(
696                 __entry->dev            = sb->s_dev;
697                 __entry->pa_pstart      = pa->pa_pstart;
698                 __entry->pa_len         = pa->pa_len;
699         ),
700 
701         TP_printk("dev %d,%d pstart %llu len %u",
702                   MAJOR(__entry->dev), MINOR(__entry->dev),
703                   __entry->pa_pstart, __entry->pa_len)
704 );
705 
706 TRACE_EVENT(ext4_discard_preallocations,
707         TP_PROTO(struct inode *inode),
708 
709         TP_ARGS(inode),
710 
711         TP_STRUCT__entry(
712                 __field(        dev_t,  dev                     )
713                 __field(        ino_t,  ino                     )
714 
715         ),
716 
717         TP_fast_assign(
718                 __entry->dev    = inode->i_sb->s_dev;
719                 __entry->ino    = inode->i_ino;
720         ),
721 
722         TP_printk("dev %d,%d ino %lu",
723                   MAJOR(__entry->dev), MINOR(__entry->dev),
724                   (unsigned long) __entry->ino)
725 );
726 
727 TRACE_EVENT(ext4_mb_discard_preallocations,
728         TP_PROTO(struct super_block *sb, int needed),
729 
730         TP_ARGS(sb, needed),
731 
732         TP_STRUCT__entry(
733                 __field(        dev_t,  dev                     )
734                 __field(        int,    needed                  )
735 
736         ),
737 
738         TP_fast_assign(
739                 __entry->dev    = sb->s_dev;
740                 __entry->needed = needed;
741         ),
742 
743         TP_printk("dev %d,%d needed %d",
744                   MAJOR(__entry->dev), MINOR(__entry->dev),
745                   __entry->needed)
746 );
747 
748 TRACE_EVENT(ext4_request_blocks,
749         TP_PROTO(struct ext4_allocation_request *ar),
750 
751         TP_ARGS(ar),
752 
753         TP_STRUCT__entry(
754                 __field(        dev_t,  dev                     )
755                 __field(        ino_t,  ino                     )
756                 __field(        unsigned int, len               )
757                 __field(        __u32,  logical                 )
758                 __field(        __u32,  lleft                   )
759                 __field(        __u32,  lright                  )
760                 __field(        __u64,  goal                    )
761                 __field(        __u64,  pleft                   )
762                 __field(        __u64,  pright                  )
763                 __field(        unsigned int, flags             )
764         ),
765 
766         TP_fast_assign(
767                 __entry->dev    = ar->inode->i_sb->s_dev;
768                 __entry->ino    = ar->inode->i_ino;
769                 __entry->len    = ar->len;
770                 __entry->logical = ar->logical;
771                 __entry->goal   = ar->goal;
772                 __entry->lleft  = ar->lleft;
773                 __entry->lright = ar->lright;
774                 __entry->pleft  = ar->pleft;
775                 __entry->pright = ar->pright;
776                 __entry->flags  = ar->flags;
777         ),
778 
779         TP_printk("dev %d,%d ino %lu flags %s len %u lblk %u goal %llu "
780                   "lleft %u lright %u pleft %llu pright %llu ",
781                   MAJOR(__entry->dev), MINOR(__entry->dev),
782                   (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
783                   __entry->len, __entry->logical, __entry->goal,
784                   __entry->lleft, __entry->lright, __entry->pleft,
785                   __entry->pright)
786 );
787 
788 TRACE_EVENT(ext4_allocate_blocks,
789         TP_PROTO(struct ext4_allocation_request *ar, unsigned long long block),
790 
791         TP_ARGS(ar, block),
792 
793         TP_STRUCT__entry(
794                 __field(        dev_t,  dev                     )
795                 __field(        ino_t,  ino                     )
796                 __field(        __u64,  block                   )
797                 __field(        unsigned int, len               )
798                 __field(        __u32,  logical                 )
799                 __field(        __u32,  lleft                   )
800                 __field(        __u32,  lright                  )
801                 __field(        __u64,  goal                    )
802                 __field(        __u64,  pleft                   )
803                 __field(        __u64,  pright                  )
804                 __field(        unsigned int, flags             )
805         ),
806 
807         TP_fast_assign(
808                 __entry->dev    = ar->inode->i_sb->s_dev;
809                 __entry->ino    = ar->inode->i_ino;
810                 __entry->block  = block;
811                 __entry->len    = ar->len;
812                 __entry->logical = ar->logical;
813                 __entry->goal   = ar->goal;
814                 __entry->lleft  = ar->lleft;
815                 __entry->lright = ar->lright;
816                 __entry->pleft  = ar->pleft;
817                 __entry->pright = ar->pright;
818                 __entry->flags  = ar->flags;
819         ),
820 
821         TP_printk("dev %d,%d ino %lu flags %s len %u block %llu lblk %u "
822                   "goal %llu lleft %u lright %u pleft %llu pright %llu",
823                   MAJOR(__entry->dev), MINOR(__entry->dev),
824                   (unsigned long) __entry->ino, show_mballoc_flags(__entry->flags),
825                   __entry->len, __entry->block, __entry->logical,
826                   __entry->goal,  __entry->lleft, __entry->lright,
827                   __entry->pleft, __entry->pright)
828 );
829 
830 TRACE_EVENT(ext4_free_blocks,
831         TP_PROTO(struct inode *inode, __u64 block, unsigned long count,
832                  int flags),
833 
834         TP_ARGS(inode, block, count, flags),
835 
836         TP_STRUCT__entry(
837                 __field(        dev_t,  dev                     )
838                 __field(        ino_t,  ino                     )
839                 __field(        __u64,  block                   )
840                 __field(        unsigned long,  count           )
841                 __field(        int,    flags                   )
842                 __field(        __u16,  mode                    )
843         ),
844 
845         TP_fast_assign(
846                 __entry->dev            = inode->i_sb->s_dev;
847                 __entry->ino            = inode->i_ino;
848                 __entry->block          = block;
849                 __entry->count          = count;
850                 __entry->flags          = flags;
851                 __entry->mode           = inode->i_mode;
852         ),
853 
854         TP_printk("dev %d,%d ino %lu mode 0%o block %llu count %lu flags %s",
855                   MAJOR(__entry->dev), MINOR(__entry->dev),
856                   (unsigned long) __entry->ino,
857                   __entry->mode, __entry->block, __entry->count,
858                   show_free_flags(__entry->flags))
859 );
860 
861 TRACE_EVENT(ext4_sync_file_enter,
862         TP_PROTO(struct file *file, int datasync),
863 
864         TP_ARGS(file, datasync),
865 
866         TP_STRUCT__entry(
867                 __field(        dev_t,  dev                     )
868                 __field(        ino_t,  ino                     )
869                 __field(        ino_t,  parent                  )
870                 __field(        int,    datasync                )
871         ),
872 
873         TP_fast_assign(
874                 struct dentry *dentry = file->f_path.dentry;
875 
876                 __entry->dev            = dentry->d_sb->s_dev;
877                 __entry->ino            = d_inode(dentry)->i_ino;
878                 __entry->datasync       = datasync;
879                 __entry->parent         = d_inode(dentry->d_parent)->i_ino;
880         ),
881 
882         TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
883                   MAJOR(__entry->dev), MINOR(__entry->dev),
884                   (unsigned long) __entry->ino,
885                   (unsigned long) __entry->parent, __entry->datasync)
886 );
887 
888 TRACE_EVENT(ext4_sync_file_exit,
889         TP_PROTO(struct inode *inode, int ret),
890 
891         TP_ARGS(inode, ret),
892 
893         TP_STRUCT__entry(
894                 __field(        dev_t,  dev                     )
895                 __field(        ino_t,  ino                     )
896                 __field(        int,    ret                     )
897         ),
898 
899         TP_fast_assign(
900                 __entry->dev            = inode->i_sb->s_dev;
901                 __entry->ino            = inode->i_ino;
902                 __entry->ret            = ret;
903         ),
904 
905         TP_printk("dev %d,%d ino %lu ret %d",
906                   MAJOR(__entry->dev), MINOR(__entry->dev),
907                   (unsigned long) __entry->ino,
908                   __entry->ret)
909 );
910 
911 TRACE_EVENT(ext4_sync_fs,
912         TP_PROTO(struct super_block *sb, int wait),
913 
914         TP_ARGS(sb, wait),
915 
916         TP_STRUCT__entry(
917                 __field(        dev_t,  dev                     )
918                 __field(        int,    wait                    )
919 
920         ),
921 
922         TP_fast_assign(
923                 __entry->dev    = sb->s_dev;
924                 __entry->wait   = wait;
925         ),
926 
927         TP_printk("dev %d,%d wait %d",
928                   MAJOR(__entry->dev), MINOR(__entry->dev),
929                   __entry->wait)
930 );
931 
932 TRACE_EVENT(ext4_alloc_da_blocks,
933         TP_PROTO(struct inode *inode),
934 
935         TP_ARGS(inode),
936 
937         TP_STRUCT__entry(
938                 __field(        dev_t,  dev                     )
939                 __field(        ino_t,  ino                     )
940                 __field( unsigned int,  data_blocks             )
941         ),
942 
943         TP_fast_assign(
944                 __entry->dev    = inode->i_sb->s_dev;
945                 __entry->ino    = inode->i_ino;
946                 __entry->data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
947         ),
948 
949         TP_printk("dev %d,%d ino %lu reserved_data_blocks %u",
950                   MAJOR(__entry->dev), MINOR(__entry->dev),
951                   (unsigned long) __entry->ino,
952                   __entry->data_blocks)
953 );
954 
955 TRACE_EVENT(ext4_mballoc_alloc,
956         TP_PROTO(struct ext4_allocation_context *ac),
957 
958         TP_ARGS(ac),
959 
960         TP_STRUCT__entry(
961                 __field(        dev_t,  dev                     )
962                 __field(        ino_t,  ino                     )
963                 __field(        __u32,  orig_logical            )
964                 __field(          int,  orig_start              )
965                 __field(        __u32,  orig_group              )
966                 __field(          int,  orig_len                )
967                 __field(        __u32,  goal_logical            )
968                 __field(          int,  goal_start              )
969                 __field(        __u32,  goal_group              )
970                 __field(          int,  goal_len                )
971                 __field(        __u32,  result_logical          )
972                 __field(          int,  result_start            )
973                 __field(        __u32,  result_group            )
974                 __field(          int,  result_len              )
975                 __field(        __u16,  found                   )
976                 __field(        __u16,  groups                  )
977                 __field(        __u16,  buddy                   )
978                 __field(        __u16,  flags                   )
979                 __field(        __u16,  tail                    )
980                 __field(        __u8,   cr                      )
981         ),
982 
983         TP_fast_assign(
984                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
985                 __entry->ino            = ac->ac_inode->i_ino;
986                 __entry->orig_logical   = ac->ac_o_ex.fe_logical;
987                 __entry->orig_start     = ac->ac_o_ex.fe_start;
988                 __entry->orig_group     = ac->ac_o_ex.fe_group;
989                 __entry->orig_len       = ac->ac_o_ex.fe_len;
990                 __entry->goal_logical   = ac->ac_g_ex.fe_logical;
991                 __entry->goal_start     = ac->ac_g_ex.fe_start;
992                 __entry->goal_group     = ac->ac_g_ex.fe_group;
993                 __entry->goal_len       = ac->ac_g_ex.fe_len;
994                 __entry->result_logical = ac->ac_f_ex.fe_logical;
995                 __entry->result_start   = ac->ac_f_ex.fe_start;
996                 __entry->result_group   = ac->ac_f_ex.fe_group;
997                 __entry->result_len     = ac->ac_f_ex.fe_len;
998                 __entry->found          = ac->ac_found;
999                 __entry->flags          = ac->ac_flags;
1000                 __entry->groups         = ac->ac_groups_scanned;
1001                 __entry->buddy          = ac->ac_buddy;
1002                 __entry->tail           = ac->ac_tail;
1003                 __entry->cr             = ac->ac_criteria;
1004         ),
1005 
1006         TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u goal %u/%d/%u@%u "
1007                   "result %u/%d/%u@%u blks %u grps %u cr %u flags %s "
1008                   "tail %u broken %u",
1009                   MAJOR(__entry->dev), MINOR(__entry->dev),
1010                   (unsigned long) __entry->ino,
1011                   __entry->orig_group, __entry->orig_start,
1012                   __entry->orig_len, __entry->orig_logical,
1013                   __entry->goal_group, __entry->goal_start,
1014                   __entry->goal_len, __entry->goal_logical,
1015                   __entry->result_group, __entry->result_start,
1016                   __entry->result_len, __entry->result_logical,
1017                   __entry->found, __entry->groups, __entry->cr,
1018                   show_mballoc_flags(__entry->flags), __entry->tail,
1019                   __entry->buddy ? 1 << __entry->buddy : 0)
1020 );
1021 
1022 TRACE_EVENT(ext4_mballoc_prealloc,
1023         TP_PROTO(struct ext4_allocation_context *ac),
1024 
1025         TP_ARGS(ac),
1026 
1027         TP_STRUCT__entry(
1028                 __field(        dev_t,  dev                     )
1029                 __field(        ino_t,  ino                     )
1030                 __field(        __u32,  orig_logical            )
1031                 __field(          int,  orig_start              )
1032                 __field(        __u32,  orig_group              )
1033                 __field(          int,  orig_len                )
1034                 __field(        __u32,  result_logical          )
1035                 __field(          int,  result_start            )
1036                 __field(        __u32,  result_group            )
1037                 __field(          int,  result_len              )
1038         ),
1039 
1040         TP_fast_assign(
1041                 __entry->dev            = ac->ac_inode->i_sb->s_dev;
1042                 __entry->ino            = ac->ac_inode->i_ino;
1043                 __entry->orig_logical   = ac->ac_o_ex.fe_logical;
1044                 __entry->orig_start     = ac->ac_o_ex.fe_start;
1045                 __entry->orig_group     = ac->ac_o_ex.fe_group;
1046                 __entry->orig_len       = ac->ac_o_ex.fe_len;
1047                 __entry->result_logical = ac->ac_b_ex.fe_logical;
1048                 __entry->result_start   = ac->ac_b_ex.fe_start;
1049                 __entry->result_group   = ac->ac_b_ex.fe_group;
1050                 __entry->result_len     = ac->ac_b_ex.fe_len;
1051         ),
1052 
1053         TP_printk("dev %d,%d inode %lu orig %u/%d/%u@%u result %u/%d/%u@%u",
1054                   MAJOR(__entry->dev), MINOR(__entry->dev),
1055                   (unsigned long) __entry->ino,
1056                   __entry->orig_group, __entry->orig_start,
1057                   __entry->orig_len, __entry->orig_logical,
1058                   __entry->result_group, __entry->result_start,
1059                   __entry->result_len, __entry->result_logical)
1060 );
1061 
1062 DECLARE_EVENT_CLASS(ext4__mballoc,
1063         TP_PROTO(struct super_block *sb,
1064                  struct inode *inode,
1065                  ext4_group_t group,
1066                  ext4_grpblk_t start,
1067                  ext4_grpblk_t len),
1068 
1069         TP_ARGS(sb, inode, group, start, len),
1070 
1071         TP_STRUCT__entry(
1072                 __field(        dev_t,  dev                     )
1073                 __field(        ino_t,  ino                     )
1074                 __field(          int,  result_start            )
1075                 __field(        __u32,  result_group            )
1076                 __field(          int,  result_len              )
1077         ),
1078 
1079         TP_fast_assign(
1080                 __entry->dev            = sb->s_dev;
1081                 __entry->ino            = inode ? inode->i_ino : 0;
1082                 __entry->result_start   = start;
1083                 __entry->result_group   = group;
1084                 __entry->result_len     = len;
1085         ),
1086 
1087         TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
1088                   MAJOR(__entry->dev), MINOR(__entry->dev),
1089                   (unsigned long) __entry->ino,
1090                   __entry->result_group, __entry->result_start,
1091                   __entry->result_len)
1092 );
1093 
1094 DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard,
1095 
1096         TP_PROTO(struct super_block *sb,
1097                  struct inode *inode,
1098                  ext4_group_t group,
1099                  ext4_grpblk_t start,
1100                  ext4_grpblk_t len),
1101 
1102         TP_ARGS(sb, inode, group, start, len)
1103 );
1104 
1105 DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free,
1106 
1107         TP_PROTO(struct super_block *sb,
1108                  struct inode *inode,
1109                  ext4_group_t group,
1110                  ext4_grpblk_t start,
1111                  ext4_grpblk_t len),
1112 
1113         TP_ARGS(sb, inode, group, start, len)
1114 );
1115 
1116 TRACE_EVENT(ext4_forget,
1117         TP_PROTO(struct inode *inode, int is_metadata, __u64 block),
1118 
1119         TP_ARGS(inode, is_metadata, block),
1120 
1121         TP_STRUCT__entry(
1122                 __field(        dev_t,  dev                     )
1123                 __field(        ino_t,  ino                     )
1124                 __field(        __u64,  block                   )
1125                 __field(        int,    is_metadata             )
1126                 __field(        __u16,  mode                    )
1127         ),
1128 
1129         TP_fast_assign(
1130                 __entry->dev    = inode->i_sb->s_dev;
1131                 __entry->ino    = inode->i_ino;
1132                 __entry->block  = block;
1133                 __entry->is_metadata = is_metadata;
1134                 __entry->mode   = inode->i_mode;
1135         ),
1136 
1137         TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %llu",
1138                   MAJOR(__entry->dev), MINOR(__entry->dev),
1139                   (unsigned long) __entry->ino,
1140                   __entry->mode, __entry->is_metadata, __entry->block)
1141 );
1142 
1143 TRACE_EVENT(ext4_da_update_reserve_space,
1144         TP_PROTO(struct inode *inode, int used_blocks, int quota_claim),
1145 
1146         TP_ARGS(inode, used_blocks, quota_claim),
1147 
1148         TP_STRUCT__entry(
1149                 __field(        dev_t,  dev                     )
1150                 __field(        ino_t,  ino                     )
1151                 __field(        __u64,  i_blocks                )
1152                 __field(        int,    used_blocks             )
1153                 __field(        int,    reserved_data_blocks    )
1154                 __field(        int,    quota_claim             )
1155                 __field(        __u16,  mode                    )
1156         ),
1157 
1158         TP_fast_assign(
1159                 __entry->dev    = inode->i_sb->s_dev;
1160                 __entry->ino    = inode->i_ino;
1161                 __entry->i_blocks = inode->i_blocks;
1162                 __entry->used_blocks = used_blocks;
1163                 __entry->reserved_data_blocks =
1164                                 EXT4_I(inode)->i_reserved_data_blocks;
1165                 __entry->quota_claim = quota_claim;
1166                 __entry->mode   = inode->i_mode;
1167         ),
1168 
1169         TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu used_blocks %d "
1170                   "reserved_data_blocks %d quota_claim %d",
1171                   MAJOR(__entry->dev), MINOR(__entry->dev),
1172                   (unsigned long) __entry->ino,
1173                   __entry->mode, __entry->i_blocks,
1174                   __entry->used_blocks, __entry->reserved_data_blocks,
1175                   __entry->quota_claim)
1176 );
1177 
1178 TRACE_EVENT(ext4_da_reserve_space,
1179         TP_PROTO(struct inode *inode),
1180 
1181         TP_ARGS(inode),
1182 
1183         TP_STRUCT__entry(
1184                 __field(        dev_t,  dev                     )
1185                 __field(        ino_t,  ino                     )
1186                 __field(        __u64,  i_blocks                )
1187                 __field(        int,    reserved_data_blocks    )
1188                 __field(        __u16,  mode                    )
1189         ),
1190 
1191         TP_fast_assign(
1192                 __entry->dev    = inode->i_sb->s_dev;
1193                 __entry->ino    = inode->i_ino;
1194                 __entry->i_blocks = inode->i_blocks;
1195                 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1196                 __entry->mode   = inode->i_mode;
1197         ),
1198 
1199         TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu "
1200                   "reserved_data_blocks %d",
1201                   MAJOR(__entry->dev), MINOR(__entry->dev),
1202                   (unsigned long) __entry->ino,
1203                   __entry->mode, __entry->i_blocks,
1204                   __entry->reserved_data_blocks)
1205 );
1206 
1207 TRACE_EVENT(ext4_da_release_space,
1208         TP_PROTO(struct inode *inode, int freed_blocks),
1209 
1210         TP_ARGS(inode, freed_blocks),
1211 
1212         TP_STRUCT__entry(
1213                 __field(        dev_t,  dev                     )
1214                 __field(        ino_t,  ino                     )
1215                 __field(        __u64,  i_blocks                )
1216                 __field(        int,    freed_blocks            )
1217                 __field(        int,    reserved_data_blocks    )
1218                 __field(        __u16,  mode                    )
1219         ),
1220 
1221         TP_fast_assign(
1222                 __entry->dev    = inode->i_sb->s_dev;
1223                 __entry->ino    = inode->i_ino;
1224                 __entry->i_blocks = inode->i_blocks;
1225                 __entry->freed_blocks = freed_blocks;
1226                 __entry->reserved_data_blocks = EXT4_I(inode)->i_reserved_data_blocks;
1227                 __entry->mode   = inode->i_mode;
1228         ),
1229 
1230         TP_printk("dev %d,%d ino %lu mode 0%o i_blocks %llu freed_blocks %d "
1231                   "reserved_data_blocks %d",
1232                   MAJOR(__entry->dev), MINOR(__entry->dev),
1233                   (unsigned long) __entry->ino,
1234                   __entry->mode, __entry->i_blocks,
1235                   __entry->freed_blocks, __entry->reserved_data_blocks)
1236 );
1237 
1238 DECLARE_EVENT_CLASS(ext4__bitmap_load,
1239         TP_PROTO(struct super_block *sb, unsigned long group),
1240 
1241         TP_ARGS(sb, group),
1242 
1243         TP_STRUCT__entry(
1244                 __field(        dev_t,  dev                     )
1245                 __field(        __u32,  group                   )
1246 
1247         ),
1248 
1249         TP_fast_assign(
1250                 __entry->dev    = sb->s_dev;
1251                 __entry->group  = group;
1252         ),
1253 
1254         TP_printk("dev %d,%d group %u",
1255                   MAJOR(__entry->dev), MINOR(__entry->dev),
1256                   __entry->group)
1257 );
1258 
1259 DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load,
1260 
1261         TP_PROTO(struct super_block *sb, unsigned long group),
1262 
1263         TP_ARGS(sb, group)
1264 );
1265 
1266 DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load,
1267 
1268         TP_PROTO(struct super_block *sb, unsigned long group),
1269 
1270         TP_ARGS(sb, group)
1271 );
1272 
1273 DEFINE_EVENT(ext4__bitmap_load, ext4_read_block_bitmap_load,
1274 
1275         TP_PROTO(struct super_block *sb, unsigned long group),
1276 
1277         TP_ARGS(sb, group)
1278 );
1279 
1280 DEFINE_EVENT(ext4__bitmap_load, ext4_load_inode_bitmap,
1281 
1282         TP_PROTO(struct super_block *sb, unsigned long group),
1283 
1284         TP_ARGS(sb, group)
1285 );
1286 
1287 TRACE_EVENT(ext4_direct_IO_enter,
1288         TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
1289 
1290         TP_ARGS(inode, offset, len, rw),
1291 
1292         TP_STRUCT__entry(
1293                 __field(        dev_t,  dev                     )
1294                 __field(        ino_t,  ino                     )
1295                 __field(        loff_t, pos                     )
1296                 __field(        unsigned long,  len             )
1297                 __field(        int,    rw                      )
1298         ),
1299 
1300         TP_fast_assign(
1301                 __entry->dev    = inode->i_sb->s_dev;
1302                 __entry->ino    = inode->i_ino;
1303                 __entry->pos    = offset;
1304                 __entry->len    = len;
1305                 __entry->rw     = rw;
1306         ),
1307 
1308         TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
1309                   MAJOR(__entry->dev), MINOR(__entry->dev),
1310                   (unsigned long) __entry->ino,
1311                   __entry->pos, __entry->len, __entry->rw)
1312 );
1313 
1314 TRACE_EVENT(ext4_direct_IO_exit,
1315         TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1316                  int rw, int ret),
1317 
1318         TP_ARGS(inode, offset, len, rw, ret),
1319 
1320         TP_STRUCT__entry(
1321                 __field(        dev_t,  dev                     )
1322                 __field(        ino_t,  ino                     )
1323                 __field(        loff_t, pos                     )
1324                 __field(        unsigned long,  len             )
1325                 __field(        int,    rw                      )
1326                 __field(        int,    ret                     )
1327         ),
1328 
1329         TP_fast_assign(
1330                 __entry->dev    = inode->i_sb->s_dev;
1331                 __entry->ino    = inode->i_ino;
1332                 __entry->pos    = offset;
1333                 __entry->len    = len;
1334                 __entry->rw     = rw;
1335                 __entry->ret    = ret;
1336         ),
1337 
1338         TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
1339                   MAJOR(__entry->dev), MINOR(__entry->dev),
1340                   (unsigned long) __entry->ino,
1341                   __entry->pos, __entry->len,
1342                   __entry->rw, __entry->ret)
1343 );
1344 
1345 DECLARE_EVENT_CLASS(ext4__fallocate_mode,
1346         TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1347 
1348         TP_ARGS(inode, offset, len, mode),
1349 
1350         TP_STRUCT__entry(
1351                 __field(        dev_t,  dev                     )
1352                 __field(        ino_t,  ino                     )
1353                 __field(        loff_t, offset                  )
1354                 __field(        loff_t, len                     )
1355                 __field(        int,    mode                    )
1356         ),
1357 
1358         TP_fast_assign(
1359                 __entry->dev    = inode->i_sb->s_dev;
1360                 __entry->ino    = inode->i_ino;
1361                 __entry->offset = offset;
1362                 __entry->len    = len;
1363                 __entry->mode   = mode;
1364         ),
1365 
1366         TP_printk("dev %d,%d ino %lu offset %lld len %lld mode %s",
1367                   MAJOR(__entry->dev), MINOR(__entry->dev),
1368                   (unsigned long) __entry->ino,
1369                   __entry->offset, __entry->len,
1370                   show_falloc_mode(__entry->mode))
1371 );
1372 
1373 DEFINE_EVENT(ext4__fallocate_mode, ext4_fallocate_enter,
1374 
1375         TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1376 
1377         TP_ARGS(inode, offset, len, mode)
1378 );
1379 
1380 DEFINE_EVENT(ext4__fallocate_mode, ext4_punch_hole,
1381 
1382         TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1383 
1384         TP_ARGS(inode, offset, len, mode)
1385 );
1386 
1387 DEFINE_EVENT(ext4__fallocate_mode, ext4_zero_range,
1388 
1389         TP_PROTO(struct inode *inode, loff_t offset, loff_t len, int mode),
1390 
1391         TP_ARGS(inode, offset, len, mode)
1392 );
1393 
1394 TRACE_EVENT(ext4_fallocate_exit,
1395         TP_PROTO(struct inode *inode, loff_t offset,
1396                  unsigned int max_blocks, int ret),
1397 
1398         TP_ARGS(inode, offset, max_blocks, ret),
1399 
1400         TP_STRUCT__entry(
1401                 __field(        dev_t,  dev                     )
1402                 __field(        ino_t,  ino                     )
1403                 __field(        loff_t, pos                     )
1404                 __field(        unsigned int,   blocks          )
1405                 __field(        int,    ret                     )
1406         ),
1407 
1408         TP_fast_assign(
1409                 __entry->dev    = inode->i_sb->s_dev;
1410                 __entry->ino    = inode->i_ino;
1411                 __entry->pos    = offset;
1412                 __entry->blocks = max_blocks;
1413                 __entry->ret    = ret;
1414         ),
1415 
1416         TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
1417                   MAJOR(__entry->dev), MINOR(__entry->dev),
1418                   (unsigned long) __entry->ino,
1419                   __entry->pos, __entry->blocks,
1420                   __entry->ret)
1421 );
1422 
1423 TRACE_EVENT(ext4_unlink_enter,
1424         TP_PROTO(struct inode *parent, struct dentry *dentry),
1425 
1426         TP_ARGS(parent, dentry),
1427 
1428         TP_STRUCT__entry(
1429                 __field(        dev_t,  dev                     )
1430                 __field(        ino_t,  ino                     )
1431                 __field(        ino_t,  parent                  )
1432                 __field(        loff_t, size                    )
1433         ),
1434 
1435         TP_fast_assign(
1436                 __entry->dev            = dentry->d_sb->s_dev;
1437                 __entry->ino            = d_inode(dentry)->i_ino;
1438                 __entry->parent         = parent->i_ino;
1439                 __entry->size           = d_inode(dentry)->i_size;
1440         ),
1441 
1442         TP_printk("dev %d,%d ino %lu size %lld parent %lu",
1443                   MAJOR(__entry->dev), MINOR(__entry->dev),
1444                   (unsigned long) __entry->ino, __entry->size,
1445                   (unsigned long) __entry->parent)
1446 );
1447 
1448 TRACE_EVENT(ext4_unlink_exit,
1449         TP_PROTO(struct dentry *dentry, int ret),
1450 
1451         TP_ARGS(dentry, ret),
1452 
1453         TP_STRUCT__entry(
1454                 __field(        dev_t,  dev                     )
1455                 __field(        ino_t,  ino                     )
1456                 __field(        int,    ret                     )
1457         ),
1458 
1459         TP_fast_assign(
1460                 __entry->dev            = dentry->d_sb->s_dev;
1461                 __entry->ino            = d_inode(dentry)->i_ino;
1462                 __entry->ret            = ret;
1463         ),
1464 
1465         TP_printk("dev %d,%d ino %lu ret %d",
1466                   MAJOR(__entry->dev), MINOR(__entry->dev),
1467                   (unsigned long) __entry->ino,
1468                   __entry->ret)
1469 );
1470 
1471 DECLARE_EVENT_CLASS(ext4__truncate,
1472         TP_PROTO(struct inode *inode),
1473 
1474         TP_ARGS(inode),
1475 
1476         TP_STRUCT__entry(
1477                 __field(        dev_t,          dev             )
1478                 __field(        ino_t,          ino             )
1479                 __field(        __u64,          blocks          )
1480         ),
1481 
1482         TP_fast_assign(
1483                 __entry->dev    = inode->i_sb->s_dev;
1484                 __entry->ino    = inode->i_ino;
1485                 __entry->blocks = inode->i_blocks;
1486         ),
1487 
1488         TP_printk("dev %d,%d ino %lu blocks %llu",
1489                   MAJOR(__entry->dev), MINOR(__entry->dev),
1490                   (unsigned long) __entry->ino, __entry->blocks)
1491 );
1492 
1493 DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
1494 
1495         TP_PROTO(struct inode *inode),
1496 
1497         TP_ARGS(inode)
1498 );
1499 
1500 DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1501 
1502         TP_PROTO(struct inode *inode),
1503 
1504         TP_ARGS(inode)
1505 );
1506 
1507 /* 'ux' is the unwritten extent. */
1508 TRACE_EVENT(ext4_ext_convert_to_initialized_enter,
1509         TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1510                  struct ext4_extent *ux),
1511 
1512         TP_ARGS(inode, map, ux),
1513 
1514         TP_STRUCT__entry(
1515                 __field(        dev_t,          dev     )
1516                 __field(        ino_t,          ino     )
1517                 __field(        ext4_lblk_t,    m_lblk  )
1518                 __field(        unsigned,       m_len   )
1519                 __field(        ext4_lblk_t,    u_lblk  )
1520                 __field(        unsigned,       u_len   )
1521                 __field(        ext4_fsblk_t,   u_pblk  )
1522         ),
1523 
1524         TP_fast_assign(
1525                 __entry->dev            = inode->i_sb->s_dev;
1526                 __entry->ino            = inode->i_ino;
1527                 __entry->m_lblk         = map->m_lblk;
1528                 __entry->m_len          = map->m_len;
1529                 __entry->u_lblk         = le32_to_cpu(ux->ee_block);
1530                 __entry->u_len          = ext4_ext_get_actual_len(ux);
1531                 __entry->u_pblk         = ext4_ext_pblock(ux);
1532         ),
1533 
1534         TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u u_lblk %u u_len %u "
1535                   "u_pblk %llu",
1536                   MAJOR(__entry->dev), MINOR(__entry->dev),
1537                   (unsigned long) __entry->ino,
1538                   __entry->m_lblk, __entry->m_len,
1539                   __entry->u_lblk, __entry->u_len, __entry->u_pblk)
1540 );
1541 
1542 /*
1543  * 'ux' is the unwritten extent.
1544  * 'ix' is the initialized extent to which blocks are transferred.
1545  */
1546 TRACE_EVENT(ext4_ext_convert_to_initialized_fastpath,
1547         TP_PROTO(struct inode *inode, struct ext4_map_blocks *map,
1548                  struct ext4_extent *ux, struct ext4_extent *ix),
1549 
1550         TP_ARGS(inode, map, ux, ix),
1551 
1552         TP_STRUCT__entry(
1553                 __field(        dev_t,          dev     )
1554                 __field(        ino_t,          ino     )
1555                 __field(        ext4_lblk_t,    m_lblk  )
1556                 __field(        unsigned,       m_len   )
1557                 __field(        ext4_lblk_t,    u_lblk  )
1558                 __field(        unsigned,       u_len   )
1559                 __field(        ext4_fsblk_t,   u_pblk  )
1560                 __field(        ext4_lblk_t,    i_lblk  )
1561                 __field(        unsigned,       i_len   )
1562                 __field(        ext4_fsblk_t,   i_pblk  )
1563         ),
1564 
1565         TP_fast_assign(
1566                 __entry->dev            = inode->i_sb->s_dev;
1567                 __entry->ino            = inode->i_ino;
1568                 __entry->m_lblk         = map->m_lblk;
1569                 __entry->m_len          = map->m_len;
1570                 __entry->u_lblk         = le32_to_cpu(ux->ee_block);
1571                 __entry->u_len          = ext4_ext_get_actual_len(ux);
1572                 __entry->u_pblk         = ext4_ext_pblock(ux);
1573                 __entry->i_lblk         = le32_to_cpu(ix->ee_block);
1574                 __entry->i_len          = ext4_ext_get_actual_len(ix);
1575                 __entry->i_pblk         = ext4_ext_pblock(ix);
1576         ),
1577 
1578         TP_printk("dev %d,%d ino %lu m_lblk %u m_len %u "
1579                   "u_lblk %u u_len %u u_pblk %llu "
1580                   "i_lblk %u i_len %u i_pblk %llu ",
1581                   MAJOR(__entry->dev), MINOR(__entry->dev),
1582                   (unsigned long) __entry->ino,
1583                   __entry->m_lblk, __entry->m_len,
1584                   __entry->u_lblk, __entry->u_len, __entry->u_pblk,
1585                   __entry->i_lblk, __entry->i_len, __entry->i_pblk)
1586 );
1587 
1588 DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1589         TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1590                  unsigned int len, unsigned int flags),
1591 
1592         TP_ARGS(inode, lblk, len, flags),
1593 
1594         TP_STRUCT__entry(
1595                 __field(        dev_t,          dev             )
1596                 __field(        ino_t,          ino             )
1597                 __field(        ext4_lblk_t,    lblk            )
1598                 __field(        unsigned int,   len             )
1599                 __field(        unsigned int,   flags           )
1600         ),
1601 
1602         TP_fast_assign(
1603                 __entry->dev    = inode->i_sb->s_dev;
1604                 __entry->ino    = inode->i_ino;
1605                 __entry->lblk   = lblk;
1606                 __entry->len    = len;
1607                 __entry->flags  = flags;
1608         ),
1609 
1610         TP_printk("dev %d,%d ino %lu lblk %u len %u flags %s",
1611                   MAJOR(__entry->dev), MINOR(__entry->dev),
1612                   (unsigned long) __entry->ino,
1613                   __entry->lblk, __entry->len, show_map_flags(__entry->flags))
1614 );
1615 
1616 DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
1617         TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1618                  unsigned len, unsigned flags),
1619 
1620         TP_ARGS(inode, lblk, len, flags)
1621 );
1622 
1623 DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1624         TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1625                  unsigned len, unsigned flags),
1626 
1627         TP_ARGS(inode, lblk, len, flags)
1628 );
1629 
1630 DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1631         TP_PROTO(struct inode *inode, unsigned flags, struct ext4_map_blocks *map,
1632                  int ret),
1633 
1634         TP_ARGS(inode, flags, map, ret),
1635 
1636         TP_STRUCT__entry(
1637                 __field(        dev_t,          dev             )
1638                 __field(        ino_t,          ino             )
1639                 __field(        unsigned int,   flags           )
1640                 __field(        ext4_fsblk_t,   pblk            )
1641                 __field(        ext4_lblk_t,    lblk            )
1642                 __field(        unsigned int,   len             )
1643                 __field(        unsigned int,   mflags          )
1644                 __field(        int,            ret             )
1645         ),
1646 
1647         TP_fast_assign(
1648                 __entry->dev    = inode->i_sb->s_dev;
1649                 __entry->ino    = inode->i_ino;
1650                 __entry->flags  = flags;
1651                 __entry->pblk   = map->m_pblk;
1652                 __entry->lblk   = map->m_lblk;
1653                 __entry->len    = map->m_len;
1654                 __entry->mflags = map->m_flags;
1655                 __entry->ret    = ret;
1656         ),
1657 
1658         TP_printk("dev %d,%d ino %lu flags %s lblk %u pblk %llu len %u "
1659                   "mflags %s ret %d",
1660                   MAJOR(__entry->dev), MINOR(__entry->dev),
1661                   (unsigned long) __entry->ino,
1662                   show_map_flags(__entry->flags), __entry->lblk, __entry->pblk,
1663                   __entry->len, show_mflags(__entry->mflags), __entry->ret)
1664 );
1665 
1666 DEFINE_EVENT(ext4__map_blocks_exit, ext4_ext_map_blocks_exit,
1667         TP_PROTO(struct inode *inode, unsigned flags,
1668                  struct ext4_map_blocks *map, int ret),
1669 
1670         TP_ARGS(inode, flags, map, ret)
1671 );
1672 
1673 DEFINE_EVENT(ext4__map_blocks_exit, ext4_ind_map_blocks_exit,
1674         TP_PROTO(struct inode *inode, unsigned flags,
1675                  struct ext4_map_blocks *map, int ret),
1676 
1677         TP_ARGS(inode, flags, map, ret)
1678 );
1679 
1680 TRACE_EVENT(ext4_ext_load_extent,
1681         TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk),
1682 
1683         TP_ARGS(inode, lblk, pblk),
1684 
1685         TP_STRUCT__entry(
1686                 __field(        dev_t,          dev             )
1687                 __field(        ino_t,          ino             )
1688                 __field(        ext4_fsblk_t,   pblk            )
1689                 __field(        ext4_lblk_t,    lblk            )
1690         ),
1691 
1692         TP_fast_assign(
1693                 __entry->dev    = inode->i_sb->s_dev;
1694                 __entry->ino    = inode->i_ino;
1695                 __entry->pblk   = pblk;
1696                 __entry->lblk   = lblk;
1697         ),
1698 
1699         TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1700                   MAJOR(__entry->dev), MINOR(__entry->dev),
1701                   (unsigned long) __entry->ino,
1702                   __entry->lblk, __entry->pblk)
1703 );
1704 
1705 TRACE_EVENT(ext4_load_inode,
1706         TP_PROTO(struct inode *inode),
1707 
1708         TP_ARGS(inode),
1709 
1710         TP_STRUCT__entry(
1711                 __field(        dev_t,  dev             )
1712                 __field(        ino_t,  ino             )
1713         ),
1714 
1715         TP_fast_assign(
1716                 __entry->dev            = inode->i_sb->s_dev;
1717                 __entry->ino            = inode->i_ino;
1718         ),
1719 
1720         TP_printk("dev %d,%d ino %ld",
1721                   MAJOR(__entry->dev), MINOR(__entry->dev),
1722                   (unsigned long) __entry->ino)
1723 );
1724 
1725 TRACE_EVENT(ext4_journal_start,
1726         TP_PROTO(struct super_block *sb, int blocks, int rsv_blocks,
1727                  unsigned long IP),
1728 
1729         TP_ARGS(sb, blocks, rsv_blocks, IP),
1730 
1731         TP_STRUCT__entry(
1732                 __field(        dev_t,  dev                     )
1733                 __field(unsigned long,  ip                      )
1734                 __field(          int,  blocks                  )
1735                 __field(          int,  rsv_blocks              )
1736         ),
1737 
1738         TP_fast_assign(
1739                 __entry->dev             = sb->s_dev;
1740                 __entry->ip              = IP;
1741                 __entry->blocks          = blocks;
1742                 __entry->rsv_blocks      = rsv_blocks;
1743         ),
1744 
1745         TP_printk("dev %d,%d blocks, %d rsv_blocks, %d caller %pS",
1746                   MAJOR(__entry->dev), MINOR(__entry->dev),
1747                   __entry->blocks, __entry->rsv_blocks, (void *)__entry->ip)
1748 );
1749 
1750 TRACE_EVENT(ext4_journal_start_reserved,
1751         TP_PROTO(struct super_block *sb, int blocks, unsigned long IP),
1752 
1753         TP_ARGS(sb, blocks, IP),
1754 
1755         TP_STRUCT__entry(
1756                 __field(        dev_t,  dev                     )
1757                 __field(unsigned long,  ip                      )
1758                 __field(          int,  blocks                  )
1759         ),
1760 
1761         TP_fast_assign(
1762                 __entry->dev             = sb->s_dev;
1763                 __entry->ip              = IP;
1764                 __entry->blocks          = blocks;
1765         ),
1766 
1767         TP_printk("dev %d,%d blocks, %d caller %pS",
1768                   MAJOR(__entry->dev), MINOR(__entry->dev),
1769                   __entry->blocks, (void *)__entry->ip)
1770 );
1771 
1772 DECLARE_EVENT_CLASS(ext4__trim,
1773         TP_PROTO(struct super_block *sb,
1774                  ext4_group_t group,
1775                  ext4_grpblk_t start,
1776                  ext4_grpblk_t len),
1777 
1778         TP_ARGS(sb, group, start, len),
1779 
1780         TP_STRUCT__entry(
1781                 __field(        int,    dev_major               )
1782                 __field(        int,    dev_minor               )
1783                 __field(        __u32,  group                   )
1784                 __field(        int,    start                   )
1785                 __field(        int,    len                     )
1786         ),
1787 
1788         TP_fast_assign(
1789                 __entry->dev_major      = MAJOR(sb->s_dev);
1790                 __entry->dev_minor      = MINOR(sb->s_dev);
1791                 __entry->group          = group;
1792                 __entry->start          = start;
1793                 __entry->len            = len;
1794         ),
1795 
1796         TP_printk("dev %d,%d group %u, start %d, len %d",
1797                   __entry->dev_major, __entry->dev_minor,
1798                   __entry->group, __entry->start, __entry->len)
1799 );
1800 
1801 DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1802 
1803         TP_PROTO(struct super_block *sb,
1804                  ext4_group_t group,
1805                  ext4_grpblk_t start,
1806                  ext4_grpblk_t len),
1807 
1808         TP_ARGS(sb, group, start, len)
1809 );
1810 
1811 DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1812 
1813         TP_PROTO(struct super_block *sb,
1814                  ext4_group_t group,
1815                  ext4_grpblk_t start,
1816                  ext4_grpblk_t len),
1817 
1818         TP_ARGS(sb, group, start, len)
1819 );
1820 
1821 TRACE_EVENT(ext4_ext_handle_unwritten_extents,
1822         TP_PROTO(struct inode *inode, struct ext4_map_blocks *map, int flags,
1823                  unsigned int allocated, ext4_fsblk_t newblock),
1824 
1825         TP_ARGS(inode, map, flags, allocated, newblock),
1826 
1827         TP_STRUCT__entry(
1828                 __field(        dev_t,          dev             )
1829                 __field(        ino_t,          ino             )
1830                 __field(        int,            flags           )
1831                 __field(        ext4_lblk_t,    lblk            )
1832                 __field(        ext4_fsblk_t,   pblk            )
1833                 __field(        unsigned int,   len             )
1834                 __field(        unsigned int,   allocated       )
1835                 __field(        ext4_fsblk_t,   newblk          )
1836         ),
1837 
1838         TP_fast_assign(
1839                 __entry->dev            = inode->i_sb->s_dev;
1840                 __entry->ino            = inode->i_ino;
1841                 __entry->flags          = flags;
1842                 __entry->lblk           = map->m_lblk;
1843                 __entry->pblk           = map->m_pblk;
1844                 __entry->len            = map->m_len;
1845                 __entry->allocated      = allocated;
1846                 __entry->newblk         = newblock;
1847         ),
1848 
1849         TP_printk("dev %d,%d ino %lu m_lblk %u m_pblk %llu m_len %u flags %s "
1850                   "allocated %d newblock %llu",
1851                   MAJOR(__entry->dev), MINOR(__entry->dev),
1852                   (unsigned long) __entry->ino,
1853                   (unsigned) __entry->lblk, (unsigned long long) __entry->pblk,
1854                   __entry->len, show_map_flags(__entry->flags),
1855                   (unsigned int) __entry->allocated,
1856                   (unsigned long long) __entry->newblk)
1857 );
1858 
1859 TRACE_EVENT(ext4_get_implied_cluster_alloc_exit,
1860         TP_PROTO(struct super_block *sb, struct ext4_map_blocks *map, int ret),
1861 
1862         TP_ARGS(sb, map, ret),
1863 
1864         TP_STRUCT__entry(
1865                 __field(        dev_t,          dev     )
1866                 __field(        unsigned int,   flags   )
1867                 __field(        ext4_lblk_t,    lblk    )
1868                 __field(        ext4_fsblk_t,   pblk    )
1869                 __field(        unsigned int,   len     )
1870                 __field(        int,            ret     )
1871         ),
1872 
1873         TP_fast_assign(
1874                 __entry->dev    = sb->s_dev;
1875                 __entry->flags  = map->m_flags;
1876                 __entry->lblk   = map->m_lblk;
1877                 __entry->pblk   = map->m_pblk;
1878                 __entry->len    = map->m_len;
1879                 __entry->ret    = ret;
1880         ),
1881 
1882         TP_printk("dev %d,%d m_lblk %u m_pblk %llu m_len %u m_flags %s ret %d",
1883                   MAJOR(__entry->dev), MINOR(__entry->dev),
1884                   __entry->lblk, (unsigned long long) __entry->pblk,
1885                   __entry->len, show_mflags(__entry->flags), __entry->ret)
1886 );
1887 
1888 TRACE_EVENT(ext4_ext_put_in_cache,
1889         TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len,
1890                  ext4_fsblk_t start),
1891 
1892         TP_ARGS(inode, lblk, len, start),
1893 
1894         TP_STRUCT__entry(
1895                 __field(        dev_t,          dev     )
1896                 __field(        ino_t,          ino     )
1897                 __field(        ext4_lblk_t,    lblk    )
1898                 __field(        unsigned int,   len     )
1899                 __field(        ext4_fsblk_t,   start   )
1900         ),
1901 
1902         TP_fast_assign(
1903                 __entry->dev    = inode->i_sb->s_dev;
1904                 __entry->ino    = inode->i_ino;
1905                 __entry->lblk   = lblk;
1906                 __entry->len    = len;
1907                 __entry->start  = start;
1908         ),
1909 
1910         TP_printk("dev %d,%d ino %lu lblk %u len %u start %llu",
1911                   MAJOR(__entry->dev), MINOR(__entry->dev),
1912                   (unsigned long) __entry->ino,
1913                   (unsigned) __entry->lblk,
1914                   __entry->len,
1915                   (unsigned long long) __entry->start)
1916 );
1917 
1918 TRACE_EVENT(ext4_ext_in_cache,
1919         TP_PROTO(struct inode *inode, ext4_lblk_t lblk, int ret),
1920 
1921         TP_ARGS(inode, lblk, ret),
1922 
1923         TP_STRUCT__entry(
1924                 __field(        dev_t,          dev     )
1925                 __field(        ino_t,          ino     )
1926                 __field(        ext4_lblk_t,    lblk    )
1927                 __field(        int,            ret     )
1928         ),
1929 
1930         TP_fast_assign(
1931                 __entry->dev    = inode->i_sb->s_dev;
1932                 __entry->ino    = inode->i_ino;
1933                 __entry->lblk   = lblk;
1934                 __entry->ret    = ret;
1935         ),
1936 
1937         TP_printk("dev %d,%d ino %lu lblk %u ret %d",
1938                   MAJOR(__entry->dev), MINOR(__entry->dev),
1939                   (unsigned long) __entry->ino,
1940                   (unsigned) __entry->lblk,
1941                   __entry->ret)
1942 
1943 );
1944 
1945 TRACE_EVENT(ext4_find_delalloc_range,
1946         TP_PROTO(struct inode *inode, ext4_lblk_t from, ext4_lblk_t to,
1947                 int reverse, int found, ext4_lblk_t found_blk),
1948 
1949         TP_ARGS(inode, from, to, reverse, found, found_blk),
1950 
1951         TP_STRUCT__entry(
1952                 __field(        dev_t,          dev             )
1953                 __field(        ino_t,          ino             )
1954                 __field(        ext4_lblk_t,    from            )
1955                 __field(        ext4_lblk_t,    to              )
1956                 __field(        int,            reverse         )
1957                 __field(        int,            found           )
1958                 __field(        ext4_lblk_t,    found_blk       )
1959         ),
1960 
1961         TP_fast_assign(
1962                 __entry->dev            = inode->i_sb->s_dev;
1963                 __entry->ino            = inode->i_ino;
1964                 __entry->from           = from;
1965                 __entry->to             = to;
1966                 __entry->reverse        = reverse;
1967                 __entry->found          = found;
1968                 __entry->found_blk      = found_blk;
1969         ),
1970 
1971         TP_printk("dev %d,%d ino %lu from %u to %u reverse %d found %d "
1972                   "(blk = %u)",
1973                   MAJOR(__entry->dev), MINOR(__entry->dev),
1974                   (unsigned long) __entry->ino,
1975                   (unsigned) __entry->from, (unsigned) __entry->to,
1976                   __entry->reverse, __entry->found,
1977                   (unsigned) __entry->found_blk)
1978 );
1979 
1980 TRACE_EVENT(ext4_get_reserved_cluster_alloc,
1981         TP_PROTO(struct inode *inode, ext4_lblk_t lblk, unsigned int len),
1982 
1983         TP_ARGS(inode, lblk, len),
1984 
1985         TP_STRUCT__entry(
1986                 __field(        dev_t,          dev     )
1987                 __field(        ino_t,          ino     )
1988                 __field(        ext4_lblk_t,    lblk    )
1989                 __field(        unsigned int,   len     )
1990         ),
1991 
1992         TP_fast_assign(
1993                 __entry->dev    = inode->i_sb->s_dev;
1994                 __entry->ino    = inode->i_ino;
1995                 __entry->lblk   = lblk;
1996                 __entry->len    = len;
1997         ),
1998 
1999         TP_printk("dev %d,%d ino %lu lblk %u len %u",
2000                   MAJOR(__entry->dev), MINOR(__entry->dev),
2001                   (unsigned long) __entry->ino,
2002                   (unsigned) __entry->lblk,
2003                   __entry->len)
2004 );
2005 
2006 TRACE_EVENT(ext4_ext_show_extent,
2007         TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_fsblk_t pblk,
2008                  unsigned short len),
2009 
2010         TP_ARGS(inode, lblk, pblk, len),
2011 
2012         TP_STRUCT__entry(
2013                 __field(        dev_t,          dev     )
2014                 __field(        ino_t,          ino     )
2015                 __field(        ext4_fsblk_t,   pblk    )
2016                 __field(        ext4_lblk_t,    lblk    )
2017                 __field(        unsigned short, len     )
2018         ),
2019 
2020         TP_fast_assign(
2021                 __entry->dev    = inode->i_sb->s_dev;
2022                 __entry->ino    = inode->i_ino;
2023                 __entry->pblk   = pblk;
2024                 __entry->lblk   = lblk;
2025                 __entry->len    = len;
2026         ),
2027 
2028         TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u",
2029                   MAJOR(__entry->dev), MINOR(__entry->dev),
2030                   (unsigned long) __entry->ino,
2031                   (unsigned) __entry->lblk,
2032                   (unsigned long long) __entry->pblk,
2033                   (unsigned short) __entry->len)
2034 );
2035 
2036 TRACE_EVENT(ext4_remove_blocks,
2037             TP_PROTO(struct inode *inode, struct ext4_extent *ex,
2038                 ext4_lblk_t from, ext4_fsblk_t to,
2039                 long long partial_cluster),
2040 
2041         TP_ARGS(inode, ex, from, to, partial_cluster),
2042 
2043         TP_STRUCT__entry(
2044                 __field(        dev_t,          dev     )
2045                 __field(        ino_t,          ino     )
2046                 __field(        ext4_lblk_t,    from    )
2047                 __field(        ext4_lblk_t,    to      )
2048                 __field(        long long,      partial )
2049                 __field(        ext4_fsblk_t,   ee_pblk )
2050                 __field(        ext4_lblk_t,    ee_lblk )
2051                 __field(        unsigned short, ee_len  )
2052         ),
2053 
2054         TP_fast_assign(
2055                 __entry->dev            = inode->i_sb->s_dev;
2056                 __entry->ino            = inode->i_ino;
2057                 __entry->from           = from;
2058                 __entry->to             = to;
2059                 __entry->partial        = partial_cluster;
2060                 __entry->ee_pblk        = ext4_ext_pblock(ex);
2061                 __entry->ee_lblk        = le32_to_cpu(ex->ee_block);
2062                 __entry->ee_len         = ext4_ext_get_actual_len(ex);
2063         ),
2064 
2065         TP_printk("dev %d,%d ino %lu extent [%u(%llu), %u]"
2066                   "from %u to %u partial_cluster %lld",
2067                   MAJOR(__entry->dev), MINOR(__entry->dev),
2068                   (unsigned long) __entry->ino,
2069                   (unsigned) __entry->ee_lblk,
2070                   (unsigned long long) __entry->ee_pblk,
2071                   (unsigned short) __entry->ee_len,
2072                   (unsigned) __entry->from,
2073                   (unsigned) __entry->to,
2074                   (long long) __entry->partial)
2075 );
2076 
2077 TRACE_EVENT(ext4_ext_rm_leaf,
2078         TP_PROTO(struct inode *inode, ext4_lblk_t start,
2079                  struct ext4_extent *ex,
2080                  long long partial_cluster),
2081 
2082         TP_ARGS(inode, start, ex, partial_cluster),
2083 
2084         TP_STRUCT__entry(
2085                 __field(        dev_t,          dev     )
2086                 __field(        ino_t,          ino     )
2087                 __field(        long long,      partial )
2088                 __field(        ext4_lblk_t,    start   )
2089                 __field(        ext4_lblk_t,    ee_lblk )
2090                 __field(        ext4_fsblk_t,   ee_pblk )
2091                 __field(        short,          ee_len  )
2092         ),
2093 
2094         TP_fast_assign(
2095                 __entry->dev            = inode->i_sb->s_dev;
2096                 __entry->ino            = inode->i_ino;
2097                 __entry->partial        = partial_cluster;
2098                 __entry->start          = start;
2099                 __entry->ee_lblk        = le32_to_cpu(ex->ee_block);
2100                 __entry->ee_pblk        = ext4_ext_pblock(ex);
2101                 __entry->ee_len         = ext4_ext_get_actual_len(ex);
2102         ),
2103 
2104         TP_printk("dev %d,%d ino %lu start_lblk %u last_extent [%u(%llu), %u]"
2105                   "partial_cluster %lld",
2106                   MAJOR(__entry->dev), MINOR(__entry->dev),
2107                   (unsigned long) __entry->ino,
2108                   (unsigned) __entry->start,
2109                   (unsigned) __entry->ee_lblk,
2110                   (unsigned long long) __entry->ee_pblk,
2111                   (unsigned short) __entry->ee_len,
2112                   (long long) __entry->partial)
2113 );
2114 
2115 TRACE_EVENT(ext4_ext_rm_idx,
2116         TP_PROTO(struct inode *inode, ext4_fsblk_t pblk),
2117 
2118         TP_ARGS(inode, pblk),
2119 
2120         TP_STRUCT__entry(
2121                 __field(        dev_t,          dev     )
2122                 __field(        ino_t,          ino     )
2123                 __field(        ext4_fsblk_t,   pblk    )
2124         ),
2125 
2126         TP_fast_assign(
2127                 __entry->dev    = inode->i_sb->s_dev;
2128                 __entry->ino    = inode->i_ino;
2129                 __entry->pblk   = pblk;
2130         ),
2131 
2132         TP_printk("dev %d,%d ino %lu index_pblk %llu",
2133                   MAJOR(__entry->dev), MINOR(__entry->dev),
2134                   (unsigned long) __entry->ino,
2135                   (unsigned long long) __entry->pblk)
2136 );
2137 
2138 TRACE_EVENT(ext4_ext_remove_space,
2139         TP_PROTO(struct inode *inode, ext4_lblk_t start,
2140                  ext4_lblk_t end, int depth),
2141 
2142         TP_ARGS(inode, start, end, depth),
2143 
2144         TP_STRUCT__entry(
2145                 __field(        dev_t,          dev     )
2146                 __field(        ino_t,          ino     )
2147                 __field(        ext4_lblk_t,    start   )
2148                 __field(        ext4_lblk_t,    end     )
2149                 __field(        int,            depth   )
2150         ),
2151 
2152         TP_fast_assign(
2153                 __entry->dev    = inode->i_sb->s_dev;
2154                 __entry->ino    = inode->i_ino;
2155                 __entry->start  = start;
2156                 __entry->end    = end;
2157                 __entry->depth  = depth;
2158         ),
2159 
2160         TP_printk("dev %d,%d ino %lu since %u end %u depth %d",
2161                   MAJOR(__entry->dev), MINOR(__entry->dev),
2162                   (unsigned long) __entry->ino,
2163                   (unsigned) __entry->start,
2164                   (unsigned) __entry->end,
2165                   __entry->depth)
2166 );
2167 
2168 TRACE_EVENT(ext4_ext_remove_space_done,
2169         TP_PROTO(struct inode *inode, ext4_lblk_t start, ext4_lblk_t end,
2170                  int depth, long long partial, __le16 eh_entries),
2171 
2172         TP_ARGS(inode, start, end, depth, partial, eh_entries),
2173 
2174         TP_STRUCT__entry(
2175                 __field(        dev_t,          dev             )
2176                 __field(        ino_t,          ino             )
2177                 __field(        ext4_lblk_t,    start           )
2178                 __field(        ext4_lblk_t,    end             )
2179                 __field(        int,            depth           )
2180                 __field(        long long,      partial         )
2181                 __field(        unsigned short, eh_entries      )
2182         ),
2183 
2184         TP_fast_assign(
2185                 __entry->dev            = inode->i_sb->s_dev;
2186                 __entry->ino            = inode->i_ino;
2187                 __entry->start          = start;
2188                 __entry->end            = end;
2189                 __entry->depth          = depth;
2190                 __entry->partial        = partial;
2191                 __entry->eh_entries     = le16_to_cpu(eh_entries);
2192         ),
2193 
2194         TP_printk("dev %d,%d ino %lu since %u end %u depth %d partial %lld "
2195                   "remaining_entries %u",
2196                   MAJOR(__entry->dev), MINOR(__entry->dev),
2197                   (unsigned long) __entry->ino,
2198                   (unsigned) __entry->start,
2199                   (unsigned) __entry->end,
2200                   __entry->depth,
2201                   (long long) __entry->partial,
2202                   (unsigned short) __entry->eh_entries)
2203 );
2204 
2205 DECLARE_EVENT_CLASS(ext4__es_extent,
2206         TP_PROTO(struct inode *inode, struct extent_status *es),
2207 
2208         TP_ARGS(inode, es),
2209 
2210         TP_STRUCT__entry(
2211                 __field(        dev_t,          dev             )
2212                 __field(        ino_t,          ino             )
2213                 __field(        ext4_lblk_t,    lblk            )
2214                 __field(        ext4_lblk_t,    len             )
2215                 __field(        ext4_fsblk_t,   pblk            )
2216                 __field(        char, status    )
2217         ),
2218 
2219         TP_fast_assign(
2220                 __entry->dev    = inode->i_sb->s_dev;
2221                 __entry->ino    = inode->i_ino;
2222                 __entry->lblk   = es->es_lblk;
2223                 __entry->len    = es->es_len;
2224                 __entry->pblk   = ext4_es_pblock(es);
2225                 __entry->status = ext4_es_status(es);
2226         ),
2227 
2228         TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
2229                   MAJOR(__entry->dev), MINOR(__entry->dev),
2230                   (unsigned long) __entry->ino,
2231                   __entry->lblk, __entry->len,
2232                   __entry->pblk, show_extent_status(__entry->status))
2233 );
2234 
2235 DEFINE_EVENT(ext4__es_extent, ext4_es_insert_extent,
2236         TP_PROTO(struct inode *inode, struct extent_status *es),
2237 
2238         TP_ARGS(inode, es)
2239 );
2240 
2241 DEFINE_EVENT(ext4__es_extent, ext4_es_cache_extent,
2242         TP_PROTO(struct inode *inode, struct extent_status *es),
2243 
2244         TP_ARGS(inode, es)
2245 );
2246 
2247 TRACE_EVENT(ext4_es_remove_extent,
2248         TP_PROTO(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len),
2249 
2250         TP_ARGS(inode, lblk, len),
2251 
2252         TP_STRUCT__entry(
2253                 __field(        dev_t,  dev                     )
2254                 __field(        ino_t,  ino                     )
2255                 __field(        loff_t, lblk                    )
2256                 __field(        loff_t, len                     )
2257         ),
2258 
2259         TP_fast_assign(
2260                 __entry->dev    = inode->i_sb->s_dev;
2261                 __entry->ino    = inode->i_ino;
2262                 __entry->lblk   = lblk;
2263                 __entry->len    = len;
2264         ),
2265 
2266         TP_printk("dev %d,%d ino %lu es [%lld/%lld)",
2267                   MAJOR(__entry->dev), MINOR(__entry->dev),
2268                   (unsigned long) __entry->ino,
2269                   __entry->lblk, __entry->len)
2270 );
2271 
2272 TRACE_EVENT(ext4_es_find_delayed_extent_range_enter,
2273         TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
2274 
2275         TP_ARGS(inode, lblk),
2276 
2277         TP_STRUCT__entry(
2278                 __field(        dev_t,          dev             )
2279                 __field(        ino_t,          ino             )
2280                 __field(        ext4_lblk_t,    lblk            )
2281         ),
2282 
2283         TP_fast_assign(
2284                 __entry->dev    = inode->i_sb->s_dev;
2285                 __entry->ino    = inode->i_ino;
2286                 __entry->lblk   = lblk;
2287         ),
2288 
2289         TP_printk("dev %d,%d ino %lu lblk %u",
2290                   MAJOR(__entry->dev), MINOR(__entry->dev),
2291                   (unsigned long) __entry->ino, __entry->lblk)
2292 );
2293 
2294 TRACE_EVENT(ext4_es_find_delayed_extent_range_exit,
2295         TP_PROTO(struct inode *inode, struct extent_status *es),
2296 
2297         TP_ARGS(inode, es),
2298 
2299         TP_STRUCT__entry(
2300                 __field(        dev_t,          dev             )
2301                 __field(        ino_t,          ino             )
2302                 __field(        ext4_lblk_t,    lblk            )
2303                 __field(        ext4_lblk_t,    len             )
2304                 __field(        ext4_fsblk_t,   pblk            )
2305                 __field(        char, status    )
2306         ),
2307 
2308         TP_fast_assign(
2309                 __entry->dev    = inode->i_sb->s_dev;
2310                 __entry->ino    = inode->i_ino;
2311                 __entry->lblk   = es->es_lblk;
2312                 __entry->len    = es->es_len;
2313                 __entry->pblk   = ext4_es_pblock(es);
2314                 __entry->status = ext4_es_status(es);
2315         ),
2316 
2317         TP_printk("dev %d,%d ino %lu es [%u/%u) mapped %llu status %s",
2318                   MAJOR(__entry->dev), MINOR(__entry->dev),
2319                   (unsigned long) __entry->ino,
2320                   __entry->lblk, __entry->len,
2321                   __entry->pblk, show_extent_status(__entry->status))
2322 );
2323 
2324 TRACE_EVENT(ext4_es_lookup_extent_enter,
2325         TP_PROTO(struct inode *inode, ext4_lblk_t lblk),
2326 
2327         TP_ARGS(inode, lblk),
2328 
2329         TP_STRUCT__entry(
2330                 __field(        dev_t,          dev             )
2331                 __field(        ino_t,          ino             )
2332                 __field(        ext4_lblk_t,    lblk            )
2333         ),
2334 
2335         TP_fast_assign(
2336                 __entry->dev    = inode->i_sb->s_dev;
2337                 __entry->ino    = inode->i_ino;
2338                 __entry->lblk   = lblk;
2339         ),
2340 
2341         TP_printk("dev %d,%d ino %lu lblk %u",
2342                   MAJOR(__entry->dev), MINOR(__entry->dev),
2343                   (unsigned long) __entry->ino, __entry->lblk)
2344 );
2345 
2346 TRACE_EVENT(ext4_es_lookup_extent_exit,
2347         TP_PROTO(struct inode *inode, struct extent_status *es,
2348                  int found),
2349 
2350         TP_ARGS(inode, es, found),
2351 
2352         TP_STRUCT__entry(
2353                 __field(        dev_t,          dev             )
2354                 __field(        ino_t,          ino             )
2355                 __field(        ext4_lblk_t,    lblk            )
2356                 __field(        ext4_lblk_t,    len             )
2357                 __field(        ext4_fsblk_t,   pblk            )
2358                 __field(        char,           status          )
2359                 __field(        int,            found           )
2360         ),
2361 
2362         TP_fast_assign(
2363                 __entry->dev    = inode->i_sb->s_dev;
2364                 __entry->ino    = inode->i_ino;
2365                 __entry->lblk   = es->es_lblk;
2366                 __entry->len    = es->es_len;
2367                 __entry->pblk   = ext4_es_pblock(es);
2368                 __entry->status = ext4_es_status(es);
2369                 __entry->found  = found;
2370         ),
2371 
2372         TP_printk("dev %d,%d ino %lu found %d [%u/%u) %llu %s",
2373                   MAJOR(__entry->dev), MINOR(__entry->dev),
2374                   (unsigned long) __entry->ino, __entry->found,
2375                   __entry->lblk, __entry->len,
2376                   __entry->found ? __entry->pblk : 0,
2377                   show_extent_status(__entry->found ? __entry->status : 0))
2378 );
2379 
2380 DECLARE_EVENT_CLASS(ext4__es_shrink_enter,
2381         TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
2382 
2383         TP_ARGS(sb, nr_to_scan, cache_cnt),
2384 
2385         TP_STRUCT__entry(
2386                 __field(        dev_t,  dev                     )
2387                 __field(        int,    nr_to_scan              )
2388                 __field(        int,    cache_cnt               )
2389         ),
2390 
2391         TP_fast_assign(
2392                 __entry->dev            = sb->s_dev;
2393                 __entry->nr_to_scan     = nr_to_scan;
2394                 __entry->cache_cnt      = cache_cnt;
2395         ),
2396 
2397         TP_printk("dev %d,%d nr_to_scan %d cache_cnt %d",
2398                   MAJOR(__entry->dev), MINOR(__entry->dev),
2399                   __entry->nr_to_scan, __entry->cache_cnt)
2400 );
2401 
2402 DEFINE_EVENT(ext4__es_shrink_enter, ext4_es_shrink_count,
2403         TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
2404 
2405         TP_ARGS(sb, nr_to_scan, cache_cnt)
2406 );
2407 
2408 DEFINE_EVENT(ext4__es_shrink_enter, ext4_es_shrink_scan_enter,
2409         TP_PROTO(struct super_block *sb, int nr_to_scan, int cache_cnt),
2410 
2411         TP_ARGS(sb, nr_to_scan, cache_cnt)
2412 );
2413 
2414 TRACE_EVENT(ext4_es_shrink_scan_exit,
2415         TP_PROTO(struct super_block *sb, int nr_shrunk, int cache_cnt),
2416 
2417         TP_ARGS(sb, nr_shrunk, cache_cnt),
2418 
2419         TP_STRUCT__entry(
2420                 __field(        dev_t,  dev                     )
2421                 __field(        int,    nr_shrunk               )
2422                 __field(        int,    cache_cnt               )
2423         ),
2424 
2425         TP_fast_assign(
2426                 __entry->dev            = sb->s_dev;
2427                 __entry->nr_shrunk      = nr_shrunk;
2428                 __entry->cache_cnt      = cache_cnt;
2429         ),
2430 
2431         TP_printk("dev %d,%d nr_shrunk %d cache_cnt %d",
2432                   MAJOR(__entry->dev), MINOR(__entry->dev),
2433                   __entry->nr_shrunk, __entry->cache_cnt)
2434 );
2435 
2436 TRACE_EVENT(ext4_collapse_range,
2437         TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2438 
2439         TP_ARGS(inode, offset, len),
2440 
2441         TP_STRUCT__entry(
2442                 __field(dev_t,  dev)
2443                 __field(ino_t,  ino)
2444                 __field(loff_t, offset)
2445                 __field(loff_t, len)
2446         ),
2447 
2448         TP_fast_assign(
2449                 __entry->dev    = inode->i_sb->s_dev;
2450                 __entry->ino    = inode->i_ino;
2451                 __entry->offset = offset;
2452                 __entry->len    = len;
2453         ),
2454 
2455         TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2456                   MAJOR(__entry->dev), MINOR(__entry->dev),
2457                   (unsigned long) __entry->ino,
2458                   __entry->offset, __entry->len)
2459 );
2460 
2461 TRACE_EVENT(ext4_insert_range,
2462         TP_PROTO(struct inode *inode, loff_t offset, loff_t len),
2463 
2464         TP_ARGS(inode, offset, len),
2465 
2466         TP_STRUCT__entry(
2467                 __field(dev_t,  dev)
2468                 __field(ino_t,  ino)
2469                 __field(loff_t, offset)
2470                 __field(loff_t, len)
2471         ),
2472 
2473         TP_fast_assign(
2474                 __entry->dev    = inode->i_sb->s_dev;
2475                 __entry->ino    = inode->i_ino;
2476                 __entry->offset = offset;
2477                 __entry->len    = len;
2478         ),
2479 
2480         TP_printk("dev %d,%d ino %lu offset %lld len %lld",
2481                   MAJOR(__entry->dev), MINOR(__entry->dev),
2482                   (unsigned long) __entry->ino,
2483                   __entry->offset, __entry->len)
2484 );
2485 
2486 TRACE_EVENT(ext4_es_shrink,
2487         TP_PROTO(struct super_block *sb, int nr_shrunk, u64 scan_time,
2488                  int nr_skipped, int retried),
2489 
2490         TP_ARGS(sb, nr_shrunk, scan_time, nr_skipped, retried),
2491 
2492         TP_STRUCT__entry(
2493                 __field(        dev_t,          dev             )
2494                 __field(        int,            nr_shrunk       )
2495                 __field(        unsigned long long, scan_time   )
2496                 __field(        int,            nr_skipped      )
2497                 __field(        int,            retried         )
2498         ),
2499 
2500         TP_fast_assign(
2501                 __entry->dev            = sb->s_dev;
2502                 __entry->nr_shrunk      = nr_shrunk;
2503                 __entry->scan_time      = div_u64(scan_time, 1000);
2504                 __entry->nr_skipped     = nr_skipped;
2505                 __entry->retried        = retried;
2506         ),
2507 
2508         TP_printk("dev %d,%d nr_shrunk %d, scan_time %llu "
2509                   "nr_skipped %d retried %d",
2510                   MAJOR(__entry->dev), MINOR(__entry->dev), __entry->nr_shrunk,
2511                   __entry->scan_time, __entry->nr_skipped, __entry->retried)
2512 );
2513 
2514 /* fsmap traces */
2515 DECLARE_EVENT_CLASS(ext4_fsmap_class,
2516         TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len,
2517                  u64 owner),
2518         TP_ARGS(sb, keydev, agno, bno, len, owner),
2519         TP_STRUCT__entry(
2520                 __field(dev_t, dev)
2521                 __field(dev_t, keydev)
2522                 __field(u32, agno)
2523                 __field(u64, bno)
2524                 __field(u64, len)
2525                 __field(u64, owner)
2526         ),
2527         TP_fast_assign(
2528                 __entry->dev = sb->s_bdev->bd_dev;
2529                 __entry->keydev = new_decode_dev(keydev);
2530                 __entry->agno = agno;
2531                 __entry->bno = bno;
2532                 __entry->len = len;
2533                 __entry->owner = owner;
2534         ),
2535         TP_printk("dev %d:%d keydev %d:%d agno %u bno %llu len %llu owner %lld\n",
2536                   MAJOR(__entry->dev), MINOR(__entry->dev),
2537                   MAJOR(__entry->keydev), MINOR(__entry->keydev),
2538                   __entry->agno,
2539                   __entry->bno,
2540                   __entry->len,
2541                   __entry->owner)
2542 )
2543 #define DEFINE_FSMAP_EVENT(name) \
2544 DEFINE_EVENT(ext4_fsmap_class, name, \
2545         TP_PROTO(struct super_block *sb, u32 keydev, u32 agno, u64 bno, u64 len, \
2546                  u64 owner), \
2547         TP_ARGS(sb, keydev, agno, bno, len, owner))
2548 DEFINE_FSMAP_EVENT(ext4_fsmap_low_key);
2549 DEFINE_FSMAP_EVENT(ext4_fsmap_high_key);
2550 DEFINE_FSMAP_EVENT(ext4_fsmap_mapping);
2551 
2552 DECLARE_EVENT_CLASS(ext4_getfsmap_class,
2553         TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap),
2554         TP_ARGS(sb, fsmap),
2555         TP_STRUCT__entry(
2556                 __field(dev_t, dev)
2557                 __field(dev_t, keydev)
2558                 __field(u64, block)
2559                 __field(u64, len)
2560                 __field(u64, owner)
2561                 __field(u64, flags)
2562         ),
2563         TP_fast_assign(
2564                 __entry->dev = sb->s_bdev->bd_dev;
2565                 __entry->keydev = new_decode_dev(fsmap->fmr_device);
2566                 __entry->block = fsmap->fmr_physical;
2567                 __entry->len = fsmap->fmr_length;
2568                 __entry->owner = fsmap->fmr_owner;
2569                 __entry->flags = fsmap->fmr_flags;
2570         ),
2571         TP_printk("dev %d:%d keydev %d:%d block %llu len %llu owner %lld flags 0x%llx\n",
2572                   MAJOR(__entry->dev), MINOR(__entry->dev),
2573                   MAJOR(__entry->keydev), MINOR(__entry->keydev),
2574                   __entry->block,
2575                   __entry->len,
2576                   __entry->owner,
2577                   __entry->flags)
2578 )
2579 #define DEFINE_GETFSMAP_EVENT(name) \
2580 DEFINE_EVENT(ext4_getfsmap_class, name, \
2581         TP_PROTO(struct super_block *sb, struct ext4_fsmap *fsmap), \
2582         TP_ARGS(sb, fsmap))
2583 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_low_key);
2584 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_high_key);
2585 DEFINE_GETFSMAP_EVENT(ext4_getfsmap_mapping);
2586 
2587 #endif /* _TRACE_EXT4_H */
2588 
2589 /* This part must be outside protection */
2590 #include <trace/define_trace.h>
2591 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp