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