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