xref: /openbmc/linux/include/trace/events/f2fs.h (revision abcda807)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM f2fs
4 
5 #if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_F2FS_H
7 
8 #include <linux/tracepoint.h>
9 
10 #define show_dev(dev)		MAJOR(dev), MINOR(dev)
11 #define show_dev_ino(entry)	show_dev(entry->dev), (unsigned long)entry->ino
12 
13 TRACE_DEFINE_ENUM(NODE);
14 TRACE_DEFINE_ENUM(DATA);
15 TRACE_DEFINE_ENUM(META);
16 TRACE_DEFINE_ENUM(META_FLUSH);
17 TRACE_DEFINE_ENUM(INMEM);
18 TRACE_DEFINE_ENUM(INMEM_DROP);
19 TRACE_DEFINE_ENUM(INMEM_INVALIDATE);
20 TRACE_DEFINE_ENUM(INMEM_REVOKE);
21 TRACE_DEFINE_ENUM(IPU);
22 TRACE_DEFINE_ENUM(OPU);
23 TRACE_DEFINE_ENUM(HOT);
24 TRACE_DEFINE_ENUM(WARM);
25 TRACE_DEFINE_ENUM(COLD);
26 TRACE_DEFINE_ENUM(CURSEG_HOT_DATA);
27 TRACE_DEFINE_ENUM(CURSEG_WARM_DATA);
28 TRACE_DEFINE_ENUM(CURSEG_COLD_DATA);
29 TRACE_DEFINE_ENUM(CURSEG_HOT_NODE);
30 TRACE_DEFINE_ENUM(CURSEG_WARM_NODE);
31 TRACE_DEFINE_ENUM(CURSEG_COLD_NODE);
32 TRACE_DEFINE_ENUM(NO_CHECK_TYPE);
33 TRACE_DEFINE_ENUM(GC_GREEDY);
34 TRACE_DEFINE_ENUM(GC_CB);
35 TRACE_DEFINE_ENUM(FG_GC);
36 TRACE_DEFINE_ENUM(BG_GC);
37 TRACE_DEFINE_ENUM(LFS);
38 TRACE_DEFINE_ENUM(SSR);
39 TRACE_DEFINE_ENUM(__REQ_RAHEAD);
40 TRACE_DEFINE_ENUM(__REQ_SYNC);
41 TRACE_DEFINE_ENUM(__REQ_IDLE);
42 TRACE_DEFINE_ENUM(__REQ_PREFLUSH);
43 TRACE_DEFINE_ENUM(__REQ_FUA);
44 TRACE_DEFINE_ENUM(__REQ_PRIO);
45 TRACE_DEFINE_ENUM(__REQ_META);
46 TRACE_DEFINE_ENUM(CP_UMOUNT);
47 TRACE_DEFINE_ENUM(CP_FASTBOOT);
48 TRACE_DEFINE_ENUM(CP_SYNC);
49 TRACE_DEFINE_ENUM(CP_RECOVERY);
50 TRACE_DEFINE_ENUM(CP_DISCARD);
51 TRACE_DEFINE_ENUM(CP_TRIMMED);
52 TRACE_DEFINE_ENUM(CP_PAUSE);
53 TRACE_DEFINE_ENUM(CP_RESIZE);
54 
55 #define show_block_type(type)						\
56 	__print_symbolic(type,						\
57 		{ NODE,		"NODE" },				\
58 		{ DATA,		"DATA" },				\
59 		{ META,		"META" },				\
60 		{ META_FLUSH,	"META_FLUSH" },				\
61 		{ INMEM,	"INMEM" },				\
62 		{ INMEM_DROP,	"INMEM_DROP" },				\
63 		{ INMEM_INVALIDATE,	"INMEM_INVALIDATE" },		\
64 		{ INMEM_REVOKE,	"INMEM_REVOKE" },			\
65 		{ IPU,		"IN-PLACE" },				\
66 		{ OPU,		"OUT-OF-PLACE" })
67 
68 #define show_block_temp(temp)						\
69 	__print_symbolic(temp,						\
70 		{ HOT,		"HOT" },				\
71 		{ WARM,		"WARM" },				\
72 		{ COLD,		"COLD" })
73 
74 #define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO |	\
75 			REQ_PREFLUSH | REQ_FUA)
76 #define F2FS_BIO_FLAG_MASK(t)	(t & F2FS_OP_FLAGS)
77 
78 #define show_bio_type(op,op_flags)	show_bio_op(op),		\
79 						show_bio_op_flags(op_flags)
80 
81 #define show_bio_op(op)		blk_op_str(op)
82 
83 #define show_bio_op_flags(flags)					\
84 	__print_flags(F2FS_BIO_FLAG_MASK(flags), "|",			\
85 		{ REQ_RAHEAD,		"R" },				\
86 		{ REQ_SYNC,		"S" },				\
87 		{ REQ_META,		"M" },				\
88 		{ REQ_PRIO,		"P" },				\
89 		{ REQ_PREFLUSH,		"PF" },				\
90 		{ REQ_FUA,		"FUA" })
91 
92 #define show_data_type(type)						\
93 	__print_symbolic(type,						\
94 		{ CURSEG_HOT_DATA, 	"Hot DATA" },			\
95 		{ CURSEG_WARM_DATA, 	"Warm DATA" },			\
96 		{ CURSEG_COLD_DATA, 	"Cold DATA" },			\
97 		{ CURSEG_HOT_NODE, 	"Hot NODE" },			\
98 		{ CURSEG_WARM_NODE, 	"Warm NODE" },			\
99 		{ CURSEG_COLD_NODE, 	"Cold NODE" },			\
100 		{ NO_CHECK_TYPE, 	"No TYPE" })
101 
102 #define show_file_type(type)						\
103 	__print_symbolic(type,						\
104 		{ 0,		"FILE" },				\
105 		{ 1,		"DIR" })
106 
107 #define show_gc_type(type)						\
108 	__print_symbolic(type,						\
109 		{ FG_GC,	"Foreground GC" },			\
110 		{ BG_GC,	"Background GC" })
111 
112 #define show_alloc_mode(type)						\
113 	__print_symbolic(type,						\
114 		{ LFS,		"LFS-mode" },				\
115 		{ SSR,		"SSR-mode" },				\
116 		{ AT_SSR,	"AT_SSR-mode" })
117 
118 #define show_victim_policy(type)					\
119 	__print_symbolic(type,						\
120 		{ GC_GREEDY,	"Greedy" },				\
121 		{ GC_CB,	"Cost-Benefit" },			\
122 		{ GC_AT,	"Age-threshold" })
123 
124 #define show_cpreason(type)						\
125 	__print_flags(type, "|",					\
126 		{ CP_UMOUNT,	"Umount" },				\
127 		{ CP_FASTBOOT,	"Fastboot" },				\
128 		{ CP_SYNC,	"Sync" },				\
129 		{ CP_RECOVERY,	"Recovery" },				\
130 		{ CP_DISCARD,	"Discard" },				\
131 		{ CP_PAUSE,	"Pause" },				\
132 		{ CP_TRIMMED,	"Trimmed" },				\
133 		{ CP_RESIZE,	"Resize" })
134 
135 #define show_fsync_cpreason(type)					\
136 	__print_symbolic(type,						\
137 		{ CP_NO_NEEDED,		"no needed" },			\
138 		{ CP_NON_REGULAR,	"non regular" },		\
139 		{ CP_COMPRESSED,	"compressed" },			\
140 		{ CP_HARDLINK,		"hardlink" },			\
141 		{ CP_SB_NEED_CP,	"sb needs cp" },		\
142 		{ CP_WRONG_PINO,	"wrong pino" },			\
143 		{ CP_NO_SPC_ROLL,	"no space roll forward" },	\
144 		{ CP_NODE_NEED_CP,	"node needs cp" },		\
145 		{ CP_FASTBOOT_MODE,	"fastboot mode" },		\
146 		{ CP_SPEC_LOG_NUM,	"log type is 2" },		\
147 		{ CP_RECOVER_DIR,	"dir needs recovery" })
148 
149 #define show_shutdown_mode(type)					\
150 	__print_symbolic(type,						\
151 		{ F2FS_GOING_DOWN_FULLSYNC,	"full sync" },		\
152 		{ F2FS_GOING_DOWN_METASYNC,	"meta sync" },		\
153 		{ F2FS_GOING_DOWN_NOSYNC,	"no sync" },		\
154 		{ F2FS_GOING_DOWN_METAFLUSH,	"meta flush" },		\
155 		{ F2FS_GOING_DOWN_NEED_FSCK,	"need fsck" })
156 
157 #define show_compress_algorithm(type)					\
158 	__print_symbolic(type,						\
159 		{ COMPRESS_LZO,		"LZO" },			\
160 		{ COMPRESS_LZ4,		"LZ4" },			\
161 		{ COMPRESS_ZSTD,	"ZSTD" },			\
162 		{ COMPRESS_LZORLE,	"LZO-RLE" })
163 
164 struct f2fs_sb_info;
165 struct f2fs_io_info;
166 struct extent_info;
167 struct victim_sel_policy;
168 struct f2fs_map_blocks;
169 
170 DECLARE_EVENT_CLASS(f2fs__inode,
171 
172 	TP_PROTO(struct inode *inode),
173 
174 	TP_ARGS(inode),
175 
176 	TP_STRUCT__entry(
177 		__field(dev_t,	dev)
178 		__field(ino_t,	ino)
179 		__field(ino_t,	pino)
180 		__field(umode_t, mode)
181 		__field(loff_t,	size)
182 		__field(unsigned int, nlink)
183 		__field(blkcnt_t, blocks)
184 		__field(__u8,	advise)
185 	),
186 
187 	TP_fast_assign(
188 		__entry->dev	= inode->i_sb->s_dev;
189 		__entry->ino	= inode->i_ino;
190 		__entry->pino	= F2FS_I(inode)->i_pino;
191 		__entry->mode	= inode->i_mode;
192 		__entry->nlink	= inode->i_nlink;
193 		__entry->size	= inode->i_size;
194 		__entry->blocks	= inode->i_blocks;
195 		__entry->advise	= F2FS_I(inode)->i_advise;
196 	),
197 
198 	TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
199 		"i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
200 		show_dev_ino(__entry),
201 		(unsigned long)__entry->pino,
202 		__entry->mode,
203 		__entry->size,
204 		(unsigned int)__entry->nlink,
205 		(unsigned long long)__entry->blocks,
206 		(unsigned char)__entry->advise)
207 );
208 
209 DECLARE_EVENT_CLASS(f2fs__inode_exit,
210 
211 	TP_PROTO(struct inode *inode, int ret),
212 
213 	TP_ARGS(inode, ret),
214 
215 	TP_STRUCT__entry(
216 		__field(dev_t,	dev)
217 		__field(ino_t,	ino)
218 		__field(int,	ret)
219 	),
220 
221 	TP_fast_assign(
222 		__entry->dev	= inode->i_sb->s_dev;
223 		__entry->ino	= inode->i_ino;
224 		__entry->ret	= ret;
225 	),
226 
227 	TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
228 		show_dev_ino(__entry),
229 		__entry->ret)
230 );
231 
232 DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
233 
234 	TP_PROTO(struct inode *inode),
235 
236 	TP_ARGS(inode)
237 );
238 
239 TRACE_EVENT(f2fs_sync_file_exit,
240 
241 	TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
242 
243 	TP_ARGS(inode, cp_reason, datasync, ret),
244 
245 	TP_STRUCT__entry(
246 		__field(dev_t,	dev)
247 		__field(ino_t,	ino)
248 		__field(int,	cp_reason)
249 		__field(int,	datasync)
250 		__field(int,	ret)
251 	),
252 
253 	TP_fast_assign(
254 		__entry->dev		= inode->i_sb->s_dev;
255 		__entry->ino		= inode->i_ino;
256 		__entry->cp_reason	= cp_reason;
257 		__entry->datasync	= datasync;
258 		__entry->ret		= ret;
259 	),
260 
261 	TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
262 		"datasync = %d, ret = %d",
263 		show_dev_ino(__entry),
264 		show_fsync_cpreason(__entry->cp_reason),
265 		__entry->datasync,
266 		__entry->ret)
267 );
268 
269 TRACE_EVENT(f2fs_sync_fs,
270 
271 	TP_PROTO(struct super_block *sb, int wait),
272 
273 	TP_ARGS(sb, wait),
274 
275 	TP_STRUCT__entry(
276 		__field(dev_t,	dev)
277 		__field(int,	dirty)
278 		__field(int,	wait)
279 	),
280 
281 	TP_fast_assign(
282 		__entry->dev	= sb->s_dev;
283 		__entry->dirty	= is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
284 		__entry->wait	= wait;
285 	),
286 
287 	TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
288 		show_dev(__entry->dev),
289 		__entry->dirty ? "dirty" : "not dirty",
290 		__entry->wait)
291 );
292 
293 DEFINE_EVENT(f2fs__inode, f2fs_iget,
294 
295 	TP_PROTO(struct inode *inode),
296 
297 	TP_ARGS(inode)
298 );
299 
300 DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
301 
302 	TP_PROTO(struct inode *inode, int ret),
303 
304 	TP_ARGS(inode, ret)
305 );
306 
307 DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
308 
309 	TP_PROTO(struct inode *inode),
310 
311 	TP_ARGS(inode)
312 );
313 
314 DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
315 
316 	TP_PROTO(struct inode *inode, int ret),
317 
318 	TP_ARGS(inode, ret)
319 );
320 
321 TRACE_EVENT(f2fs_unlink_enter,
322 
323 	TP_PROTO(struct inode *dir, struct dentry *dentry),
324 
325 	TP_ARGS(dir, dentry),
326 
327 	TP_STRUCT__entry(
328 		__field(dev_t,	dev)
329 		__field(ino_t,	ino)
330 		__field(loff_t,	size)
331 		__field(blkcnt_t, blocks)
332 		__field(const char *,	name)
333 	),
334 
335 	TP_fast_assign(
336 		__entry->dev	= dir->i_sb->s_dev;
337 		__entry->ino	= dir->i_ino;
338 		__entry->size	= dir->i_size;
339 		__entry->blocks	= dir->i_blocks;
340 		__entry->name	= dentry->d_name.name;
341 	),
342 
343 	TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
344 		"i_blocks = %llu, name = %s",
345 		show_dev_ino(__entry),
346 		__entry->size,
347 		(unsigned long long)__entry->blocks,
348 		__entry->name)
349 );
350 
351 DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
352 
353 	TP_PROTO(struct inode *inode, int ret),
354 
355 	TP_ARGS(inode, ret)
356 );
357 
358 DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
359 
360 	TP_PROTO(struct inode *inode, int ret),
361 
362 	TP_ARGS(inode, ret)
363 );
364 
365 DEFINE_EVENT(f2fs__inode, f2fs_truncate,
366 
367 	TP_PROTO(struct inode *inode),
368 
369 	TP_ARGS(inode)
370 );
371 
372 TRACE_EVENT(f2fs_truncate_data_blocks_range,
373 
374 	TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
375 
376 	TP_ARGS(inode, nid,  ofs, free),
377 
378 	TP_STRUCT__entry(
379 		__field(dev_t,	dev)
380 		__field(ino_t,	ino)
381 		__field(nid_t,	nid)
382 		__field(unsigned int,	ofs)
383 		__field(int,	free)
384 	),
385 
386 	TP_fast_assign(
387 		__entry->dev	= inode->i_sb->s_dev;
388 		__entry->ino	= inode->i_ino;
389 		__entry->nid	= nid;
390 		__entry->ofs	= ofs;
391 		__entry->free	= free;
392 	),
393 
394 	TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
395 		show_dev_ino(__entry),
396 		(unsigned int)__entry->nid,
397 		__entry->ofs,
398 		__entry->free)
399 );
400 
401 DECLARE_EVENT_CLASS(f2fs__truncate_op,
402 
403 	TP_PROTO(struct inode *inode, u64 from),
404 
405 	TP_ARGS(inode, from),
406 
407 	TP_STRUCT__entry(
408 		__field(dev_t,	dev)
409 		__field(ino_t,	ino)
410 		__field(loff_t,	size)
411 		__field(blkcnt_t, blocks)
412 		__field(u64,	from)
413 	),
414 
415 	TP_fast_assign(
416 		__entry->dev	= inode->i_sb->s_dev;
417 		__entry->ino	= inode->i_ino;
418 		__entry->size	= inode->i_size;
419 		__entry->blocks	= inode->i_blocks;
420 		__entry->from	= from;
421 	),
422 
423 	TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
424 		"start file offset = %llu",
425 		show_dev_ino(__entry),
426 		__entry->size,
427 		(unsigned long long)__entry->blocks,
428 		(unsigned long long)__entry->from)
429 );
430 
431 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
432 
433 	TP_PROTO(struct inode *inode, u64 from),
434 
435 	TP_ARGS(inode, from)
436 );
437 
438 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
439 
440 	TP_PROTO(struct inode *inode, int ret),
441 
442 	TP_ARGS(inode, ret)
443 );
444 
445 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
446 
447 	TP_PROTO(struct inode *inode, u64 from),
448 
449 	TP_ARGS(inode, from)
450 );
451 
452 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
453 
454 	TP_PROTO(struct inode *inode, int ret),
455 
456 	TP_ARGS(inode, ret)
457 );
458 
459 DECLARE_EVENT_CLASS(f2fs__truncate_node,
460 
461 	TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
462 
463 	TP_ARGS(inode, nid, blk_addr),
464 
465 	TP_STRUCT__entry(
466 		__field(dev_t,	dev)
467 		__field(ino_t,	ino)
468 		__field(nid_t,	nid)
469 		__field(block_t,	blk_addr)
470 	),
471 
472 	TP_fast_assign(
473 		__entry->dev		= inode->i_sb->s_dev;
474 		__entry->ino		= inode->i_ino;
475 		__entry->nid		= nid;
476 		__entry->blk_addr	= blk_addr;
477 	),
478 
479 	TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
480 		show_dev_ino(__entry),
481 		(unsigned int)__entry->nid,
482 		(unsigned long long)__entry->blk_addr)
483 );
484 
485 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
486 
487 	TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
488 
489 	TP_ARGS(inode, nid, blk_addr)
490 );
491 
492 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
493 
494 	TP_PROTO(struct inode *inode, int ret),
495 
496 	TP_ARGS(inode, ret)
497 );
498 
499 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
500 
501 	TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
502 
503 	TP_ARGS(inode, nid, blk_addr)
504 );
505 
506 TRACE_EVENT(f2fs_truncate_partial_nodes,
507 
508 	TP_PROTO(struct inode *inode, nid_t *nid, int depth, int err),
509 
510 	TP_ARGS(inode, nid, depth, err),
511 
512 	TP_STRUCT__entry(
513 		__field(dev_t,	dev)
514 		__field(ino_t,	ino)
515 		__field(nid_t,	nid[3])
516 		__field(int,	depth)
517 		__field(int,	err)
518 	),
519 
520 	TP_fast_assign(
521 		__entry->dev	= inode->i_sb->s_dev;
522 		__entry->ino	= inode->i_ino;
523 		__entry->nid[0]	= nid[0];
524 		__entry->nid[1]	= nid[1];
525 		__entry->nid[2]	= nid[2];
526 		__entry->depth	= depth;
527 		__entry->err	= err;
528 	),
529 
530 	TP_printk("dev = (%d,%d), ino = %lu, "
531 		"nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
532 		show_dev_ino(__entry),
533 		(unsigned int)__entry->nid[0],
534 		(unsigned int)__entry->nid[1],
535 		(unsigned int)__entry->nid[2],
536 		__entry->depth,
537 		__entry->err)
538 );
539 
540 TRACE_EVENT(f2fs_file_write_iter,
541 
542 	TP_PROTO(struct inode *inode, unsigned long offset,
543 		unsigned long length, int ret),
544 
545 	TP_ARGS(inode, offset, length, ret),
546 
547 	TP_STRUCT__entry(
548 		__field(dev_t,	dev)
549 		__field(ino_t,	ino)
550 		__field(unsigned long, offset)
551 		__field(unsigned long, length)
552 		__field(int,	ret)
553 	),
554 
555 	TP_fast_assign(
556 		__entry->dev	= inode->i_sb->s_dev;
557 		__entry->ino	= inode->i_ino;
558 		__entry->offset	= offset;
559 		__entry->length	= length;
560 		__entry->ret	= ret;
561 	),
562 
563 	TP_printk("dev = (%d,%d), ino = %lu, "
564 		"offset = %lu, length = %lu, written(err) = %d",
565 		show_dev_ino(__entry),
566 		__entry->offset,
567 		__entry->length,
568 		__entry->ret)
569 );
570 
571 TRACE_EVENT(f2fs_map_blocks,
572 	TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
573 
574 	TP_ARGS(inode, map, ret),
575 
576 	TP_STRUCT__entry(
577 		__field(dev_t,	dev)
578 		__field(ino_t,	ino)
579 		__field(block_t,	m_lblk)
580 		__field(block_t,	m_pblk)
581 		__field(unsigned int,	m_len)
582 		__field(unsigned int,	m_flags)
583 		__field(int,	m_seg_type)
584 		__field(bool,	m_may_create)
585 		__field(int,	ret)
586 	),
587 
588 	TP_fast_assign(
589 		__entry->dev		= inode->i_sb->s_dev;
590 		__entry->ino		= inode->i_ino;
591 		__entry->m_lblk		= map->m_lblk;
592 		__entry->m_pblk		= map->m_pblk;
593 		__entry->m_len		= map->m_len;
594 		__entry->m_flags	= map->m_flags;
595 		__entry->m_seg_type	= map->m_seg_type;
596 		__entry->m_may_create	= map->m_may_create;
597 		__entry->ret		= ret;
598 	),
599 
600 	TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
601 		"start blkaddr = 0x%llx, len = 0x%llx, flags = %u,"
602 		"seg_type = %d, may_create = %d, err = %d",
603 		show_dev_ino(__entry),
604 		(unsigned long long)__entry->m_lblk,
605 		(unsigned long long)__entry->m_pblk,
606 		(unsigned long long)__entry->m_len,
607 		__entry->m_flags,
608 		__entry->m_seg_type,
609 		__entry->m_may_create,
610 		__entry->ret)
611 );
612 
613 TRACE_EVENT(f2fs_background_gc,
614 
615 	TP_PROTO(struct super_block *sb, unsigned int wait_ms,
616 			unsigned int prefree, unsigned int free),
617 
618 	TP_ARGS(sb, wait_ms, prefree, free),
619 
620 	TP_STRUCT__entry(
621 		__field(dev_t,	dev)
622 		__field(unsigned int,	wait_ms)
623 		__field(unsigned int,	prefree)
624 		__field(unsigned int,	free)
625 	),
626 
627 	TP_fast_assign(
628 		__entry->dev		= sb->s_dev;
629 		__entry->wait_ms	= wait_ms;
630 		__entry->prefree	= prefree;
631 		__entry->free		= free;
632 	),
633 
634 	TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
635 		show_dev(__entry->dev),
636 		__entry->wait_ms,
637 		__entry->prefree,
638 		__entry->free)
639 );
640 
641 TRACE_EVENT(f2fs_gc_begin,
642 
643 	TP_PROTO(struct super_block *sb, bool sync, bool background,
644 			long long dirty_nodes, long long dirty_dents,
645 			long long dirty_imeta, unsigned int free_sec,
646 			unsigned int free_seg, int reserved_seg,
647 			unsigned int prefree_seg),
648 
649 	TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
650 		free_sec, free_seg, reserved_seg, prefree_seg),
651 
652 	TP_STRUCT__entry(
653 		__field(dev_t,		dev)
654 		__field(bool,		sync)
655 		__field(bool,		background)
656 		__field(long long,	dirty_nodes)
657 		__field(long long,	dirty_dents)
658 		__field(long long,	dirty_imeta)
659 		__field(unsigned int,	free_sec)
660 		__field(unsigned int,	free_seg)
661 		__field(int,		reserved_seg)
662 		__field(unsigned int,	prefree_seg)
663 	),
664 
665 	TP_fast_assign(
666 		__entry->dev		= sb->s_dev;
667 		__entry->sync		= sync;
668 		__entry->background	= background;
669 		__entry->dirty_nodes	= dirty_nodes;
670 		__entry->dirty_dents	= dirty_dents;
671 		__entry->dirty_imeta	= dirty_imeta;
672 		__entry->free_sec	= free_sec;
673 		__entry->free_seg	= free_seg;
674 		__entry->reserved_seg	= reserved_seg;
675 		__entry->prefree_seg	= prefree_seg;
676 	),
677 
678 	TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
679 		"dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
680 		"rsv_seg:%d, prefree_seg:%u",
681 		show_dev(__entry->dev),
682 		__entry->sync,
683 		__entry->background,
684 		__entry->dirty_nodes,
685 		__entry->dirty_dents,
686 		__entry->dirty_imeta,
687 		__entry->free_sec,
688 		__entry->free_seg,
689 		__entry->reserved_seg,
690 		__entry->prefree_seg)
691 );
692 
693 TRACE_EVENT(f2fs_gc_end,
694 
695 	TP_PROTO(struct super_block *sb, int ret, int seg_freed,
696 			int sec_freed, long long dirty_nodes,
697 			long long dirty_dents, long long dirty_imeta,
698 			unsigned int free_sec, unsigned int free_seg,
699 			int reserved_seg, unsigned int prefree_seg),
700 
701 	TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
702 		dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
703 
704 	TP_STRUCT__entry(
705 		__field(dev_t,		dev)
706 		__field(int,		ret)
707 		__field(int,		seg_freed)
708 		__field(int,		sec_freed)
709 		__field(long long,	dirty_nodes)
710 		__field(long long,	dirty_dents)
711 		__field(long long,	dirty_imeta)
712 		__field(unsigned int,	free_sec)
713 		__field(unsigned int,	free_seg)
714 		__field(int,		reserved_seg)
715 		__field(unsigned int,	prefree_seg)
716 	),
717 
718 	TP_fast_assign(
719 		__entry->dev		= sb->s_dev;
720 		__entry->ret		= ret;
721 		__entry->seg_freed	= seg_freed;
722 		__entry->sec_freed	= sec_freed;
723 		__entry->dirty_nodes	= dirty_nodes;
724 		__entry->dirty_dents	= dirty_dents;
725 		__entry->dirty_imeta	= dirty_imeta;
726 		__entry->free_sec	= free_sec;
727 		__entry->free_seg	= free_seg;
728 		__entry->reserved_seg	= reserved_seg;
729 		__entry->prefree_seg	= prefree_seg;
730 	),
731 
732 	TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
733 		"nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
734 		"free_seg:%u, rsv_seg:%d, prefree_seg:%u",
735 		show_dev(__entry->dev),
736 		__entry->ret,
737 		__entry->seg_freed,
738 		__entry->sec_freed,
739 		__entry->dirty_nodes,
740 		__entry->dirty_dents,
741 		__entry->dirty_imeta,
742 		__entry->free_sec,
743 		__entry->free_seg,
744 		__entry->reserved_seg,
745 		__entry->prefree_seg)
746 );
747 
748 TRACE_EVENT(f2fs_get_victim,
749 
750 	TP_PROTO(struct super_block *sb, int type, int gc_type,
751 			struct victim_sel_policy *p, unsigned int pre_victim,
752 			unsigned int prefree, unsigned int free),
753 
754 	TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
755 
756 	TP_STRUCT__entry(
757 		__field(dev_t,	dev)
758 		__field(int,	type)
759 		__field(int,	gc_type)
760 		__field(int,	alloc_mode)
761 		__field(int,	gc_mode)
762 		__field(unsigned int,	victim)
763 		__field(unsigned int,	cost)
764 		__field(unsigned int,	ofs_unit)
765 		__field(unsigned int,	pre_victim)
766 		__field(unsigned int,	prefree)
767 		__field(unsigned int,	free)
768 	),
769 
770 	TP_fast_assign(
771 		__entry->dev		= sb->s_dev;
772 		__entry->type		= type;
773 		__entry->gc_type	= gc_type;
774 		__entry->alloc_mode	= p->alloc_mode;
775 		__entry->gc_mode	= p->gc_mode;
776 		__entry->victim		= p->min_segno;
777 		__entry->cost		= p->min_cost;
778 		__entry->ofs_unit	= p->ofs_unit;
779 		__entry->pre_victim	= pre_victim;
780 		__entry->prefree	= prefree;
781 		__entry->free		= free;
782 	),
783 
784 	TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
785 		"victim = %u, cost = %u, ofs_unit = %u, "
786 		"pre_victim_secno = %d, prefree = %u, free = %u",
787 		show_dev(__entry->dev),
788 		show_data_type(__entry->type),
789 		show_gc_type(__entry->gc_type),
790 		show_alloc_mode(__entry->alloc_mode),
791 		show_victim_policy(__entry->gc_mode),
792 		__entry->victim,
793 		__entry->cost,
794 		__entry->ofs_unit,
795 		(int)__entry->pre_victim,
796 		__entry->prefree,
797 		__entry->free)
798 );
799 
800 TRACE_EVENT(f2fs_lookup_start,
801 
802 	TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
803 
804 	TP_ARGS(dir, dentry, flags),
805 
806 	TP_STRUCT__entry(
807 		__field(dev_t,	dev)
808 		__field(ino_t,	ino)
809 		__field(const char *,	name)
810 		__field(unsigned int, flags)
811 	),
812 
813 	TP_fast_assign(
814 		__entry->dev	= dir->i_sb->s_dev;
815 		__entry->ino	= dir->i_ino;
816 		__entry->name	= dentry->d_name.name;
817 		__entry->flags	= flags;
818 	),
819 
820 	TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
821 		show_dev_ino(__entry),
822 		__entry->name,
823 		__entry->flags)
824 );
825 
826 TRACE_EVENT(f2fs_lookup_end,
827 
828 	TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
829 		int err),
830 
831 	TP_ARGS(dir, dentry, ino, err),
832 
833 	TP_STRUCT__entry(
834 		__field(dev_t,	dev)
835 		__field(ino_t,	ino)
836 		__field(const char *,	name)
837 		__field(nid_t,	cino)
838 		__field(int,	err)
839 	),
840 
841 	TP_fast_assign(
842 		__entry->dev	= dir->i_sb->s_dev;
843 		__entry->ino	= dir->i_ino;
844 		__entry->name	= dentry->d_name.name;
845 		__entry->cino	= ino;
846 		__entry->err	= err;
847 	),
848 
849 	TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
850 		show_dev_ino(__entry),
851 		__entry->name,
852 		__entry->cino,
853 		__entry->err)
854 );
855 
856 TRACE_EVENT(f2fs_readdir,
857 
858 	TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
859 
860 	TP_ARGS(dir, start_pos, end_pos, err),
861 
862 	TP_STRUCT__entry(
863 		__field(dev_t,	dev)
864 		__field(ino_t,	ino)
865 		__field(loff_t,	start)
866 		__field(loff_t,	end)
867 		__field(int,	err)
868 	),
869 
870 	TP_fast_assign(
871 		__entry->dev	= dir->i_sb->s_dev;
872 		__entry->ino	= dir->i_ino;
873 		__entry->start	= start_pos;
874 		__entry->end	= end_pos;
875 		__entry->err	= err;
876 	),
877 
878 	TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
879 		show_dev_ino(__entry),
880 		__entry->start,
881 		__entry->end,
882 		__entry->err)
883 );
884 
885 TRACE_EVENT(f2fs_fallocate,
886 
887 	TP_PROTO(struct inode *inode, int mode,
888 				loff_t offset, loff_t len, int ret),
889 
890 	TP_ARGS(inode, mode, offset, len, ret),
891 
892 	TP_STRUCT__entry(
893 		__field(dev_t,	dev)
894 		__field(ino_t,	ino)
895 		__field(int,	mode)
896 		__field(loff_t,	offset)
897 		__field(loff_t,	len)
898 		__field(loff_t, size)
899 		__field(blkcnt_t, blocks)
900 		__field(int,	ret)
901 	),
902 
903 	TP_fast_assign(
904 		__entry->dev	= inode->i_sb->s_dev;
905 		__entry->ino	= inode->i_ino;
906 		__entry->mode	= mode;
907 		__entry->offset	= offset;
908 		__entry->len	= len;
909 		__entry->size	= inode->i_size;
910 		__entry->blocks = inode->i_blocks;
911 		__entry->ret	= ret;
912 	),
913 
914 	TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
915 		"len = %lld,  i_size = %lld, i_blocks = %llu, ret = %d",
916 		show_dev_ino(__entry),
917 		__entry->mode,
918 		(unsigned long long)__entry->offset,
919 		(unsigned long long)__entry->len,
920 		(unsigned long long)__entry->size,
921 		(unsigned long long)__entry->blocks,
922 		__entry->ret)
923 );
924 
925 TRACE_EVENT(f2fs_direct_IO_enter,
926 
927 	TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
928 
929 	TP_ARGS(inode, offset, len, rw),
930 
931 	TP_STRUCT__entry(
932 		__field(dev_t,	dev)
933 		__field(ino_t,	ino)
934 		__field(loff_t,	pos)
935 		__field(unsigned long,	len)
936 		__field(int,	rw)
937 	),
938 
939 	TP_fast_assign(
940 		__entry->dev	= inode->i_sb->s_dev;
941 		__entry->ino	= inode->i_ino;
942 		__entry->pos	= offset;
943 		__entry->len	= len;
944 		__entry->rw	= rw;
945 	),
946 
947 	TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
948 		show_dev_ino(__entry),
949 		__entry->pos,
950 		__entry->len,
951 		__entry->rw)
952 );
953 
954 TRACE_EVENT(f2fs_direct_IO_exit,
955 
956 	TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
957 		 int rw, int ret),
958 
959 	TP_ARGS(inode, offset, len, rw, ret),
960 
961 	TP_STRUCT__entry(
962 		__field(dev_t,	dev)
963 		__field(ino_t,	ino)
964 		__field(loff_t,	pos)
965 		__field(unsigned long,	len)
966 		__field(int,	rw)
967 		__field(int,	ret)
968 	),
969 
970 	TP_fast_assign(
971 		__entry->dev	= inode->i_sb->s_dev;
972 		__entry->ino	= inode->i_ino;
973 		__entry->pos	= offset;
974 		__entry->len	= len;
975 		__entry->rw	= rw;
976 		__entry->ret	= ret;
977 	),
978 
979 	TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
980 		"rw = %d ret = %d",
981 		show_dev_ino(__entry),
982 		__entry->pos,
983 		__entry->len,
984 		__entry->rw,
985 		__entry->ret)
986 );
987 
988 TRACE_EVENT(f2fs_reserve_new_blocks,
989 
990 	TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
991 							blkcnt_t count),
992 
993 	TP_ARGS(inode, nid, ofs_in_node, count),
994 
995 	TP_STRUCT__entry(
996 		__field(dev_t,	dev)
997 		__field(nid_t, nid)
998 		__field(unsigned int, ofs_in_node)
999 		__field(blkcnt_t, count)
1000 	),
1001 
1002 	TP_fast_assign(
1003 		__entry->dev	= inode->i_sb->s_dev;
1004 		__entry->nid	= nid;
1005 		__entry->ofs_in_node = ofs_in_node;
1006 		__entry->count = count;
1007 	),
1008 
1009 	TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
1010 		show_dev(__entry->dev),
1011 		(unsigned int)__entry->nid,
1012 		__entry->ofs_in_node,
1013 		(unsigned long long)__entry->count)
1014 );
1015 
1016 DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
1017 
1018 	TP_PROTO(struct page *page, struct f2fs_io_info *fio),
1019 
1020 	TP_ARGS(page, fio),
1021 
1022 	TP_STRUCT__entry(
1023 		__field(dev_t, dev)
1024 		__field(ino_t, ino)
1025 		__field(pgoff_t, index)
1026 		__field(block_t, old_blkaddr)
1027 		__field(block_t, new_blkaddr)
1028 		__field(int, op)
1029 		__field(int, op_flags)
1030 		__field(int, temp)
1031 		__field(int, type)
1032 	),
1033 
1034 	TP_fast_assign(
1035 		__entry->dev		= page_file_mapping(page)->host->i_sb->s_dev;
1036 		__entry->ino		= page_file_mapping(page)->host->i_ino;
1037 		__entry->index		= page->index;
1038 		__entry->old_blkaddr	= fio->old_blkaddr;
1039 		__entry->new_blkaddr	= fio->new_blkaddr;
1040 		__entry->op		= fio->op;
1041 		__entry->op_flags	= fio->op_flags;
1042 		__entry->temp		= fio->temp;
1043 		__entry->type		= fio->type;
1044 	),
1045 
1046 	TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
1047 		"oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
1048 		show_dev_ino(__entry),
1049 		(unsigned long)__entry->index,
1050 		(unsigned long long)__entry->old_blkaddr,
1051 		(unsigned long long)__entry->new_blkaddr,
1052 		show_bio_type(__entry->op, __entry->op_flags),
1053 		show_block_temp(__entry->temp),
1054 		show_block_type(__entry->type))
1055 );
1056 
1057 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1058 
1059 	TP_PROTO(struct page *page, struct f2fs_io_info *fio),
1060 
1061 	TP_ARGS(page, fio),
1062 
1063 	TP_CONDITION(page->mapping)
1064 );
1065 
1066 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
1067 
1068 	TP_PROTO(struct page *page, struct f2fs_io_info *fio),
1069 
1070 	TP_ARGS(page, fio),
1071 
1072 	TP_CONDITION(page->mapping)
1073 );
1074 
1075 DECLARE_EVENT_CLASS(f2fs__bio,
1076 
1077 	TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1078 
1079 	TP_ARGS(sb, type, bio),
1080 
1081 	TP_STRUCT__entry(
1082 		__field(dev_t,	dev)
1083 		__field(dev_t,	target)
1084 		__field(int,	op)
1085 		__field(int,	op_flags)
1086 		__field(int,	type)
1087 		__field(sector_t,	sector)
1088 		__field(unsigned int,	size)
1089 	),
1090 
1091 	TP_fast_assign(
1092 		__entry->dev		= sb->s_dev;
1093 		__entry->target		= bio_dev(bio);
1094 		__entry->op		= bio_op(bio);
1095 		__entry->op_flags	= bio->bi_opf;
1096 		__entry->type		= type;
1097 		__entry->sector		= bio->bi_iter.bi_sector;
1098 		__entry->size		= bio->bi_iter.bi_size;
1099 	),
1100 
1101 	TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
1102 		show_dev(__entry->target),
1103 		show_dev(__entry->dev),
1104 		show_bio_type(__entry->op, __entry->op_flags),
1105 		show_block_type(__entry->type),
1106 		(unsigned long long)__entry->sector,
1107 		__entry->size)
1108 );
1109 
1110 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
1111 
1112 	TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1113 
1114 	TP_ARGS(sb, type, bio),
1115 
1116 	TP_CONDITION(bio)
1117 );
1118 
1119 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
1120 
1121 	TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1122 
1123 	TP_ARGS(sb, type, bio),
1124 
1125 	TP_CONDITION(bio)
1126 );
1127 
1128 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
1129 
1130 	TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1131 
1132 	TP_ARGS(sb, type, bio),
1133 
1134 	TP_CONDITION(bio)
1135 );
1136 
1137 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
1138 
1139 	TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1140 
1141 	TP_ARGS(sb, type, bio),
1142 
1143 	TP_CONDITION(bio)
1144 );
1145 
1146 TRACE_EVENT(f2fs_write_begin,
1147 
1148 	TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1149 				unsigned int flags),
1150 
1151 	TP_ARGS(inode, pos, len, flags),
1152 
1153 	TP_STRUCT__entry(
1154 		__field(dev_t,	dev)
1155 		__field(ino_t,	ino)
1156 		__field(loff_t,	pos)
1157 		__field(unsigned int, len)
1158 		__field(unsigned int, flags)
1159 	),
1160 
1161 	TP_fast_assign(
1162 		__entry->dev	= inode->i_sb->s_dev;
1163 		__entry->ino	= inode->i_ino;
1164 		__entry->pos	= pos;
1165 		__entry->len	= len;
1166 		__entry->flags	= flags;
1167 	),
1168 
1169 	TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1170 		show_dev_ino(__entry),
1171 		(unsigned long long)__entry->pos,
1172 		__entry->len,
1173 		__entry->flags)
1174 );
1175 
1176 TRACE_EVENT(f2fs_write_end,
1177 
1178 	TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1179 				unsigned int copied),
1180 
1181 	TP_ARGS(inode, pos, len, copied),
1182 
1183 	TP_STRUCT__entry(
1184 		__field(dev_t,	dev)
1185 		__field(ino_t,	ino)
1186 		__field(loff_t,	pos)
1187 		__field(unsigned int, len)
1188 		__field(unsigned int, copied)
1189 	),
1190 
1191 	TP_fast_assign(
1192 		__entry->dev	= inode->i_sb->s_dev;
1193 		__entry->ino	= inode->i_ino;
1194 		__entry->pos	= pos;
1195 		__entry->len	= len;
1196 		__entry->copied	= copied;
1197 	),
1198 
1199 	TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1200 		show_dev_ino(__entry),
1201 		(unsigned long long)__entry->pos,
1202 		__entry->len,
1203 		__entry->copied)
1204 );
1205 
1206 DECLARE_EVENT_CLASS(f2fs__page,
1207 
1208 	TP_PROTO(struct page *page, int type),
1209 
1210 	TP_ARGS(page, type),
1211 
1212 	TP_STRUCT__entry(
1213 		__field(dev_t,	dev)
1214 		__field(ino_t,	ino)
1215 		__field(int, type)
1216 		__field(int, dir)
1217 		__field(pgoff_t, index)
1218 		__field(int, dirty)
1219 		__field(int, uptodate)
1220 	),
1221 
1222 	TP_fast_assign(
1223 		__entry->dev	= page_file_mapping(page)->host->i_sb->s_dev;
1224 		__entry->ino	= page_file_mapping(page)->host->i_ino;
1225 		__entry->type	= type;
1226 		__entry->dir	=
1227 			S_ISDIR(page_file_mapping(page)->host->i_mode);
1228 		__entry->index	= page->index;
1229 		__entry->dirty	= PageDirty(page);
1230 		__entry->uptodate = PageUptodate(page);
1231 	),
1232 
1233 	TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1234 		"dirty = %d, uptodate = %d",
1235 		show_dev_ino(__entry),
1236 		show_block_type(__entry->type),
1237 		show_file_type(__entry->dir),
1238 		(unsigned long)__entry->index,
1239 		__entry->dirty,
1240 		__entry->uptodate)
1241 );
1242 
1243 DEFINE_EVENT(f2fs__page, f2fs_writepage,
1244 
1245 	TP_PROTO(struct page *page, int type),
1246 
1247 	TP_ARGS(page, type)
1248 );
1249 
1250 DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1251 
1252 	TP_PROTO(struct page *page, int type),
1253 
1254 	TP_ARGS(page, type)
1255 );
1256 
1257 DEFINE_EVENT(f2fs__page, f2fs_readpage,
1258 
1259 	TP_PROTO(struct page *page, int type),
1260 
1261 	TP_ARGS(page, type)
1262 );
1263 
1264 DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1265 
1266 	TP_PROTO(struct page *page, int type),
1267 
1268 	TP_ARGS(page, type)
1269 );
1270 
1271 DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1272 
1273 	TP_PROTO(struct page *page, int type),
1274 
1275 	TP_ARGS(page, type)
1276 );
1277 
1278 DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1279 
1280 	TP_PROTO(struct page *page, int type),
1281 
1282 	TP_ARGS(page, type)
1283 );
1284 
1285 DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1286 
1287 	TP_PROTO(struct page *page, int type),
1288 
1289 	TP_ARGS(page, type)
1290 );
1291 
1292 TRACE_EVENT(f2fs_filemap_fault,
1293 
1294 	TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret),
1295 
1296 	TP_ARGS(inode, index, ret),
1297 
1298 	TP_STRUCT__entry(
1299 		__field(dev_t,	dev)
1300 		__field(ino_t,	ino)
1301 		__field(pgoff_t, index)
1302 		__field(unsigned long, ret)
1303 	),
1304 
1305 	TP_fast_assign(
1306 		__entry->dev	= inode->i_sb->s_dev;
1307 		__entry->ino	= inode->i_ino;
1308 		__entry->index	= index;
1309 		__entry->ret	= ret;
1310 	),
1311 
1312 	TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx",
1313 		show_dev_ino(__entry),
1314 		(unsigned long)__entry->index,
1315 		__entry->ret)
1316 );
1317 
1318 TRACE_EVENT(f2fs_writepages,
1319 
1320 	TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1321 
1322 	TP_ARGS(inode, wbc, type),
1323 
1324 	TP_STRUCT__entry(
1325 		__field(dev_t,	dev)
1326 		__field(ino_t,	ino)
1327 		__field(int,	type)
1328 		__field(int,	dir)
1329 		__field(long,	nr_to_write)
1330 		__field(long,	pages_skipped)
1331 		__field(loff_t,	range_start)
1332 		__field(loff_t,	range_end)
1333 		__field(pgoff_t, writeback_index)
1334 		__field(int,	sync_mode)
1335 		__field(char,	for_kupdate)
1336 		__field(char,	for_background)
1337 		__field(char,	tagged_writepages)
1338 		__field(char,	for_reclaim)
1339 		__field(char,	range_cyclic)
1340 		__field(char,	for_sync)
1341 	),
1342 
1343 	TP_fast_assign(
1344 		__entry->dev		= inode->i_sb->s_dev;
1345 		__entry->ino		= inode->i_ino;
1346 		__entry->type		= type;
1347 		__entry->dir		= S_ISDIR(inode->i_mode);
1348 		__entry->nr_to_write	= wbc->nr_to_write;
1349 		__entry->pages_skipped	= wbc->pages_skipped;
1350 		__entry->range_start	= wbc->range_start;
1351 		__entry->range_end	= wbc->range_end;
1352 		__entry->writeback_index = inode->i_mapping->writeback_index;
1353 		__entry->sync_mode	= wbc->sync_mode;
1354 		__entry->for_kupdate	= wbc->for_kupdate;
1355 		__entry->for_background	= wbc->for_background;
1356 		__entry->tagged_writepages	= wbc->tagged_writepages;
1357 		__entry->for_reclaim	= wbc->for_reclaim;
1358 		__entry->range_cyclic	= wbc->range_cyclic;
1359 		__entry->for_sync	= wbc->for_sync;
1360 	),
1361 
1362 	TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1363 		"skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1364 		"kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1365 		show_dev_ino(__entry),
1366 		show_block_type(__entry->type),
1367 		show_file_type(__entry->dir),
1368 		__entry->nr_to_write,
1369 		__entry->pages_skipped,
1370 		__entry->range_start,
1371 		__entry->range_end,
1372 		(unsigned long)__entry->writeback_index,
1373 		__entry->sync_mode,
1374 		__entry->for_kupdate,
1375 		__entry->for_background,
1376 		__entry->tagged_writepages,
1377 		__entry->for_reclaim,
1378 		__entry->range_cyclic,
1379 		__entry->for_sync)
1380 );
1381 
1382 TRACE_EVENT(f2fs_readpages,
1383 
1384 	TP_PROTO(struct inode *inode, pgoff_t start, unsigned int nrpage),
1385 
1386 	TP_ARGS(inode, start, nrpage),
1387 
1388 	TP_STRUCT__entry(
1389 		__field(dev_t,	dev)
1390 		__field(ino_t,	ino)
1391 		__field(pgoff_t,	start)
1392 		__field(unsigned int,	nrpage)
1393 	),
1394 
1395 	TP_fast_assign(
1396 		__entry->dev	= inode->i_sb->s_dev;
1397 		__entry->ino	= inode->i_ino;
1398 		__entry->start	= start;
1399 		__entry->nrpage	= nrpage;
1400 	),
1401 
1402 	TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1403 		show_dev_ino(__entry),
1404 		(unsigned long)__entry->start,
1405 		__entry->nrpage)
1406 );
1407 
1408 TRACE_EVENT(f2fs_write_checkpoint,
1409 
1410 	TP_PROTO(struct super_block *sb, int reason, char *msg),
1411 
1412 	TP_ARGS(sb, reason, msg),
1413 
1414 	TP_STRUCT__entry(
1415 		__field(dev_t,	dev)
1416 		__field(int,	reason)
1417 		__field(char *,	msg)
1418 	),
1419 
1420 	TP_fast_assign(
1421 		__entry->dev		= sb->s_dev;
1422 		__entry->reason		= reason;
1423 		__entry->msg		= msg;
1424 	),
1425 
1426 	TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1427 		show_dev(__entry->dev),
1428 		show_cpreason(__entry->reason),
1429 		__entry->msg)
1430 );
1431 
1432 DECLARE_EVENT_CLASS(f2fs_discard,
1433 
1434 	TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1435 
1436 	TP_ARGS(dev, blkstart, blklen),
1437 
1438 	TP_STRUCT__entry(
1439 		__field(dev_t,	dev)
1440 		__field(block_t, blkstart)
1441 		__field(block_t, blklen)
1442 	),
1443 
1444 	TP_fast_assign(
1445 		__entry->dev	= dev->bd_dev;
1446 		__entry->blkstart = blkstart;
1447 		__entry->blklen = blklen;
1448 	),
1449 
1450 	TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1451 		show_dev(__entry->dev),
1452 		(unsigned long long)__entry->blkstart,
1453 		(unsigned long long)__entry->blklen)
1454 );
1455 
1456 DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1457 
1458 	TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1459 
1460 	TP_ARGS(dev, blkstart, blklen)
1461 );
1462 
1463 DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1464 
1465 	TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1466 
1467 	TP_ARGS(dev, blkstart, blklen)
1468 );
1469 
1470 DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
1471 
1472 	TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1473 
1474 	TP_ARGS(dev, blkstart, blklen)
1475 );
1476 
1477 TRACE_EVENT(f2fs_issue_reset_zone,
1478 
1479 	TP_PROTO(struct block_device *dev, block_t blkstart),
1480 
1481 	TP_ARGS(dev, blkstart),
1482 
1483 	TP_STRUCT__entry(
1484 		__field(dev_t,	dev)
1485 		__field(block_t, blkstart)
1486 	),
1487 
1488 	TP_fast_assign(
1489 		__entry->dev	= dev->bd_dev;
1490 		__entry->blkstart = blkstart;
1491 	),
1492 
1493 	TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
1494 		show_dev(__entry->dev),
1495 		(unsigned long long)__entry->blkstart)
1496 );
1497 
1498 TRACE_EVENT(f2fs_issue_flush,
1499 
1500 	TP_PROTO(struct block_device *dev, unsigned int nobarrier,
1501 				unsigned int flush_merge, int ret),
1502 
1503 	TP_ARGS(dev, nobarrier, flush_merge, ret),
1504 
1505 	TP_STRUCT__entry(
1506 		__field(dev_t,	dev)
1507 		__field(unsigned int, nobarrier)
1508 		__field(unsigned int, flush_merge)
1509 		__field(int,  ret)
1510 	),
1511 
1512 	TP_fast_assign(
1513 		__entry->dev	= dev->bd_dev;
1514 		__entry->nobarrier = nobarrier;
1515 		__entry->flush_merge = flush_merge;
1516 		__entry->ret = ret;
1517 	),
1518 
1519 	TP_printk("dev = (%d,%d), %s %s, ret = %d",
1520 		show_dev(__entry->dev),
1521 		__entry->nobarrier ? "skip (nobarrier)" : "issue",
1522 		__entry->flush_merge ? " with flush_merge" : "",
1523 		__entry->ret)
1524 );
1525 
1526 TRACE_EVENT(f2fs_lookup_extent_tree_start,
1527 
1528 	TP_PROTO(struct inode *inode, unsigned int pgofs),
1529 
1530 	TP_ARGS(inode, pgofs),
1531 
1532 	TP_STRUCT__entry(
1533 		__field(dev_t,	dev)
1534 		__field(ino_t,	ino)
1535 		__field(unsigned int, pgofs)
1536 	),
1537 
1538 	TP_fast_assign(
1539 		__entry->dev = inode->i_sb->s_dev;
1540 		__entry->ino = inode->i_ino;
1541 		__entry->pgofs = pgofs;
1542 	),
1543 
1544 	TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1545 		show_dev_ino(__entry),
1546 		__entry->pgofs)
1547 );
1548 
1549 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1550 
1551 	TP_PROTO(struct inode *inode, unsigned int pgofs,
1552 						struct extent_info *ei),
1553 
1554 	TP_ARGS(inode, pgofs, ei),
1555 
1556 	TP_CONDITION(ei),
1557 
1558 	TP_STRUCT__entry(
1559 		__field(dev_t,	dev)
1560 		__field(ino_t,	ino)
1561 		__field(unsigned int, pgofs)
1562 		__field(unsigned int, fofs)
1563 		__field(u32, blk)
1564 		__field(unsigned int, len)
1565 	),
1566 
1567 	TP_fast_assign(
1568 		__entry->dev = inode->i_sb->s_dev;
1569 		__entry->ino = inode->i_ino;
1570 		__entry->pgofs = pgofs;
1571 		__entry->fofs = ei->fofs;
1572 		__entry->blk = ei->blk;
1573 		__entry->len = ei->len;
1574 	),
1575 
1576 	TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1577 		"ext_info(fofs: %u, blk: %u, len: %u)",
1578 		show_dev_ino(__entry),
1579 		__entry->pgofs,
1580 		__entry->fofs,
1581 		__entry->blk,
1582 		__entry->len)
1583 );
1584 
1585 TRACE_EVENT(f2fs_update_extent_tree_range,
1586 
1587 	TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1588 						unsigned int len),
1589 
1590 	TP_ARGS(inode, pgofs, blkaddr, len),
1591 
1592 	TP_STRUCT__entry(
1593 		__field(dev_t,	dev)
1594 		__field(ino_t,	ino)
1595 		__field(unsigned int, pgofs)
1596 		__field(u32, blk)
1597 		__field(unsigned int, len)
1598 	),
1599 
1600 	TP_fast_assign(
1601 		__entry->dev = inode->i_sb->s_dev;
1602 		__entry->ino = inode->i_ino;
1603 		__entry->pgofs = pgofs;
1604 		__entry->blk = blkaddr;
1605 		__entry->len = len;
1606 	),
1607 
1608 	TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1609 					"blkaddr = %u, len = %u",
1610 		show_dev_ino(__entry),
1611 		__entry->pgofs,
1612 		__entry->blk,
1613 		__entry->len)
1614 );
1615 
1616 TRACE_EVENT(f2fs_shrink_extent_tree,
1617 
1618 	TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1619 						unsigned int tree_cnt),
1620 
1621 	TP_ARGS(sbi, node_cnt, tree_cnt),
1622 
1623 	TP_STRUCT__entry(
1624 		__field(dev_t,	dev)
1625 		__field(unsigned int, node_cnt)
1626 		__field(unsigned int, tree_cnt)
1627 	),
1628 
1629 	TP_fast_assign(
1630 		__entry->dev = sbi->sb->s_dev;
1631 		__entry->node_cnt = node_cnt;
1632 		__entry->tree_cnt = tree_cnt;
1633 	),
1634 
1635 	TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1636 		show_dev(__entry->dev),
1637 		__entry->node_cnt,
1638 		__entry->tree_cnt)
1639 );
1640 
1641 TRACE_EVENT(f2fs_destroy_extent_tree,
1642 
1643 	TP_PROTO(struct inode *inode, unsigned int node_cnt),
1644 
1645 	TP_ARGS(inode, node_cnt),
1646 
1647 	TP_STRUCT__entry(
1648 		__field(dev_t,	dev)
1649 		__field(ino_t,	ino)
1650 		__field(unsigned int, node_cnt)
1651 	),
1652 
1653 	TP_fast_assign(
1654 		__entry->dev = inode->i_sb->s_dev;
1655 		__entry->ino = inode->i_ino;
1656 		__entry->node_cnt = node_cnt;
1657 	),
1658 
1659 	TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1660 		show_dev_ino(__entry),
1661 		__entry->node_cnt)
1662 );
1663 
1664 DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1665 
1666 	TP_PROTO(struct super_block *sb, int type, s64 count),
1667 
1668 	TP_ARGS(sb, type, count),
1669 
1670 	TP_STRUCT__entry(
1671 		__field(dev_t, dev)
1672 		__field(int, type)
1673 		__field(s64, count)
1674 	),
1675 
1676 	TP_fast_assign(
1677 		__entry->dev	= sb->s_dev;
1678 		__entry->type	= type;
1679 		__entry->count	= count;
1680 	),
1681 
1682 	TP_printk("dev = (%d,%d), %s, dirty count = %lld",
1683 		show_dev(__entry->dev),
1684 		show_file_type(__entry->type),
1685 		__entry->count)
1686 );
1687 
1688 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1689 
1690 	TP_PROTO(struct super_block *sb, int type, s64 count),
1691 
1692 	TP_ARGS(sb, type, count)
1693 );
1694 
1695 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1696 
1697 	TP_PROTO(struct super_block *sb, int type, s64 count),
1698 
1699 	TP_ARGS(sb, type, count)
1700 );
1701 
1702 TRACE_EVENT(f2fs_shutdown,
1703 
1704 	TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret),
1705 
1706 	TP_ARGS(sbi, mode, ret),
1707 
1708 	TP_STRUCT__entry(
1709 		__field(dev_t,	dev)
1710 		__field(unsigned int, mode)
1711 		__field(int, ret)
1712 	),
1713 
1714 	TP_fast_assign(
1715 		__entry->dev = sbi->sb->s_dev;
1716 		__entry->mode = mode;
1717 		__entry->ret = ret;
1718 	),
1719 
1720 	TP_printk("dev = (%d,%d), mode: %s, ret:%d",
1721 		show_dev(__entry->dev),
1722 		show_shutdown_mode(__entry->mode),
1723 		__entry->ret)
1724 );
1725 
1726 DECLARE_EVENT_CLASS(f2fs_zip_start,
1727 
1728 	TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1729 			unsigned int cluster_size, unsigned char algtype),
1730 
1731 	TP_ARGS(inode, cluster_idx, cluster_size, algtype),
1732 
1733 	TP_STRUCT__entry(
1734 		__field(dev_t,	dev)
1735 		__field(ino_t,	ino)
1736 		__field(pgoff_t, idx)
1737 		__field(unsigned int, size)
1738 		__field(unsigned int, algtype)
1739 	),
1740 
1741 	TP_fast_assign(
1742 		__entry->dev = inode->i_sb->s_dev;
1743 		__entry->ino = inode->i_ino;
1744 		__entry->idx = cluster_idx;
1745 		__entry->size = cluster_size;
1746 		__entry->algtype = algtype;
1747 	),
1748 
1749 	TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1750 		"cluster_size = %u, algorithm = %s",
1751 		show_dev_ino(__entry),
1752 		__entry->idx,
1753 		__entry->size,
1754 		show_compress_algorithm(__entry->algtype))
1755 );
1756 
1757 DECLARE_EVENT_CLASS(f2fs_zip_end,
1758 
1759 	TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1760 			unsigned int compressed_size, int ret),
1761 
1762 	TP_ARGS(inode, cluster_idx, compressed_size, ret),
1763 
1764 	TP_STRUCT__entry(
1765 		__field(dev_t,	dev)
1766 		__field(ino_t,	ino)
1767 		__field(pgoff_t, idx)
1768 		__field(unsigned int, size)
1769 		__field(unsigned int, ret)
1770 	),
1771 
1772 	TP_fast_assign(
1773 		__entry->dev = inode->i_sb->s_dev;
1774 		__entry->ino = inode->i_ino;
1775 		__entry->idx = cluster_idx;
1776 		__entry->size = compressed_size;
1777 		__entry->ret = ret;
1778 	),
1779 
1780 	TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1781 		"compressed_size = %u, ret = %d",
1782 		show_dev_ino(__entry),
1783 		__entry->idx,
1784 		__entry->size,
1785 		__entry->ret)
1786 );
1787 
1788 DEFINE_EVENT(f2fs_zip_start, f2fs_compress_pages_start,
1789 
1790 	TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1791 		unsigned int cluster_size, unsigned char algtype),
1792 
1793 	TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1794 );
1795 
1796 DEFINE_EVENT(f2fs_zip_start, f2fs_decompress_pages_start,
1797 
1798 	TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1799 		unsigned int cluster_size, unsigned char algtype),
1800 
1801 	TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1802 );
1803 
1804 DEFINE_EVENT(f2fs_zip_end, f2fs_compress_pages_end,
1805 
1806 	TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1807 			unsigned int compressed_size, int ret),
1808 
1809 	TP_ARGS(inode, cluster_idx, compressed_size, ret)
1810 );
1811 
1812 DEFINE_EVENT(f2fs_zip_end, f2fs_decompress_pages_end,
1813 
1814 	TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1815 			unsigned int compressed_size, int ret),
1816 
1817 	TP_ARGS(inode, cluster_idx, compressed_size, ret)
1818 );
1819 
1820 TRACE_EVENT(f2fs_iostat,
1821 
1822 	TP_PROTO(struct f2fs_sb_info *sbi, unsigned long long *iostat),
1823 
1824 	TP_ARGS(sbi, iostat),
1825 
1826 	TP_STRUCT__entry(
1827 		__field(dev_t,	dev)
1828 		__field(unsigned long long,	app_dio)
1829 		__field(unsigned long long,	app_bio)
1830 		__field(unsigned long long,	app_wio)
1831 		__field(unsigned long long,	app_mio)
1832 		__field(unsigned long long,	fs_dio)
1833 		__field(unsigned long long,	fs_nio)
1834 		__field(unsigned long long,	fs_mio)
1835 		__field(unsigned long long,	fs_gc_dio)
1836 		__field(unsigned long long,	fs_gc_nio)
1837 		__field(unsigned long long,	fs_cp_dio)
1838 		__field(unsigned long long,	fs_cp_nio)
1839 		__field(unsigned long long,	fs_cp_mio)
1840 		__field(unsigned long long,	app_drio)
1841 		__field(unsigned long long,	app_brio)
1842 		__field(unsigned long long,	app_rio)
1843 		__field(unsigned long long,	app_mrio)
1844 		__field(unsigned long long,	fs_drio)
1845 		__field(unsigned long long,	fs_gdrio)
1846 		__field(unsigned long long,	fs_cdrio)
1847 		__field(unsigned long long,	fs_nrio)
1848 		__field(unsigned long long,	fs_mrio)
1849 		__field(unsigned long long,	fs_discard)
1850 	),
1851 
1852 	TP_fast_assign(
1853 		__entry->dev		= sbi->sb->s_dev;
1854 		__entry->app_dio	= iostat[APP_DIRECT_IO];
1855 		__entry->app_bio	= iostat[APP_BUFFERED_IO];
1856 		__entry->app_wio	= iostat[APP_WRITE_IO];
1857 		__entry->app_mio	= iostat[APP_MAPPED_IO];
1858 		__entry->fs_dio		= iostat[FS_DATA_IO];
1859 		__entry->fs_nio		= iostat[FS_NODE_IO];
1860 		__entry->fs_mio		= iostat[FS_META_IO];
1861 		__entry->fs_gc_dio	= iostat[FS_GC_DATA_IO];
1862 		__entry->fs_gc_nio	= iostat[FS_GC_NODE_IO];
1863 		__entry->fs_cp_dio	= iostat[FS_CP_DATA_IO];
1864 		__entry->fs_cp_nio	= iostat[FS_CP_NODE_IO];
1865 		__entry->fs_cp_mio	= iostat[FS_CP_META_IO];
1866 		__entry->app_drio	= iostat[APP_DIRECT_READ_IO];
1867 		__entry->app_brio	= iostat[APP_BUFFERED_READ_IO];
1868 		__entry->app_rio	= iostat[APP_READ_IO];
1869 		__entry->app_mrio	= iostat[APP_MAPPED_READ_IO];
1870 		__entry->fs_drio	= iostat[FS_DATA_READ_IO];
1871 		__entry->fs_gdrio	= iostat[FS_GDATA_READ_IO];
1872 		__entry->fs_cdrio	= iostat[FS_CDATA_READ_IO];
1873 		__entry->fs_nrio	= iostat[FS_NODE_READ_IO];
1874 		__entry->fs_mrio	= iostat[FS_META_READ_IO];
1875 		__entry->fs_discard	= iostat[FS_DISCARD];
1876 	),
1877 
1878 	TP_printk("dev = (%d,%d), "
1879 		"app [write=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
1880 		"fs [data=%llu, node=%llu, meta=%llu, discard=%llu], "
1881 		"gc [data=%llu, node=%llu], "
1882 		"cp [data=%llu, node=%llu, meta=%llu], "
1883 		"app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
1884 		"fs [data=%llu, (gc_data=%llu, compr_data=%llu), "
1885 		"node=%llu, meta=%llu]",
1886 		show_dev(__entry->dev), __entry->app_wio, __entry->app_dio,
1887 		__entry->app_bio, __entry->app_mio, __entry->fs_dio,
1888 		__entry->fs_nio, __entry->fs_mio, __entry->fs_discard,
1889 		__entry->fs_gc_dio, __entry->fs_gc_nio, __entry->fs_cp_dio,
1890 		__entry->fs_cp_nio, __entry->fs_cp_mio,
1891 		__entry->app_rio, __entry->app_drio, __entry->app_brio,
1892 		__entry->app_mrio, __entry->fs_drio, __entry->fs_gdrio,
1893 		__entry->fs_cdrio, __entry->fs_nrio, __entry->fs_mrio)
1894 );
1895 
1896 TRACE_EVENT(f2fs_bmap,
1897 
1898 	TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock),
1899 
1900 	TP_ARGS(inode, lblock, pblock),
1901 
1902 	TP_STRUCT__entry(
1903 		__field(dev_t, dev)
1904 		__field(ino_t, ino)
1905 		__field(sector_t, lblock)
1906 		__field(sector_t, pblock)
1907 	),
1908 
1909 	TP_fast_assign(
1910 		__entry->dev		= inode->i_sb->s_dev;
1911 		__entry->ino		= inode->i_ino;
1912 		__entry->lblock		= lblock;
1913 		__entry->pblock		= pblock;
1914 	),
1915 
1916 	TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld",
1917 		show_dev_ino(__entry),
1918 		(unsigned long long)__entry->lblock,
1919 		(unsigned long long)__entry->pblock)
1920 );
1921 
1922 TRACE_EVENT(f2fs_fiemap,
1923 
1924 	TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock,
1925 		unsigned long long len, unsigned int flags, int ret),
1926 
1927 	TP_ARGS(inode, lblock, pblock, len, flags, ret),
1928 
1929 	TP_STRUCT__entry(
1930 		__field(dev_t, dev)
1931 		__field(ino_t, ino)
1932 		__field(sector_t, lblock)
1933 		__field(sector_t, pblock)
1934 		__field(unsigned long long, len)
1935 		__field(unsigned int, flags)
1936 		__field(int, ret)
1937 	),
1938 
1939 	TP_fast_assign(
1940 		__entry->dev		= inode->i_sb->s_dev;
1941 		__entry->ino		= inode->i_ino;
1942 		__entry->lblock		= lblock;
1943 		__entry->pblock		= pblock;
1944 		__entry->len		= len;
1945 		__entry->flags		= flags;
1946 		__entry->ret		= ret;
1947 	),
1948 
1949 	TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, "
1950 		"len:%llu, flags:%u, ret:%d",
1951 		show_dev_ino(__entry),
1952 		(unsigned long long)__entry->lblock,
1953 		(unsigned long long)__entry->pblock,
1954 		__entry->len,
1955 		__entry->flags,
1956 		__entry->ret)
1957 );
1958 
1959 #endif /* _TRACE_F2FS_H */
1960 
1961  /* This part must be outside protection */
1962 #include <trace/define_trace.h>
1963