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