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