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