1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM f2fs
5 #if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/tracepoint.h>
9 #include <uapi/linux/f2fs.h>
11 #define show_dev(dev) MAJOR(dev), MINOR(dev)
12 #define show_dev_ino(entry) show_dev(entry->dev), (unsigned long)entry->ino
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);
56 #define show_block_type(type) \
57 __print_symbolic(type, \
61 { META_FLUSH, "META_FLUSH" }, \
63 { INMEM_DROP, "INMEM_DROP" }, \
64 { INMEM_INVALIDATE, "INMEM_INVALIDATE" }, \
65 { INMEM_REVOKE, "INMEM_REVOKE" }, \
66 { IPU, "IN-PLACE" }, \
67 { OPU, "OUT-OF-PLACE" })
69 #define show_block_temp(temp) \
70 __print_symbolic(temp, \
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)
79 #define show_bio_type(op,op_flags) show_bio_op(op), \
80 show_bio_op_flags(op_flags)
82 #define show_bio_op(op) blk_op_str(op)
84 #define show_bio_op_flags(flags) \
85 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
86 { REQ_RAHEAD, "R" }, \
90 { REQ_PREFLUSH, "PF" }, \
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" })
103 #define show_file_type(type) \
104 __print_symbolic(type, \
108 #define show_gc_type(type) \
109 __print_symbolic(type, \
110 { FG_GC, "Foreground GC" }, \
111 { BG_GC, "Background GC" })
113 #define show_alloc_mode(type) \
114 __print_symbolic(type, \
115 { LFS, "LFS-mode" }, \
116 { SSR, "SSR-mode" }, \
117 { AT_SSR, "AT_SSR-mode" })
119 #define show_victim_policy(type) \
120 __print_symbolic(type, \
121 { GC_GREEDY, "Greedy" }, \
122 { GC_CB, "Cost-Benefit" }, \
123 { GC_AT, "Age-threshold" })
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" })
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" })
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" })
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" })
168 struct victim_sel_policy;
169 struct f2fs_map_blocks;
171 DECLARE_EVENT_CLASS(f2fs__inode,
173 TP_PROTO(struct inode *inode),
181 __field(umode_t, mode)
182 __field(loff_t, size)
183 __field(unsigned int, nlink)
184 __field(blkcnt_t, blocks)
185 __field(__u8, advise)
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;
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,
205 (unsigned int)__entry->nlink,
206 (unsigned long long)__entry->blocks,
207 (unsigned char)__entry->advise)
210 DECLARE_EVENT_CLASS(f2fs__inode_exit,
212 TP_PROTO(struct inode *inode, int ret),
223 __entry->dev = inode->i_sb->s_dev;
224 __entry->ino = inode->i_ino;
228 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
229 show_dev_ino(__entry),
233 DEFINE_EVENT(f2fs__inode, f2fs_sync_file_enter,
235 TP_PROTO(struct inode *inode),
240 TRACE_EVENT(f2fs_sync_file_exit,
242 TP_PROTO(struct inode *inode, int cp_reason, int datasync, int ret),
244 TP_ARGS(inode, cp_reason, datasync, ret),
249 __field(int, cp_reason)
250 __field(int, datasync)
255 __entry->dev = inode->i_sb->s_dev;
256 __entry->ino = inode->i_ino;
257 __entry->cp_reason = cp_reason;
258 __entry->datasync = datasync;
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),
270 TRACE_EVENT(f2fs_sync_fs,
272 TP_PROTO(struct super_block *sb, int wait),
283 __entry->dev = sb->s_dev;
284 __entry->dirty = is_sbi_flag_set(F2FS_SB(sb), SBI_IS_DIRTY);
285 __entry->wait = wait;
288 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
289 show_dev(__entry->dev),
290 __entry->dirty ? "dirty" : "not dirty",
294 DEFINE_EVENT(f2fs__inode, f2fs_iget,
296 TP_PROTO(struct inode *inode),
301 DEFINE_EVENT(f2fs__inode_exit, f2fs_iget_exit,
303 TP_PROTO(struct inode *inode, int ret),
308 DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
310 TP_PROTO(struct inode *inode),
315 DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
317 TP_PROTO(struct inode *inode, int ret),
322 TRACE_EVENT(f2fs_unlink_enter,
324 TP_PROTO(struct inode *dir, struct dentry *dentry),
326 TP_ARGS(dir, dentry),
331 __field(loff_t, size)
332 __field(blkcnt_t, blocks)
333 __field(const char *, name)
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;
344 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
345 "i_blocks = %llu, name = %s",
346 show_dev_ino(__entry),
348 (unsigned long long)__entry->blocks,
352 DEFINE_EVENT(f2fs__inode_exit, f2fs_unlink_exit,
354 TP_PROTO(struct inode *inode, int ret),
359 DEFINE_EVENT(f2fs__inode_exit, f2fs_drop_inode,
361 TP_PROTO(struct inode *inode, int ret),
366 DEFINE_EVENT(f2fs__inode, f2fs_truncate,
368 TP_PROTO(struct inode *inode),
373 TRACE_EVENT(f2fs_truncate_data_blocks_range,
375 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs, int free),
377 TP_ARGS(inode, nid, ofs, free),
383 __field(unsigned int, ofs)
388 __entry->dev = inode->i_sb->s_dev;
389 __entry->ino = inode->i_ino;
392 __entry->free = free;
395 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
396 show_dev_ino(__entry),
397 (unsigned int)__entry->nid,
402 DECLARE_EVENT_CLASS(f2fs__truncate_op,
404 TP_PROTO(struct inode *inode, u64 from),
406 TP_ARGS(inode, from),
411 __field(loff_t, size)
412 __field(blkcnt_t, blocks)
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;
424 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
425 "start file offset = %llu",
426 show_dev_ino(__entry),
428 (unsigned long long)__entry->blocks,
429 (unsigned long long)__entry->from)
432 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_blocks_enter,
434 TP_PROTO(struct inode *inode, u64 from),
439 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_blocks_exit,
441 TP_PROTO(struct inode *inode, int ret),
446 DEFINE_EVENT(f2fs__truncate_op, f2fs_truncate_inode_blocks_enter,
448 TP_PROTO(struct inode *inode, u64 from),
453 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_inode_blocks_exit,
455 TP_PROTO(struct inode *inode, int ret),
460 DECLARE_EVENT_CLASS(f2fs__truncate_node,
462 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
464 TP_ARGS(inode, nid, blk_addr),
470 __field(block_t, blk_addr)
474 __entry->dev = inode->i_sb->s_dev;
475 __entry->ino = inode->i_ino;
477 __entry->blk_addr = blk_addr;
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)
486 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_nodes_enter,
488 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
490 TP_ARGS(inode, nid, blk_addr)
493 DEFINE_EVENT(f2fs__inode_exit, f2fs_truncate_nodes_exit,
495 TP_PROTO(struct inode *inode, int ret),
500 DEFINE_EVENT(f2fs__truncate_node, f2fs_truncate_node,
502 TP_PROTO(struct inode *inode, nid_t nid, block_t blk_addr),
504 TP_ARGS(inode, nid, blk_addr)
507 TRACE_EVENT(f2fs_truncate_partial_nodes,
509 TP_PROTO(struct inode *inode, nid_t *nid, int depth, int err),
511 TP_ARGS(inode, nid, depth, err),
516 __array(nid_t, nid, 3)
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;
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],
541 TRACE_EVENT(f2fs_file_write_iter,
543 TP_PROTO(struct inode *inode, unsigned long offset,
544 unsigned long length, int ret),
546 TP_ARGS(inode, offset, length, ret),
551 __field(unsigned long, offset)
552 __field(unsigned long, length)
557 __entry->dev = inode->i_sb->s_dev;
558 __entry->ino = inode->i_ino;
559 __entry->offset = offset;
560 __entry->length = length;
564 TP_printk("dev = (%d,%d), ino = %lu, "
565 "offset = %lu, length = %lu, written(err) = %d",
566 show_dev_ino(__entry),
572 TRACE_EVENT(f2fs_map_blocks,
573 TP_PROTO(struct inode *inode, struct f2fs_map_blocks *map, int ret),
575 TP_ARGS(inode, map, ret),
580 __field(block_t, m_lblk)
581 __field(block_t, m_pblk)
582 __field(unsigned int, m_len)
583 __field(unsigned int, m_flags)
584 __field(int, m_seg_type)
585 __field(bool, m_may_create)
590 __entry->dev = inode->i_sb->s_dev;
591 __entry->ino = inode->i_ino;
592 __entry->m_lblk = map->m_lblk;
593 __entry->m_pblk = map->m_pblk;
594 __entry->m_len = map->m_len;
595 __entry->m_flags = map->m_flags;
596 __entry->m_seg_type = map->m_seg_type;
597 __entry->m_may_create = map->m_may_create;
601 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
602 "start blkaddr = 0x%llx, len = 0x%llx, flags = %u,"
603 "seg_type = %d, may_create = %d, err = %d",
604 show_dev_ino(__entry),
605 (unsigned long long)__entry->m_lblk,
606 (unsigned long long)__entry->m_pblk,
607 (unsigned long long)__entry->m_len,
610 __entry->m_may_create,
614 TRACE_EVENT(f2fs_background_gc,
616 TP_PROTO(struct super_block *sb, unsigned int wait_ms,
617 unsigned int prefree, unsigned int free),
619 TP_ARGS(sb, wait_ms, prefree, free),
623 __field(unsigned int, wait_ms)
624 __field(unsigned int, prefree)
625 __field(unsigned int, free)
629 __entry->dev = sb->s_dev;
630 __entry->wait_ms = wait_ms;
631 __entry->prefree = prefree;
632 __entry->free = free;
635 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
636 show_dev(__entry->dev),
642 TRACE_EVENT(f2fs_gc_begin,
644 TP_PROTO(struct super_block *sb, bool sync, bool background,
645 long long dirty_nodes, long long dirty_dents,
646 long long dirty_imeta, unsigned int free_sec,
647 unsigned int free_seg, int reserved_seg,
648 unsigned int prefree_seg),
650 TP_ARGS(sb, sync, background, dirty_nodes, dirty_dents, dirty_imeta,
651 free_sec, free_seg, reserved_seg, prefree_seg),
656 __field(bool, background)
657 __field(long long, dirty_nodes)
658 __field(long long, dirty_dents)
659 __field(long long, dirty_imeta)
660 __field(unsigned int, free_sec)
661 __field(unsigned int, free_seg)
662 __field(int, reserved_seg)
663 __field(unsigned int, prefree_seg)
667 __entry->dev = sb->s_dev;
668 __entry->sync = sync;
669 __entry->background = background;
670 __entry->dirty_nodes = dirty_nodes;
671 __entry->dirty_dents = dirty_dents;
672 __entry->dirty_imeta = dirty_imeta;
673 __entry->free_sec = free_sec;
674 __entry->free_seg = free_seg;
675 __entry->reserved_seg = reserved_seg;
676 __entry->prefree_seg = prefree_seg;
679 TP_printk("dev = (%d,%d), sync = %d, background = %d, nodes = %lld, "
680 "dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
681 "rsv_seg:%d, prefree_seg:%u",
682 show_dev(__entry->dev),
685 __entry->dirty_nodes,
686 __entry->dirty_dents,
687 __entry->dirty_imeta,
690 __entry->reserved_seg,
691 __entry->prefree_seg)
694 TRACE_EVENT(f2fs_gc_end,
696 TP_PROTO(struct super_block *sb, int ret, int seg_freed,
697 int sec_freed, long long dirty_nodes,
698 long long dirty_dents, long long dirty_imeta,
699 unsigned int free_sec, unsigned int free_seg,
700 int reserved_seg, unsigned int prefree_seg),
702 TP_ARGS(sb, ret, seg_freed, sec_freed, dirty_nodes, dirty_dents,
703 dirty_imeta, free_sec, free_seg, reserved_seg, prefree_seg),
708 __field(int, seg_freed)
709 __field(int, sec_freed)
710 __field(long long, dirty_nodes)
711 __field(long long, dirty_dents)
712 __field(long long, dirty_imeta)
713 __field(unsigned int, free_sec)
714 __field(unsigned int, free_seg)
715 __field(int, reserved_seg)
716 __field(unsigned int, prefree_seg)
720 __entry->dev = sb->s_dev;
722 __entry->seg_freed = seg_freed;
723 __entry->sec_freed = sec_freed;
724 __entry->dirty_nodes = dirty_nodes;
725 __entry->dirty_dents = dirty_dents;
726 __entry->dirty_imeta = dirty_imeta;
727 __entry->free_sec = free_sec;
728 __entry->free_seg = free_seg;
729 __entry->reserved_seg = reserved_seg;
730 __entry->prefree_seg = prefree_seg;
733 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
734 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
735 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
736 show_dev(__entry->dev),
740 __entry->dirty_nodes,
741 __entry->dirty_dents,
742 __entry->dirty_imeta,
745 __entry->reserved_seg,
746 __entry->prefree_seg)
749 TRACE_EVENT(f2fs_get_victim,
751 TP_PROTO(struct super_block *sb, int type, int gc_type,
752 struct victim_sel_policy *p, unsigned int pre_victim,
753 unsigned int prefree, unsigned int free),
755 TP_ARGS(sb, type, gc_type, p, pre_victim, prefree, free),
760 __field(int, gc_type)
761 __field(int, alloc_mode)
762 __field(int, gc_mode)
763 __field(unsigned int, victim)
764 __field(unsigned int, cost)
765 __field(unsigned int, ofs_unit)
766 __field(unsigned int, pre_victim)
767 __field(unsigned int, prefree)
768 __field(unsigned int, free)
772 __entry->dev = sb->s_dev;
773 __entry->type = type;
774 __entry->gc_type = gc_type;
775 __entry->alloc_mode = p->alloc_mode;
776 __entry->gc_mode = p->gc_mode;
777 __entry->victim = p->min_segno;
778 __entry->cost = p->min_cost;
779 __entry->ofs_unit = p->ofs_unit;
780 __entry->pre_victim = pre_victim;
781 __entry->prefree = prefree;
782 __entry->free = free;
785 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
786 "victim = %u, cost = %u, ofs_unit = %u, "
787 "pre_victim_secno = %d, prefree = %u, free = %u",
788 show_dev(__entry->dev),
789 show_data_type(__entry->type),
790 show_gc_type(__entry->gc_type),
791 show_alloc_mode(__entry->alloc_mode),
792 show_victim_policy(__entry->gc_mode),
796 (int)__entry->pre_victim,
801 TRACE_EVENT(f2fs_lookup_start,
803 TP_PROTO(struct inode *dir, struct dentry *dentry, unsigned int flags),
805 TP_ARGS(dir, dentry, flags),
810 __string(name, dentry->d_name.name)
811 __field(unsigned int, flags)
815 __entry->dev = dir->i_sb->s_dev;
816 __entry->ino = dir->i_ino;
817 __assign_str(name, dentry->d_name.name);
818 __entry->flags = flags;
821 TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
822 show_dev_ino(__entry),
827 TRACE_EVENT(f2fs_lookup_end,
829 TP_PROTO(struct inode *dir, struct dentry *dentry, nid_t ino,
832 TP_ARGS(dir, dentry, ino, err),
837 __string(name, dentry->d_name.name)
843 __entry->dev = dir->i_sb->s_dev;
844 __entry->ino = dir->i_ino;
845 __assign_str(name, dentry->d_name.name);
850 TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
851 show_dev_ino(__entry),
857 TRACE_EVENT(f2fs_readdir,
859 TP_PROTO(struct inode *dir, loff_t start_pos, loff_t end_pos, int err),
861 TP_ARGS(dir, start_pos, end_pos, err),
866 __field(loff_t, start)
872 __entry->dev = dir->i_sb->s_dev;
873 __entry->ino = dir->i_ino;
874 __entry->start = start_pos;
875 __entry->end = end_pos;
879 TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
880 show_dev_ino(__entry),
886 TRACE_EVENT(f2fs_fallocate,
888 TP_PROTO(struct inode *inode, int mode,
889 loff_t offset, loff_t len, int ret),
891 TP_ARGS(inode, mode, offset, len, ret),
897 __field(loff_t, offset)
899 __field(loff_t, size)
900 __field(blkcnt_t, blocks)
905 __entry->dev = inode->i_sb->s_dev;
906 __entry->ino = inode->i_ino;
907 __entry->mode = mode;
908 __entry->offset = offset;
910 __entry->size = inode->i_size;
911 __entry->blocks = inode->i_blocks;
915 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
916 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
917 show_dev_ino(__entry),
919 (unsigned long long)__entry->offset,
920 (unsigned long long)__entry->len,
921 (unsigned long long)__entry->size,
922 (unsigned long long)__entry->blocks,
926 TRACE_EVENT(f2fs_direct_IO_enter,
928 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
930 TP_ARGS(inode, offset, len, rw),
936 __field(unsigned long, len)
941 __entry->dev = inode->i_sb->s_dev;
942 __entry->ino = inode->i_ino;
943 __entry->pos = offset;
948 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
949 show_dev_ino(__entry),
955 TRACE_EVENT(f2fs_direct_IO_exit,
957 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
960 TP_ARGS(inode, offset, len, rw, ret),
966 __field(unsigned long, len)
972 __entry->dev = inode->i_sb->s_dev;
973 __entry->ino = inode->i_ino;
974 __entry->pos = offset;
980 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
982 show_dev_ino(__entry),
989 TRACE_EVENT(f2fs_reserve_new_blocks,
991 TP_PROTO(struct inode *inode, nid_t nid, unsigned int ofs_in_node,
994 TP_ARGS(inode, nid, ofs_in_node, count),
999 __field(unsigned int, ofs_in_node)
1000 __field(blkcnt_t, count)
1004 __entry->dev = inode->i_sb->s_dev;
1006 __entry->ofs_in_node = ofs_in_node;
1007 __entry->count = count;
1010 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
1011 show_dev(__entry->dev),
1012 (unsigned int)__entry->nid,
1013 __entry->ofs_in_node,
1014 (unsigned long long)__entry->count)
1017 DECLARE_EVENT_CLASS(f2fs__submit_page_bio,
1019 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
1026 __field(pgoff_t, index)
1027 __field(block_t, old_blkaddr)
1028 __field(block_t, new_blkaddr)
1030 __field(int, op_flags)
1036 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1037 __entry->ino = page_file_mapping(page)->host->i_ino;
1038 __entry->index = page->index;
1039 __entry->old_blkaddr = fio->old_blkaddr;
1040 __entry->new_blkaddr = fio->new_blkaddr;
1041 __entry->op = fio->op;
1042 __entry->op_flags = fio->op_flags;
1043 __entry->temp = fio->temp;
1044 __entry->type = fio->type;
1047 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
1048 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
1049 show_dev_ino(__entry),
1050 (unsigned long)__entry->index,
1051 (unsigned long long)__entry->old_blkaddr,
1052 (unsigned long long)__entry->new_blkaddr,
1053 show_bio_type(__entry->op, __entry->op_flags),
1054 show_block_temp(__entry->temp),
1055 show_block_type(__entry->type))
1058 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_bio,
1060 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
1064 TP_CONDITION(page->mapping)
1067 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio, f2fs_submit_page_write,
1069 TP_PROTO(struct page *page, struct f2fs_io_info *fio),
1073 TP_CONDITION(page->mapping)
1076 DECLARE_EVENT_CLASS(f2fs__bio,
1078 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1080 TP_ARGS(sb, type, bio),
1084 __field(dev_t, target)
1086 __field(int, op_flags)
1088 __field(sector_t, sector)
1089 __field(unsigned int, size)
1093 __entry->dev = sb->s_dev;
1094 __entry->target = bio_dev(bio);
1095 __entry->op = bio_op(bio);
1096 __entry->op_flags = bio->bi_opf;
1097 __entry->type = type;
1098 __entry->sector = bio->bi_iter.bi_sector;
1099 __entry->size = bio->bi_iter.bi_size;
1102 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
1103 show_dev(__entry->target),
1104 show_dev(__entry->dev),
1105 show_bio_type(__entry->op, __entry->op_flags),
1106 show_block_type(__entry->type),
1107 (unsigned long long)__entry->sector,
1111 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_write_bio,
1113 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1115 TP_ARGS(sb, type, bio),
1120 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_prepare_read_bio,
1122 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1124 TP_ARGS(sb, type, bio),
1129 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_read_bio,
1131 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1133 TP_ARGS(sb, type, bio),
1138 DEFINE_EVENT_CONDITION(f2fs__bio, f2fs_submit_write_bio,
1140 TP_PROTO(struct super_block *sb, int type, struct bio *bio),
1142 TP_ARGS(sb, type, bio),
1147 TRACE_EVENT(f2fs_write_begin,
1149 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1150 unsigned int flags),
1152 TP_ARGS(inode, pos, len, flags),
1157 __field(loff_t, pos)
1158 __field(unsigned int, len)
1159 __field(unsigned int, flags)
1163 __entry->dev = inode->i_sb->s_dev;
1164 __entry->ino = inode->i_ino;
1167 __entry->flags = flags;
1170 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
1171 show_dev_ino(__entry),
1172 (unsigned long long)__entry->pos,
1177 TRACE_EVENT(f2fs_write_end,
1179 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
1180 unsigned int copied),
1182 TP_ARGS(inode, pos, len, copied),
1187 __field(loff_t, pos)
1188 __field(unsigned int, len)
1189 __field(unsigned int, copied)
1193 __entry->dev = inode->i_sb->s_dev;
1194 __entry->ino = inode->i_ino;
1197 __entry->copied = copied;
1200 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1201 show_dev_ino(__entry),
1202 (unsigned long long)__entry->pos,
1207 DECLARE_EVENT_CLASS(f2fs__page,
1209 TP_PROTO(struct page *page, int type),
1211 TP_ARGS(page, type),
1218 __field(pgoff_t, index)
1220 __field(int, uptodate)
1224 __entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1225 __entry->ino = page_file_mapping(page)->host->i_ino;
1226 __entry->type = type;
1228 S_ISDIR(page_file_mapping(page)->host->i_mode);
1229 __entry->index = page->index;
1230 __entry->dirty = PageDirty(page);
1231 __entry->uptodate = PageUptodate(page);
1234 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1235 "dirty = %d, uptodate = %d",
1236 show_dev_ino(__entry),
1237 show_block_type(__entry->type),
1238 show_file_type(__entry->dir),
1239 (unsigned long)__entry->index,
1244 DEFINE_EVENT(f2fs__page, f2fs_writepage,
1246 TP_PROTO(struct page *page, int type),
1251 DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1253 TP_PROTO(struct page *page, int type),
1258 DEFINE_EVENT(f2fs__page, f2fs_readpage,
1260 TP_PROTO(struct page *page, int type),
1265 DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1267 TP_PROTO(struct page *page, int type),
1272 DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
1274 TP_PROTO(struct page *page, int type),
1279 DEFINE_EVENT(f2fs__page, f2fs_register_inmem_page,
1281 TP_PROTO(struct page *page, int type),
1286 DEFINE_EVENT(f2fs__page, f2fs_commit_inmem_page,
1288 TP_PROTO(struct page *page, int type),
1293 TRACE_EVENT(f2fs_filemap_fault,
1295 TP_PROTO(struct inode *inode, pgoff_t index, unsigned long ret),
1297 TP_ARGS(inode, index, ret),
1302 __field(pgoff_t, index)
1303 __field(unsigned long, ret)
1307 __entry->dev = inode->i_sb->s_dev;
1308 __entry->ino = inode->i_ino;
1309 __entry->index = index;
1313 TP_printk("dev = (%d,%d), ino = %lu, index = %lu, ret = %lx",
1314 show_dev_ino(__entry),
1315 (unsigned long)__entry->index,
1319 TRACE_EVENT(f2fs_writepages,
1321 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
1323 TP_ARGS(inode, wbc, type),
1330 __field(long, nr_to_write)
1331 __field(long, pages_skipped)
1332 __field(loff_t, range_start)
1333 __field(loff_t, range_end)
1334 __field(pgoff_t, writeback_index)
1335 __field(int, sync_mode)
1336 __field(char, for_kupdate)
1337 __field(char, for_background)
1338 __field(char, tagged_writepages)
1339 __field(char, for_reclaim)
1340 __field(char, range_cyclic)
1341 __field(char, for_sync)
1345 __entry->dev = inode->i_sb->s_dev;
1346 __entry->ino = inode->i_ino;
1347 __entry->type = type;
1348 __entry->dir = S_ISDIR(inode->i_mode);
1349 __entry->nr_to_write = wbc->nr_to_write;
1350 __entry->pages_skipped = wbc->pages_skipped;
1351 __entry->range_start = wbc->range_start;
1352 __entry->range_end = wbc->range_end;
1353 __entry->writeback_index = inode->i_mapping->writeback_index;
1354 __entry->sync_mode = wbc->sync_mode;
1355 __entry->for_kupdate = wbc->for_kupdate;
1356 __entry->for_background = wbc->for_background;
1357 __entry->tagged_writepages = wbc->tagged_writepages;
1358 __entry->for_reclaim = wbc->for_reclaim;
1359 __entry->range_cyclic = wbc->range_cyclic;
1360 __entry->for_sync = wbc->for_sync;
1363 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1364 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1365 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1366 show_dev_ino(__entry),
1367 show_block_type(__entry->type),
1368 show_file_type(__entry->dir),
1369 __entry->nr_to_write,
1370 __entry->pages_skipped,
1371 __entry->range_start,
1373 (unsigned long)__entry->writeback_index,
1375 __entry->for_kupdate,
1376 __entry->for_background,
1377 __entry->tagged_writepages,
1378 __entry->for_reclaim,
1379 __entry->range_cyclic,
1383 TRACE_EVENT(f2fs_readpages,
1385 TP_PROTO(struct inode *inode, pgoff_t start, unsigned int nrpage),
1387 TP_ARGS(inode, start, nrpage),
1392 __field(pgoff_t, start)
1393 __field(unsigned int, nrpage)
1397 __entry->dev = inode->i_sb->s_dev;
1398 __entry->ino = inode->i_ino;
1399 __entry->start = start;
1400 __entry->nrpage = nrpage;
1403 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1404 show_dev_ino(__entry),
1405 (unsigned long)__entry->start,
1409 TRACE_EVENT(f2fs_write_checkpoint,
1411 TP_PROTO(struct super_block *sb, int reason, char *msg),
1413 TP_ARGS(sb, reason, msg),
1417 __field(int, reason)
1418 __field(char *, msg)
1422 __entry->dev = sb->s_dev;
1423 __entry->reason = reason;
1427 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1428 show_dev(__entry->dev),
1429 show_cpreason(__entry->reason),
1433 DECLARE_EVENT_CLASS(f2fs_discard,
1435 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1437 TP_ARGS(dev, blkstart, blklen),
1441 __field(block_t, blkstart)
1442 __field(block_t, blklen)
1446 __entry->dev = dev->bd_dev;
1447 __entry->blkstart = blkstart;
1448 __entry->blklen = blklen;
1451 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1452 show_dev(__entry->dev),
1453 (unsigned long long)__entry->blkstart,
1454 (unsigned long long)__entry->blklen)
1457 DEFINE_EVENT(f2fs_discard, f2fs_queue_discard,
1459 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1461 TP_ARGS(dev, blkstart, blklen)
1464 DEFINE_EVENT(f2fs_discard, f2fs_issue_discard,
1466 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1468 TP_ARGS(dev, blkstart, blklen)
1471 DEFINE_EVENT(f2fs_discard, f2fs_remove_discard,
1473 TP_PROTO(struct block_device *dev, block_t blkstart, block_t blklen),
1475 TP_ARGS(dev, blkstart, blklen)
1478 TRACE_EVENT(f2fs_issue_reset_zone,
1480 TP_PROTO(struct block_device *dev, block_t blkstart),
1482 TP_ARGS(dev, blkstart),
1486 __field(block_t, blkstart)
1490 __entry->dev = dev->bd_dev;
1491 __entry->blkstart = blkstart;
1494 TP_printk("dev = (%d,%d), reset zone at block = 0x%llx",
1495 show_dev(__entry->dev),
1496 (unsigned long long)__entry->blkstart)
1499 TRACE_EVENT(f2fs_issue_flush,
1501 TP_PROTO(struct block_device *dev, unsigned int nobarrier,
1502 unsigned int flush_merge, int ret),
1504 TP_ARGS(dev, nobarrier, flush_merge, ret),
1508 __field(unsigned int, nobarrier)
1509 __field(unsigned int, flush_merge)
1514 __entry->dev = dev->bd_dev;
1515 __entry->nobarrier = nobarrier;
1516 __entry->flush_merge = flush_merge;
1520 TP_printk("dev = (%d,%d), %s %s, ret = %d",
1521 show_dev(__entry->dev),
1522 __entry->nobarrier ? "skip (nobarrier)" : "issue",
1523 __entry->flush_merge ? " with flush_merge" : "",
1527 TRACE_EVENT(f2fs_lookup_extent_tree_start,
1529 TP_PROTO(struct inode *inode, unsigned int pgofs),
1531 TP_ARGS(inode, pgofs),
1536 __field(unsigned int, pgofs)
1540 __entry->dev = inode->i_sb->s_dev;
1541 __entry->ino = inode->i_ino;
1542 __entry->pgofs = pgofs;
1545 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1546 show_dev_ino(__entry),
1550 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end,
1552 TP_PROTO(struct inode *inode, unsigned int pgofs,
1553 struct extent_info *ei),
1555 TP_ARGS(inode, pgofs, ei),
1562 __field(unsigned int, pgofs)
1563 __field(unsigned int, fofs)
1565 __field(unsigned int, len)
1569 __entry->dev = inode->i_sb->s_dev;
1570 __entry->ino = inode->i_ino;
1571 __entry->pgofs = pgofs;
1572 __entry->fofs = ei->fofs;
1573 __entry->blk = ei->blk;
1574 __entry->len = ei->len;
1577 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1578 "ext_info(fofs: %u, blk: %u, len: %u)",
1579 show_dev_ino(__entry),
1586 TRACE_EVENT(f2fs_update_extent_tree_range,
1588 TP_PROTO(struct inode *inode, unsigned int pgofs, block_t blkaddr,
1591 TP_ARGS(inode, pgofs, blkaddr, len),
1596 __field(unsigned int, pgofs)
1598 __field(unsigned int, len)
1602 __entry->dev = inode->i_sb->s_dev;
1603 __entry->ino = inode->i_ino;
1604 __entry->pgofs = pgofs;
1605 __entry->blk = blkaddr;
1609 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1610 "blkaddr = %u, len = %u",
1611 show_dev_ino(__entry),
1617 TRACE_EVENT(f2fs_shrink_extent_tree,
1619 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int node_cnt,
1620 unsigned int tree_cnt),
1622 TP_ARGS(sbi, node_cnt, tree_cnt),
1626 __field(unsigned int, node_cnt)
1627 __field(unsigned int, tree_cnt)
1631 __entry->dev = sbi->sb->s_dev;
1632 __entry->node_cnt = node_cnt;
1633 __entry->tree_cnt = tree_cnt;
1636 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1637 show_dev(__entry->dev),
1642 TRACE_EVENT(f2fs_destroy_extent_tree,
1644 TP_PROTO(struct inode *inode, unsigned int node_cnt),
1646 TP_ARGS(inode, node_cnt),
1651 __field(unsigned int, node_cnt)
1655 __entry->dev = inode->i_sb->s_dev;
1656 __entry->ino = inode->i_ino;
1657 __entry->node_cnt = node_cnt;
1660 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1661 show_dev_ino(__entry),
1665 DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
1667 TP_PROTO(struct super_block *sb, int type, s64 count),
1669 TP_ARGS(sb, type, count),
1678 __entry->dev = sb->s_dev;
1679 __entry->type = type;
1680 __entry->count = count;
1683 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
1684 show_dev(__entry->dev),
1685 show_file_type(__entry->type),
1689 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
1691 TP_PROTO(struct super_block *sb, int type, s64 count),
1693 TP_ARGS(sb, type, count)
1696 DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
1698 TP_PROTO(struct super_block *sb, int type, s64 count),
1700 TP_ARGS(sb, type, count)
1703 TRACE_EVENT(f2fs_shutdown,
1705 TP_PROTO(struct f2fs_sb_info *sbi, unsigned int mode, int ret),
1707 TP_ARGS(sbi, mode, ret),
1711 __field(unsigned int, mode)
1716 __entry->dev = sbi->sb->s_dev;
1717 __entry->mode = mode;
1721 TP_printk("dev = (%d,%d), mode: %s, ret:%d",
1722 show_dev(__entry->dev),
1723 show_shutdown_mode(__entry->mode),
1727 DECLARE_EVENT_CLASS(f2fs_zip_start,
1729 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1730 unsigned int cluster_size, unsigned char algtype),
1732 TP_ARGS(inode, cluster_idx, cluster_size, algtype),
1737 __field(pgoff_t, idx)
1738 __field(unsigned int, size)
1739 __field(unsigned int, algtype)
1743 __entry->dev = inode->i_sb->s_dev;
1744 __entry->ino = inode->i_ino;
1745 __entry->idx = cluster_idx;
1746 __entry->size = cluster_size;
1747 __entry->algtype = algtype;
1750 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1751 "cluster_size = %u, algorithm = %s",
1752 show_dev_ino(__entry),
1755 show_compress_algorithm(__entry->algtype))
1758 DECLARE_EVENT_CLASS(f2fs_zip_end,
1760 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1761 unsigned int compressed_size, int ret),
1763 TP_ARGS(inode, cluster_idx, compressed_size, ret),
1768 __field(pgoff_t, idx)
1769 __field(unsigned int, size)
1770 __field(unsigned int, ret)
1774 __entry->dev = inode->i_sb->s_dev;
1775 __entry->ino = inode->i_ino;
1776 __entry->idx = cluster_idx;
1777 __entry->size = compressed_size;
1781 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1782 "compressed_size = %u, ret = %d",
1783 show_dev_ino(__entry),
1789 DEFINE_EVENT(f2fs_zip_start, f2fs_compress_pages_start,
1791 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1792 unsigned int cluster_size, unsigned char algtype),
1794 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1797 DEFINE_EVENT(f2fs_zip_start, f2fs_decompress_pages_start,
1799 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1800 unsigned int cluster_size, unsigned char algtype),
1802 TP_ARGS(inode, cluster_idx, cluster_size, algtype)
1805 DEFINE_EVENT(f2fs_zip_end, f2fs_compress_pages_end,
1807 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1808 unsigned int compressed_size, int ret),
1810 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1813 DEFINE_EVENT(f2fs_zip_end, f2fs_decompress_pages_end,
1815 TP_PROTO(struct inode *inode, pgoff_t cluster_idx,
1816 unsigned int compressed_size, int ret),
1818 TP_ARGS(inode, cluster_idx, compressed_size, ret)
1821 TRACE_EVENT(f2fs_iostat,
1823 TP_PROTO(struct f2fs_sb_info *sbi, unsigned long long *iostat),
1825 TP_ARGS(sbi, iostat),
1829 __field(unsigned long long, app_dio)
1830 __field(unsigned long long, app_bio)
1831 __field(unsigned long long, app_wio)
1832 __field(unsigned long long, app_mio)
1833 __field(unsigned long long, fs_dio)
1834 __field(unsigned long long, fs_nio)
1835 __field(unsigned long long, fs_mio)
1836 __field(unsigned long long, fs_gc_dio)
1837 __field(unsigned long long, fs_gc_nio)
1838 __field(unsigned long long, fs_cp_dio)
1839 __field(unsigned long long, fs_cp_nio)
1840 __field(unsigned long long, fs_cp_mio)
1841 __field(unsigned long long, app_drio)
1842 __field(unsigned long long, app_brio)
1843 __field(unsigned long long, app_rio)
1844 __field(unsigned long long, app_mrio)
1845 __field(unsigned long long, fs_drio)
1846 __field(unsigned long long, fs_gdrio)
1847 __field(unsigned long long, fs_cdrio)
1848 __field(unsigned long long, fs_nrio)
1849 __field(unsigned long long, fs_mrio)
1850 __field(unsigned long long, fs_discard)
1854 __entry->dev = sbi->sb->s_dev;
1855 __entry->app_dio = iostat[APP_DIRECT_IO];
1856 __entry->app_bio = iostat[APP_BUFFERED_IO];
1857 __entry->app_wio = iostat[APP_WRITE_IO];
1858 __entry->app_mio = iostat[APP_MAPPED_IO];
1859 __entry->fs_dio = iostat[FS_DATA_IO];
1860 __entry->fs_nio = iostat[FS_NODE_IO];
1861 __entry->fs_mio = iostat[FS_META_IO];
1862 __entry->fs_gc_dio = iostat[FS_GC_DATA_IO];
1863 __entry->fs_gc_nio = iostat[FS_GC_NODE_IO];
1864 __entry->fs_cp_dio = iostat[FS_CP_DATA_IO];
1865 __entry->fs_cp_nio = iostat[FS_CP_NODE_IO];
1866 __entry->fs_cp_mio = iostat[FS_CP_META_IO];
1867 __entry->app_drio = iostat[APP_DIRECT_READ_IO];
1868 __entry->app_brio = iostat[APP_BUFFERED_READ_IO];
1869 __entry->app_rio = iostat[APP_READ_IO];
1870 __entry->app_mrio = iostat[APP_MAPPED_READ_IO];
1871 __entry->fs_drio = iostat[FS_DATA_READ_IO];
1872 __entry->fs_gdrio = iostat[FS_GDATA_READ_IO];
1873 __entry->fs_cdrio = iostat[FS_CDATA_READ_IO];
1874 __entry->fs_nrio = iostat[FS_NODE_READ_IO];
1875 __entry->fs_mrio = iostat[FS_META_READ_IO];
1876 __entry->fs_discard = iostat[FS_DISCARD];
1879 TP_printk("dev = (%d,%d), "
1880 "app [write=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
1881 "fs [data=%llu, node=%llu, meta=%llu, discard=%llu], "
1882 "gc [data=%llu, node=%llu], "
1883 "cp [data=%llu, node=%llu, meta=%llu], "
1884 "app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
1885 "fs [data=%llu, (gc_data=%llu, compr_data=%llu), "
1886 "node=%llu, meta=%llu]",
1887 show_dev(__entry->dev), __entry->app_wio, __entry->app_dio,
1888 __entry->app_bio, __entry->app_mio, __entry->fs_dio,
1889 __entry->fs_nio, __entry->fs_mio, __entry->fs_discard,
1890 __entry->fs_gc_dio, __entry->fs_gc_nio, __entry->fs_cp_dio,
1891 __entry->fs_cp_nio, __entry->fs_cp_mio,
1892 __entry->app_rio, __entry->app_drio, __entry->app_brio,
1893 __entry->app_mrio, __entry->fs_drio, __entry->fs_gdrio,
1894 __entry->fs_cdrio, __entry->fs_nrio, __entry->fs_mrio)
1897 TRACE_EVENT(f2fs_bmap,
1899 TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock),
1901 TP_ARGS(inode, lblock, pblock),
1906 __field(sector_t, lblock)
1907 __field(sector_t, pblock)
1911 __entry->dev = inode->i_sb->s_dev;
1912 __entry->ino = inode->i_ino;
1913 __entry->lblock = lblock;
1914 __entry->pblock = pblock;
1917 TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld",
1918 show_dev_ino(__entry),
1919 (unsigned long long)__entry->lblock,
1920 (unsigned long long)__entry->pblock)
1923 TRACE_EVENT(f2fs_fiemap,
1925 TP_PROTO(struct inode *inode, sector_t lblock, sector_t pblock,
1926 unsigned long long len, unsigned int flags, int ret),
1928 TP_ARGS(inode, lblock, pblock, len, flags, ret),
1933 __field(sector_t, lblock)
1934 __field(sector_t, pblock)
1935 __field(unsigned long long, len)
1936 __field(unsigned int, flags)
1941 __entry->dev = inode->i_sb->s_dev;
1942 __entry->ino = inode->i_ino;
1943 __entry->lblock = lblock;
1944 __entry->pblock = pblock;
1946 __entry->flags = flags;
1950 TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, "
1951 "len:%llu, flags:%u, ret:%d",
1952 show_dev_ino(__entry),
1953 (unsigned long long)__entry->lblock,
1954 (unsigned long long)__entry->pblock,
1960 #endif /* _TRACE_F2FS_H */
1962 /* This part must be outside protection */
1963 #include <trace/define_trace.h>