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