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