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(IPU
);
19 TRACE_DEFINE_ENUM(OPU
);
20 TRACE_DEFINE_ENUM(HOT
);
21 TRACE_DEFINE_ENUM(WARM
);
22 TRACE_DEFINE_ENUM(COLD
);
23 TRACE_DEFINE_ENUM(CURSEG_HOT_DATA
);
24 TRACE_DEFINE_ENUM(CURSEG_WARM_DATA
);
25 TRACE_DEFINE_ENUM(CURSEG_COLD_DATA
);
26 TRACE_DEFINE_ENUM(CURSEG_HOT_NODE
);
27 TRACE_DEFINE_ENUM(CURSEG_WARM_NODE
);
28 TRACE_DEFINE_ENUM(CURSEG_COLD_NODE
);
29 TRACE_DEFINE_ENUM(NO_CHECK_TYPE
);
30 TRACE_DEFINE_ENUM(GC_GREEDY
);
31 TRACE_DEFINE_ENUM(GC_CB
);
32 TRACE_DEFINE_ENUM(FG_GC
);
33 TRACE_DEFINE_ENUM(BG_GC
);
34 TRACE_DEFINE_ENUM(LFS
);
35 TRACE_DEFINE_ENUM(SSR
);
36 TRACE_DEFINE_ENUM(__REQ_RAHEAD
);
37 TRACE_DEFINE_ENUM(__REQ_SYNC
);
38 TRACE_DEFINE_ENUM(__REQ_IDLE
);
39 TRACE_DEFINE_ENUM(__REQ_PREFLUSH
);
40 TRACE_DEFINE_ENUM(__REQ_FUA
);
41 TRACE_DEFINE_ENUM(__REQ_PRIO
);
42 TRACE_DEFINE_ENUM(__REQ_META
);
43 TRACE_DEFINE_ENUM(CP_UMOUNT
);
44 TRACE_DEFINE_ENUM(CP_FASTBOOT
);
45 TRACE_DEFINE_ENUM(CP_SYNC
);
46 TRACE_DEFINE_ENUM(CP_RECOVERY
);
47 TRACE_DEFINE_ENUM(CP_DISCARD
);
48 TRACE_DEFINE_ENUM(CP_TRIMMED
);
49 TRACE_DEFINE_ENUM(CP_PAUSE
);
50 TRACE_DEFINE_ENUM(CP_RESIZE
);
51 TRACE_DEFINE_ENUM(EX_READ
);
52 TRACE_DEFINE_ENUM(EX_BLOCK_AGE
);
54 #define show_block_type(type) \
55 __print_symbolic(type, \
59 { META_FLUSH, "META_FLUSH" }, \
60 { IPU, "IN-PLACE" }, \
61 { OPU, "OUT-OF-PLACE" })
63 #define show_block_temp(temp) \
64 __print_symbolic(temp, \
69 #define F2FS_OP_FLAGS (REQ_RAHEAD | REQ_SYNC | REQ_META | REQ_PRIO | \
70 REQ_PREFLUSH | REQ_FUA)
71 #define F2FS_BIO_FLAG_MASK(t) (__force u32)((t) & F2FS_OP_FLAGS)
73 #define show_bio_type(op,op_flags) show_bio_op(op), \
74 show_bio_op_flags(op_flags)
76 #define show_bio_op(op) blk_op_str(op)
78 #define show_bio_op_flags(flags) \
79 __print_flags(F2FS_BIO_FLAG_MASK(flags), "|", \
80 { (__force u32)REQ_RAHEAD, "R" }, \
81 { (__force u32)REQ_SYNC, "S" }, \
82 { (__force u32)REQ_META, "M" }, \
83 { (__force u32)REQ_PRIO, "P" }, \
84 { (__force u32)REQ_PREFLUSH, "PF" }, \
85 { (__force u32)REQ_FUA, "FUA" })
87 #define show_data_type(type) \
88 __print_symbolic(type, \
89 { CURSEG_HOT_DATA, "Hot DATA" }, \
90 { CURSEG_WARM_DATA, "Warm DATA" }, \
91 { CURSEG_COLD_DATA, "Cold DATA" }, \
92 { CURSEG_HOT_NODE, "Hot NODE" }, \
93 { CURSEG_WARM_NODE, "Warm NODE" }, \
94 { CURSEG_COLD_NODE, "Cold NODE" }, \
95 { NO_CHECK_TYPE, "No TYPE" })
97 #define show_file_type(type) \
98 __print_symbolic(type, \
102 #define show_gc_type(type) \
103 __print_symbolic(type, \
104 { FG_GC, "Foreground GC" }, \
105 { BG_GC, "Background GC" })
107 #define show_alloc_mode(type) \
108 __print_symbolic(type, \
109 { LFS, "LFS-mode" }, \
110 { SSR, "SSR-mode" }, \
111 { AT_SSR, "AT_SSR-mode" })
113 #define show_victim_policy(type) \
114 __print_symbolic(type, \
115 { GC_GREEDY, "Greedy" }, \
116 { GC_CB, "Cost-Benefit" }, \
117 { GC_AT, "Age-threshold" })
119 #define show_cpreason(type) \
120 __print_flags(type, "|", \
121 { CP_UMOUNT, "Umount" }, \
122 { CP_FASTBOOT, "Fastboot" }, \
123 { CP_SYNC, "Sync" }, \
124 { CP_RECOVERY, "Recovery" }, \
125 { CP_DISCARD, "Discard" }, \
126 { CP_PAUSE, "Pause" }, \
127 { CP_TRIMMED, "Trimmed" }, \
128 { CP_RESIZE, "Resize" })
130 #define show_fsync_cpreason(type) \
131 __print_symbolic(type, \
132 { CP_NO_NEEDED, "no needed" }, \
133 { CP_NON_REGULAR, "non regular" }, \
134 { CP_COMPRESSED, "compressed" }, \
135 { CP_HARDLINK, "hardlink" }, \
136 { CP_SB_NEED_CP, "sb needs cp" }, \
137 { CP_WRONG_PINO, "wrong pino" }, \
138 { CP_NO_SPC_ROLL, "no space roll forward" }, \
139 { CP_NODE_NEED_CP, "node needs cp" }, \
140 { CP_FASTBOOT_MODE, "fastboot mode" }, \
141 { CP_SPEC_LOG_NUM, "log type is 2" }, \
142 { CP_RECOVER_DIR, "dir needs recovery" }, \
143 { CP_XATTR_DIR, "dir's xattr updated" })
145 #define show_shutdown_mode(type) \
146 __print_symbolic(type, \
147 { F2FS_GOING_DOWN_FULLSYNC, "full sync" }, \
148 { F2FS_GOING_DOWN_METASYNC, "meta sync" }, \
149 { F2FS_GOING_DOWN_NOSYNC, "no sync" }, \
150 { F2FS_GOING_DOWN_METAFLUSH, "meta flush" }, \
151 { F2FS_GOING_DOWN_NEED_FSCK, "need fsck" })
153 #define show_compress_algorithm(type) \
154 __print_symbolic(type, \
155 { COMPRESS_LZO, "LZO" }, \
156 { COMPRESS_LZ4, "LZ4" }, \
157 { COMPRESS_ZSTD, "ZSTD" }, \
158 { COMPRESS_LZORLE, "LZO-RLE" })
160 #define show_extent_type(type) \
161 __print_symbolic(type, \
162 { EX_READ, "Read" }, \
163 { EX_BLOCK_AGE, "Block Age" })
165 #define show_inode_type(x) \
166 __print_symbolic(x, \
167 { S_IFLNK, "symbolic" }, \
168 { S_IFREG, "regular" }, \
169 { S_IFDIR, "directory" }, \
170 { S_IFCHR, "character" }, \
171 { S_IFBLK, "block" }, \
172 { S_IFIFO, "fifo" }, \
173 { S_IFSOCK, "sock" })
175 #define S_ALL_PERM (S_ISUID | S_ISGID | S_ISVTX | \
176 S_IRWXU | S_IRWXG | S_IRWXO)
181 struct victim_sel_policy
;
182 struct f2fs_map_blocks
;
184 DECLARE_EVENT_CLASS(f2fs__inode
,
186 TP_PROTO(struct inode
*inode
),
194 __field(umode_t
, mode
)
195 __field(loff_t
, size
)
196 __field(unsigned int, nlink
)
197 __field(blkcnt_t
, blocks
)
198 __field(__u8
, advise
)
202 __entry
->dev
= inode
->i_sb
->s_dev
;
203 __entry
->ino
= inode
->i_ino
;
204 __entry
->pino
= F2FS_I(inode
)->i_pino
;
205 __entry
->mode
= inode
->i_mode
;
206 __entry
->nlink
= inode
->i_nlink
;
207 __entry
->size
= inode
->i_size
;
208 __entry
->blocks
= inode
->i_blocks
;
209 __entry
->advise
= F2FS_I(inode
)->i_advise
;
212 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
213 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
214 show_dev_ino(__entry
),
215 (unsigned long)__entry
->pino
,
218 (unsigned int)__entry
->nlink
,
219 (unsigned long long)__entry
->blocks
,
220 (unsigned char)__entry
->advise
)
223 DECLARE_EVENT_CLASS(f2fs__inode_exit
,
225 TP_PROTO(struct inode
*inode
, int ret
),
232 __field(umode_t
, mode
)
237 __entry
->dev
= inode
->i_sb
->s_dev
;
238 __entry
->ino
= inode
->i_ino
;
239 __entry
->mode
= inode
->i_mode
;
243 TP_printk("dev = (%d,%d), ino = %lu, type: %s, mode = 0%o, ret = %d",
244 show_dev_ino(__entry
),
245 show_inode_type(__entry
->mode
& S_IFMT
),
246 __entry
->mode
& S_ALL_PERM
,
250 DEFINE_EVENT(f2fs__inode
, f2fs_sync_file_enter
,
252 TP_PROTO(struct inode
*inode
),
257 TRACE_EVENT(f2fs_sync_file_exit
,
259 TP_PROTO(struct inode
*inode
, int cp_reason
, int datasync
, int ret
),
261 TP_ARGS(inode
, cp_reason
, datasync
, ret
),
266 __field(int, cp_reason
)
267 __field(int, datasync
)
272 __entry
->dev
= inode
->i_sb
->s_dev
;
273 __entry
->ino
= inode
->i_ino
;
274 __entry
->cp_reason
= cp_reason
;
275 __entry
->datasync
= datasync
;
279 TP_printk("dev = (%d,%d), ino = %lu, cp_reason: %s, "
280 "datasync = %d, ret = %d",
281 show_dev_ino(__entry
),
282 show_fsync_cpreason(__entry
->cp_reason
),
287 TRACE_EVENT(f2fs_sync_fs
,
289 TP_PROTO(struct super_block
*sb
, int wait
),
300 __entry
->dev
= sb
->s_dev
;
301 __entry
->dirty
= is_sbi_flag_set(F2FS_SB(sb
), SBI_IS_DIRTY
);
302 __entry
->wait
= wait
;
305 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
306 show_dev(__entry
->dev
),
307 __entry
->dirty
? "dirty" : "not dirty",
311 DEFINE_EVENT(f2fs__inode
, f2fs_iget
,
313 TP_PROTO(struct inode
*inode
),
318 DEFINE_EVENT(f2fs__inode_exit
, f2fs_iget_exit
,
320 TP_PROTO(struct inode
*inode
, int ret
),
325 DEFINE_EVENT(f2fs__inode
, f2fs_evict_inode
,
327 TP_PROTO(struct inode
*inode
),
332 DEFINE_EVENT(f2fs__inode_exit
, f2fs_new_inode
,
334 TP_PROTO(struct inode
*inode
, int ret
),
339 TRACE_EVENT(f2fs_unlink_enter
,
341 TP_PROTO(struct inode
*dir
, struct dentry
*dentry
),
343 TP_ARGS(dir
, dentry
),
348 __field(loff_t
, size
)
349 __field(blkcnt_t
, blocks
)
350 __string(name
, dentry
->d_name
.name
)
354 __entry
->dev
= dir
->i_sb
->s_dev
;
355 __entry
->ino
= dir
->i_ino
;
356 __entry
->size
= dir
->i_size
;
357 __entry
->blocks
= dir
->i_blocks
;
361 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
362 "i_blocks = %llu, name = %s",
363 show_dev_ino(__entry
),
365 (unsigned long long)__entry
->blocks
,
369 DEFINE_EVENT(f2fs__inode_exit
, f2fs_unlink_exit
,
371 TP_PROTO(struct inode
*inode
, int ret
),
376 DEFINE_EVENT(f2fs__inode_exit
, f2fs_drop_inode
,
378 TP_PROTO(struct inode
*inode
, int ret
),
383 DEFINE_EVENT(f2fs__inode
, f2fs_truncate
,
385 TP_PROTO(struct inode
*inode
),
390 TRACE_EVENT(f2fs_truncate_data_blocks_range
,
392 TP_PROTO(struct inode
*inode
, nid_t nid
, unsigned int ofs
, int free
),
394 TP_ARGS(inode
, nid
, ofs
, free
),
400 __field(unsigned int, ofs
)
405 __entry
->dev
= inode
->i_sb
->s_dev
;
406 __entry
->ino
= inode
->i_ino
;
409 __entry
->free
= free
;
412 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
413 show_dev_ino(__entry
),
414 (unsigned int)__entry
->nid
,
419 DECLARE_EVENT_CLASS(f2fs__truncate_op
,
421 TP_PROTO(struct inode
*inode
, u64 from
),
423 TP_ARGS(inode
, from
),
428 __field(loff_t
, size
)
429 __field(blkcnt_t
, blocks
)
434 __entry
->dev
= inode
->i_sb
->s_dev
;
435 __entry
->ino
= inode
->i_ino
;
436 __entry
->size
= inode
->i_size
;
437 __entry
->blocks
= inode
->i_blocks
;
438 __entry
->from
= from
;
441 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
442 "start file offset = %llu",
443 show_dev_ino(__entry
),
445 (unsigned long long)__entry
->blocks
,
446 (unsigned long long)__entry
->from
)
449 DEFINE_EVENT(f2fs__truncate_op
, f2fs_truncate_blocks_enter
,
451 TP_PROTO(struct inode
*inode
, u64 from
),
456 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_blocks_exit
,
458 TP_PROTO(struct inode
*inode
, int ret
),
463 DEFINE_EVENT(f2fs__truncate_op
, f2fs_truncate_inode_blocks_enter
,
465 TP_PROTO(struct inode
*inode
, u64 from
),
470 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_inode_blocks_exit
,
472 TP_PROTO(struct inode
*inode
, int ret
),
477 DECLARE_EVENT_CLASS(f2fs__truncate_node
,
479 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
481 TP_ARGS(inode
, nid
, blk_addr
),
487 __field(block_t
, blk_addr
)
491 __entry
->dev
= inode
->i_sb
->s_dev
;
492 __entry
->ino
= inode
->i_ino
;
494 __entry
->blk_addr
= blk_addr
;
497 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
498 show_dev_ino(__entry
),
499 (unsigned int)__entry
->nid
,
500 (unsigned long long)__entry
->blk_addr
)
503 DEFINE_EVENT(f2fs__truncate_node
, f2fs_truncate_nodes_enter
,
505 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
507 TP_ARGS(inode
, nid
, blk_addr
)
510 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_nodes_exit
,
512 TP_PROTO(struct inode
*inode
, int ret
),
517 DEFINE_EVENT(f2fs__truncate_node
, f2fs_truncate_node
,
519 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
521 TP_ARGS(inode
, nid
, blk_addr
)
524 TRACE_EVENT(f2fs_truncate_partial_nodes
,
526 TP_PROTO(struct inode
*inode
, nid_t
*nid
, int depth
, int err
),
528 TP_ARGS(inode
, nid
, depth
, err
),
533 __array(nid_t
, nid
, 3)
539 __entry
->dev
= inode
->i_sb
->s_dev
;
540 __entry
->ino
= inode
->i_ino
;
541 __entry
->nid
[0] = nid
[0];
542 __entry
->nid
[1] = nid
[1];
543 __entry
->nid
[2] = nid
[2];
544 __entry
->depth
= depth
;
548 TP_printk("dev = (%d,%d), ino = %lu, "
549 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
550 show_dev_ino(__entry
),
551 (unsigned int)__entry
->nid
[0],
552 (unsigned int)__entry
->nid
[1],
553 (unsigned int)__entry
->nid
[2],
558 TRACE_EVENT(f2fs_file_write_iter
,
560 TP_PROTO(struct inode
*inode
, loff_t offset
, size_t length
,
563 TP_ARGS(inode
, offset
, length
, ret
),
568 __field(loff_t
, offset
)
569 __field(size_t, length
)
570 __field(ssize_t
, ret
)
574 __entry
->dev
= inode
->i_sb
->s_dev
;
575 __entry
->ino
= inode
->i_ino
;
576 __entry
->offset
= offset
;
577 __entry
->length
= length
;
581 TP_printk("dev = (%d,%d), ino = %lu, "
582 "offset = %lld, length = %zu, written(err) = %zd",
583 show_dev_ino(__entry
),
589 TRACE_EVENT(f2fs_map_blocks
,
590 TP_PROTO(struct inode
*inode
, struct f2fs_map_blocks
*map
, int flag
,
593 TP_ARGS(inode
, map
, flag
, ret
),
598 __field(block_t
, m_lblk
)
599 __field(block_t
, m_pblk
)
600 __field(unsigned int, m_len
)
601 __field(unsigned int, m_flags
)
602 __field(int, m_seg_type
)
603 __field(bool, m_may_create
)
604 __field(bool, m_multidev_dio
)
610 __entry
->dev
= map
->m_bdev
->bd_dev
;
611 __entry
->ino
= inode
->i_ino
;
612 __entry
->m_lblk
= map
->m_lblk
;
613 __entry
->m_pblk
= map
->m_pblk
;
614 __entry
->m_len
= map
->m_len
;
615 __entry
->m_flags
= map
->m_flags
;
616 __entry
->m_seg_type
= map
->m_seg_type
;
617 __entry
->m_may_create
= map
->m_may_create
;
618 __entry
->m_multidev_dio
= map
->m_multidev_dio
;
619 __entry
->flag
= flag
;
623 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
624 "start blkaddr = 0x%llx, len = 0x%llx, flags = %u, "
625 "seg_type = %d, may_create = %d, multidevice = %d, "
626 "flag = %d, err = %d",
627 show_dev_ino(__entry
),
628 (unsigned long long)__entry
->m_lblk
,
629 (unsigned long long)__entry
->m_pblk
,
630 (unsigned long long)__entry
->m_len
,
633 __entry
->m_may_create
,
634 __entry
->m_multidev_dio
,
639 TRACE_EVENT(f2fs_background_gc
,
641 TP_PROTO(struct super_block
*sb
, unsigned int wait_ms
,
642 unsigned int prefree
, unsigned int free
),
644 TP_ARGS(sb
, wait_ms
, prefree
, free
),
648 __field(unsigned int, wait_ms
)
649 __field(unsigned int, prefree
)
650 __field(unsigned int, free
)
654 __entry
->dev
= sb
->s_dev
;
655 __entry
->wait_ms
= wait_ms
;
656 __entry
->prefree
= prefree
;
657 __entry
->free
= free
;
660 TP_printk("dev = (%d,%d), wait_ms = %u, prefree = %u, free = %u",
661 show_dev(__entry
->dev
),
667 TRACE_EVENT(f2fs_gc_begin
,
669 TP_PROTO(struct super_block
*sb
, int gc_type
, bool no_bg_gc
,
670 unsigned int nr_free_secs
,
671 long long dirty_nodes
, long long dirty_dents
,
672 long long dirty_imeta
, unsigned int free_sec
,
673 unsigned int free_seg
, int reserved_seg
,
674 unsigned int prefree_seg
),
676 TP_ARGS(sb
, gc_type
, no_bg_gc
, nr_free_secs
, dirty_nodes
,
677 dirty_dents
, dirty_imeta
,
678 free_sec
, free_seg
, reserved_seg
, prefree_seg
),
682 __field(int, gc_type
)
683 __field(bool, no_bg_gc
)
684 __field(unsigned int, nr_free_secs
)
685 __field(long long, dirty_nodes
)
686 __field(long long, dirty_dents
)
687 __field(long long, dirty_imeta
)
688 __field(unsigned int, free_sec
)
689 __field(unsigned int, free_seg
)
690 __field(int, reserved_seg
)
691 __field(unsigned int, prefree_seg
)
695 __entry
->dev
= sb
->s_dev
;
696 __entry
->gc_type
= gc_type
;
697 __entry
->no_bg_gc
= no_bg_gc
;
698 __entry
->nr_free_secs
= nr_free_secs
;
699 __entry
->dirty_nodes
= dirty_nodes
;
700 __entry
->dirty_dents
= dirty_dents
;
701 __entry
->dirty_imeta
= dirty_imeta
;
702 __entry
->free_sec
= free_sec
;
703 __entry
->free_seg
= free_seg
;
704 __entry
->reserved_seg
= reserved_seg
;
705 __entry
->prefree_seg
= prefree_seg
;
708 TP_printk("dev = (%d,%d), gc_type = %s, no_background_GC = %d, nr_free_secs = %u, "
709 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, free_seg:%u, "
710 "rsv_seg:%d, prefree_seg:%u",
711 show_dev(__entry
->dev
),
712 show_gc_type(__entry
->gc_type
),
713 (__entry
->gc_type
== BG_GC
) ? __entry
->no_bg_gc
: -1,
714 __entry
->nr_free_secs
,
715 __entry
->dirty_nodes
,
716 __entry
->dirty_dents
,
717 __entry
->dirty_imeta
,
720 __entry
->reserved_seg
,
721 __entry
->prefree_seg
)
724 TRACE_EVENT(f2fs_gc_end
,
726 TP_PROTO(struct super_block
*sb
, int ret
, int seg_freed
,
727 int sec_freed
, long long dirty_nodes
,
728 long long dirty_dents
, long long dirty_imeta
,
729 unsigned int free_sec
, unsigned int free_seg
,
730 int reserved_seg
, unsigned int prefree_seg
),
732 TP_ARGS(sb
, ret
, seg_freed
, sec_freed
, dirty_nodes
, dirty_dents
,
733 dirty_imeta
, free_sec
, free_seg
, reserved_seg
, prefree_seg
),
738 __field(int, seg_freed
)
739 __field(int, sec_freed
)
740 __field(long long, dirty_nodes
)
741 __field(long long, dirty_dents
)
742 __field(long long, dirty_imeta
)
743 __field(unsigned int, free_sec
)
744 __field(unsigned int, free_seg
)
745 __field(int, reserved_seg
)
746 __field(unsigned int, prefree_seg
)
750 __entry
->dev
= sb
->s_dev
;
752 __entry
->seg_freed
= seg_freed
;
753 __entry
->sec_freed
= sec_freed
;
754 __entry
->dirty_nodes
= dirty_nodes
;
755 __entry
->dirty_dents
= dirty_dents
;
756 __entry
->dirty_imeta
= dirty_imeta
;
757 __entry
->free_sec
= free_sec
;
758 __entry
->free_seg
= free_seg
;
759 __entry
->reserved_seg
= reserved_seg
;
760 __entry
->prefree_seg
= prefree_seg
;
763 TP_printk("dev = (%d,%d), ret = %d, seg_freed = %d, sec_freed = %d, "
764 "nodes = %lld, dents = %lld, imeta = %lld, free_sec:%u, "
765 "free_seg:%u, rsv_seg:%d, prefree_seg:%u",
766 show_dev(__entry
->dev
),
770 __entry
->dirty_nodes
,
771 __entry
->dirty_dents
,
772 __entry
->dirty_imeta
,
775 __entry
->reserved_seg
,
776 __entry
->prefree_seg
)
779 TRACE_EVENT(f2fs_get_victim
,
781 TP_PROTO(struct super_block
*sb
, int type
, int gc_type
,
782 struct victim_sel_policy
*p
, unsigned int pre_victim
,
783 unsigned int prefree
, unsigned int free
),
785 TP_ARGS(sb
, type
, gc_type
, p
, pre_victim
, prefree
, free
),
790 __field(int, gc_type
)
791 __field(int, alloc_mode
)
792 __field(int, gc_mode
)
793 __field(unsigned int, victim
)
794 __field(unsigned int, cost
)
795 __field(unsigned int, ofs_unit
)
796 __field(unsigned int, pre_victim
)
797 __field(unsigned int, prefree
)
798 __field(unsigned int, free
)
802 __entry
->dev
= sb
->s_dev
;
803 __entry
->type
= type
;
804 __entry
->gc_type
= gc_type
;
805 __entry
->alloc_mode
= p
->alloc_mode
;
806 __entry
->gc_mode
= p
->gc_mode
;
807 __entry
->victim
= p
->min_segno
;
808 __entry
->cost
= p
->min_cost
;
809 __entry
->ofs_unit
= p
->ofs_unit
;
810 __entry
->pre_victim
= pre_victim
;
811 __entry
->prefree
= prefree
;
812 __entry
->free
= free
;
815 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), "
816 "victim = %u, cost = %u, ofs_unit = %u, "
817 "pre_victim_secno = %d, prefree = %u, free = %u",
818 show_dev(__entry
->dev
),
819 show_data_type(__entry
->type
),
820 show_gc_type(__entry
->gc_type
),
821 show_alloc_mode(__entry
->alloc_mode
),
822 show_victim_policy(__entry
->gc_mode
),
826 (int)__entry
->pre_victim
,
831 TRACE_EVENT(f2fs_lookup_start
,
833 TP_PROTO(struct inode
*dir
, struct dentry
*dentry
, unsigned int flags
),
835 TP_ARGS(dir
, dentry
, flags
),
840 __string(name
, dentry
->d_name
.name
)
841 __field(unsigned int, flags
)
845 __entry
->dev
= dir
->i_sb
->s_dev
;
846 __entry
->ino
= dir
->i_ino
;
848 __entry
->flags
= flags
;
851 TP_printk("dev = (%d,%d), pino = %lu, name:%s, flags:%u",
852 show_dev_ino(__entry
),
857 TRACE_EVENT(f2fs_lookup_end
,
859 TP_PROTO(struct inode
*dir
, struct dentry
*dentry
, nid_t ino
,
862 TP_ARGS(dir
, dentry
, ino
, err
),
867 __string(name
, dentry
->d_name
.name
)
873 __entry
->dev
= dir
->i_sb
->s_dev
;
874 __entry
->ino
= dir
->i_ino
;
880 TP_printk("dev = (%d,%d), pino = %lu, name:%s, ino:%u, err:%d",
881 show_dev_ino(__entry
),
887 TRACE_EVENT(f2fs_rename_start
,
889 TP_PROTO(struct inode
*old_dir
, struct dentry
*old_dentry
,
890 struct inode
*new_dir
, struct dentry
*new_dentry
,
893 TP_ARGS(old_dir
, old_dentry
, new_dir
, new_dentry
, flags
),
898 __string(old_name
, old_dentry
->d_name
.name
)
899 __field(ino_t
, new_pino
)
900 __string(new_name
, new_dentry
->d_name
.name
)
901 __field(unsigned int, flags
)
905 __entry
->dev
= old_dir
->i_sb
->s_dev
;
906 __entry
->ino
= old_dir
->i_ino
;
907 __assign_str(old_name
);
908 __entry
->new_pino
= new_dir
->i_ino
;
909 __assign_str(new_name
);
910 __entry
->flags
= flags
;
913 TP_printk("dev = (%d,%d), old_dir = %lu, old_name: %s, "
914 "new_dir = %lu, new_name: %s, flags = %u",
915 show_dev_ino(__entry
),
922 TRACE_EVENT(f2fs_rename_end
,
924 TP_PROTO(struct dentry
*old_dentry
, struct dentry
*new_dentry
,
925 unsigned int flags
, int ret
),
927 TP_ARGS(old_dentry
, new_dentry
, flags
, ret
),
932 __string(old_name
, old_dentry
->d_name
.name
)
933 __string(new_name
, new_dentry
->d_name
.name
)
934 __field(unsigned int, flags
)
939 __entry
->dev
= old_dentry
->d_sb
->s_dev
;
940 __entry
->ino
= old_dentry
->d_inode
->i_ino
;
941 __assign_str(old_name
);
942 __assign_str(new_name
);
943 __entry
->flags
= flags
;
947 TP_printk("dev = (%d,%d), ino = %lu, old_name: %s, "
948 "new_name: %s, flags = %u, ret = %d",
949 show_dev_ino(__entry
),
956 TRACE_EVENT(f2fs_readdir
,
958 TP_PROTO(struct inode
*dir
, loff_t start_pos
, loff_t end_pos
, int err
),
960 TP_ARGS(dir
, start_pos
, end_pos
, err
),
965 __field(loff_t
, start
)
971 __entry
->dev
= dir
->i_sb
->s_dev
;
972 __entry
->ino
= dir
->i_ino
;
973 __entry
->start
= start_pos
;
974 __entry
->end
= end_pos
;
978 TP_printk("dev = (%d,%d), ino = %lu, start_pos:%llu, end_pos:%llu, err:%d",
979 show_dev_ino(__entry
),
985 TRACE_EVENT(f2fs_fallocate
,
987 TP_PROTO(struct inode
*inode
, int mode
,
988 loff_t offset
, loff_t len
, int ret
),
990 TP_ARGS(inode
, mode
, offset
, len
, ret
),
996 __field(loff_t
, offset
)
998 __field(loff_t
, size
)
999 __field(blkcnt_t
, blocks
)
1004 __entry
->dev
= inode
->i_sb
->s_dev
;
1005 __entry
->ino
= inode
->i_ino
;
1006 __entry
->mode
= mode
;
1007 __entry
->offset
= offset
;
1009 __entry
->size
= inode
->i_size
;
1010 __entry
->blocks
= inode
->i_blocks
;
1014 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
1015 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
1016 show_dev_ino(__entry
),
1018 (unsigned long long)__entry
->offset
,
1019 (unsigned long long)__entry
->len
,
1020 (unsigned long long)__entry
->size
,
1021 (unsigned long long)__entry
->blocks
,
1025 TRACE_EVENT(f2fs_direct_IO_enter
,
1027 TP_PROTO(struct inode
*inode
, struct kiocb
*iocb
, long len
, int rw
),
1029 TP_ARGS(inode
, iocb
, len
, rw
),
1034 __field(loff_t
, ki_pos
)
1035 __field(int, ki_flags
)
1036 __field(u16
, ki_ioprio
)
1037 __field(unsigned long, len
)
1042 __entry
->dev
= inode
->i_sb
->s_dev
;
1043 __entry
->ino
= inode
->i_ino
;
1044 __entry
->ki_pos
= iocb
->ki_pos
;
1045 __entry
->ki_flags
= iocb
->ki_flags
;
1046 __entry
->ki_ioprio
= iocb
->ki_ioprio
;
1051 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu ki_flags = %x ki_ioprio = %x rw = %d",
1052 show_dev_ino(__entry
),
1060 TRACE_EVENT(f2fs_direct_IO_exit
,
1062 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
,
1065 TP_ARGS(inode
, offset
, len
, rw
, ret
),
1070 __field(loff_t
, pos
)
1071 __field(unsigned long, len
)
1077 __entry
->dev
= inode
->i_sb
->s_dev
;
1078 __entry
->ino
= inode
->i_ino
;
1079 __entry
->pos
= offset
;
1085 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
1087 show_dev_ino(__entry
),
1094 TRACE_EVENT(f2fs_reserve_new_blocks
,
1096 TP_PROTO(struct inode
*inode
, nid_t nid
, unsigned int ofs_in_node
,
1099 TP_ARGS(inode
, nid
, ofs_in_node
, count
),
1104 __field(unsigned int, ofs_in_node
)
1105 __field(blkcnt_t
, count
)
1109 __entry
->dev
= inode
->i_sb
->s_dev
;
1111 __entry
->ofs_in_node
= ofs_in_node
;
1112 __entry
->count
= count
;
1115 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u, count = %llu",
1116 show_dev(__entry
->dev
),
1117 (unsigned int)__entry
->nid
,
1118 __entry
->ofs_in_node
,
1119 (unsigned long long)__entry
->count
)
1122 DECLARE_EVENT_CLASS(f2fs__submit_page_bio
,
1124 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
1131 __field(pgoff_t
, index
)
1132 __field(block_t
, old_blkaddr
)
1133 __field(block_t
, new_blkaddr
)
1134 __field(enum req_op
, op
)
1135 __field(blk_opf_t
, op_flags
)
1141 __entry
->dev
= page_file_mapping(page
)->host
->i_sb
->s_dev
;
1142 __entry
->ino
= page_file_mapping(page
)->host
->i_ino
;
1143 __entry
->index
= page
->index
;
1144 __entry
->old_blkaddr
= fio
->old_blkaddr
;
1145 __entry
->new_blkaddr
= fio
->new_blkaddr
;
1146 __entry
->op
= fio
->op
;
1147 __entry
->op_flags
= fio
->op_flags
;
1148 __entry
->temp
= fio
->temp
;
1149 __entry
->type
= fio
->type
;
1152 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
1153 "oldaddr = 0x%llx, newaddr = 0x%llx, rw = %s(%s), type = %s_%s",
1154 show_dev_ino(__entry
),
1155 (unsigned long)__entry
->index
,
1156 (unsigned long long)__entry
->old_blkaddr
,
1157 (unsigned long long)__entry
->new_blkaddr
,
1158 show_bio_type(__entry
->op
, __entry
->op_flags
),
1159 show_block_temp(__entry
->temp
),
1160 show_block_type(__entry
->type
))
1163 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio
, f2fs_submit_page_bio
,
1165 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
1169 TP_CONDITION(page
->mapping
)
1172 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio
, f2fs_submit_page_write
,
1174 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
1178 TP_CONDITION(page
->mapping
)
1181 DECLARE_EVENT_CLASS(f2fs__bio
,
1183 TP_PROTO(struct super_block
*sb
, int type
, struct bio
*bio
),
1185 TP_ARGS(sb
, type
, bio
),
1189 __field(dev_t
, target
)
1190 __field(enum req_op
, op
)
1191 __field(blk_opf_t
, op_flags
)
1193 __field(sector_t
, sector
)
1194 __field(unsigned int, size
)
1198 __entry
->dev
= sb
->s_dev
;
1199 __entry
->target
= bio_dev(bio
);
1200 __entry
->op
= bio_op(bio
);
1201 __entry
->op_flags
= bio
->bi_opf
;
1202 __entry
->type
= type
;
1203 __entry
->sector
= bio
->bi_iter
.bi_sector
;
1204 __entry
->size
= bio
->bi_iter
.bi_size
;
1207 TP_printk("dev = (%d,%d)/(%d,%d), rw = %s(%s), %s, sector = %lld, size = %u",
1208 show_dev(__entry
->target
),
1209 show_dev(__entry
->dev
),
1210 show_bio_type(__entry
->op
, __entry
->op_flags
),
1211 show_block_type(__entry
->type
),
1212 (unsigned long long)__entry
->sector
,
1216 DEFINE_EVENT_CONDITION(f2fs__bio
, f2fs_prepare_write_bio
,
1218 TP_PROTO(struct super_block
*sb
, int type
, struct bio
*bio
),
1220 TP_ARGS(sb
, type
, bio
),
1225 DEFINE_EVENT_CONDITION(f2fs__bio
, f2fs_prepare_read_bio
,
1227 TP_PROTO(struct super_block
*sb
, int type
, struct bio
*bio
),
1229 TP_ARGS(sb
, type
, bio
),
1234 DEFINE_EVENT_CONDITION(f2fs__bio
, f2fs_submit_read_bio
,
1236 TP_PROTO(struct super_block
*sb
, int type
, struct bio
*bio
),
1238 TP_ARGS(sb
, type
, bio
),
1243 DEFINE_EVENT_CONDITION(f2fs__bio
, f2fs_submit_write_bio
,
1245 TP_PROTO(struct super_block
*sb
, int type
, struct bio
*bio
),
1247 TP_ARGS(sb
, type
, bio
),
1252 TRACE_EVENT(f2fs_write_begin
,
1254 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
),
1256 TP_ARGS(inode
, pos
, len
),
1261 __field(loff_t
, pos
)
1262 __field(unsigned int, len
)
1266 __entry
->dev
= inode
->i_sb
->s_dev
;
1267 __entry
->ino
= inode
->i_ino
;
1272 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u",
1273 show_dev_ino(__entry
),
1274 (unsigned long long)__entry
->pos
,
1278 TRACE_EVENT(f2fs_write_end
,
1280 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
1281 unsigned int copied
),
1283 TP_ARGS(inode
, pos
, len
, copied
),
1288 __field(loff_t
, pos
)
1289 __field(unsigned int, len
)
1290 __field(unsigned int, copied
)
1294 __entry
->dev
= inode
->i_sb
->s_dev
;
1295 __entry
->ino
= inode
->i_ino
;
1298 __entry
->copied
= copied
;
1301 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
1302 show_dev_ino(__entry
),
1303 (unsigned long long)__entry
->pos
,
1308 DECLARE_EVENT_CLASS(f2fs__folio
,
1310 TP_PROTO(struct folio
*folio
, int type
),
1312 TP_ARGS(folio
, type
),
1319 __field(pgoff_t
, index
)
1321 __field(int, uptodate
)
1325 __entry
->dev
= folio_file_mapping(folio
)->host
->i_sb
->s_dev
;
1326 __entry
->ino
= folio_file_mapping(folio
)->host
->i_ino
;
1327 __entry
->type
= type
;
1329 S_ISDIR(folio_file_mapping(folio
)->host
->i_mode
);
1330 __entry
->index
= folio_index(folio
);
1331 __entry
->dirty
= folio_test_dirty(folio
);
1332 __entry
->uptodate
= folio_test_uptodate(folio
);
1335 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
1336 "dirty = %d, uptodate = %d",
1337 show_dev_ino(__entry
),
1338 show_block_type(__entry
->type
),
1339 show_file_type(__entry
->dir
),
1340 (unsigned long)__entry
->index
,
1345 DEFINE_EVENT(f2fs__folio
, f2fs_writepage
,
1347 TP_PROTO(struct folio
*folio
, int type
),
1349 TP_ARGS(folio
, type
)
1352 DEFINE_EVENT(f2fs__folio
, f2fs_do_write_data_page
,
1354 TP_PROTO(struct folio
*folio
, int type
),
1356 TP_ARGS(folio
, type
)
1359 DEFINE_EVENT(f2fs__folio
, f2fs_readpage
,
1361 TP_PROTO(struct folio
*folio
, int type
),
1363 TP_ARGS(folio
, type
)
1366 DEFINE_EVENT(f2fs__folio
, f2fs_set_page_dirty
,
1368 TP_PROTO(struct folio
*folio
, int type
),
1370 TP_ARGS(folio
, type
)
1373 TRACE_EVENT(f2fs_replace_atomic_write_block
,
1375 TP_PROTO(struct inode
*inode
, struct inode
*cow_inode
, pgoff_t index
,
1376 block_t old_addr
, block_t new_addr
, bool recovery
),
1378 TP_ARGS(inode
, cow_inode
, index
, old_addr
, new_addr
, recovery
),
1383 __field(ino_t
, cow_ino
)
1384 __field(pgoff_t
, index
)
1385 __field(block_t
, old_addr
)
1386 __field(block_t
, new_addr
)
1387 __field(bool, recovery
)
1391 __entry
->dev
= inode
->i_sb
->s_dev
;
1392 __entry
->ino
= inode
->i_ino
;
1393 __entry
->cow_ino
= cow_inode
->i_ino
;
1394 __entry
->index
= index
;
1395 __entry
->old_addr
= old_addr
;
1396 __entry
->new_addr
= new_addr
;
1397 __entry
->recovery
= recovery
;
1400 TP_printk("dev = (%d,%d), ino = %lu, cow_ino = %lu, index = %lu, "
1401 "old_addr = 0x%llx, new_addr = 0x%llx, recovery = %d",
1402 show_dev_ino(__entry
),
1404 (unsigned long)__entry
->index
,
1405 (unsigned long long)__entry
->old_addr
,
1406 (unsigned long long)__entry
->new_addr
,
1410 DECLARE_EVENT_CLASS(f2fs_mmap
,
1412 TP_PROTO(struct inode
*inode
, pgoff_t index
,
1413 vm_flags_t flags
, vm_fault_t ret
),
1415 TP_ARGS(inode
, index
, flags
, ret
),
1420 __field(pgoff_t
, index
)
1421 __field(vm_flags_t
, flags
)
1422 __field(vm_fault_t
, ret
)
1426 __entry
->dev
= inode
->i_sb
->s_dev
;
1427 __entry
->ino
= inode
->i_ino
;
1428 __entry
->index
= index
;
1429 __entry
->flags
= flags
;
1433 TP_printk("dev = (%d,%d), ino = %lu, index = %lu, flags: %s, ret: %s",
1434 show_dev_ino(__entry
),
1435 (unsigned long)__entry
->index
,
1436 __print_flags(__entry
->flags
, "|", FAULT_FLAG_TRACE
),
1437 __print_flags(__entry
->ret
, "|", VM_FAULT_RESULT_TRACE
))
1440 DEFINE_EVENT(f2fs_mmap
, f2fs_filemap_fault
,
1442 TP_PROTO(struct inode
*inode
, pgoff_t index
,
1443 vm_flags_t flags
, vm_fault_t ret
),
1445 TP_ARGS(inode
, index
, flags
, ret
)
1448 DEFINE_EVENT(f2fs_mmap
, f2fs_vm_page_mkwrite
,
1450 TP_PROTO(struct inode
*inode
, pgoff_t index
,
1451 vm_flags_t flags
, vm_fault_t ret
),
1453 TP_ARGS(inode
, index
, flags
, ret
)
1456 TRACE_EVENT(f2fs_writepages
,
1458 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
, int type
),
1460 TP_ARGS(inode
, wbc
, type
),
1467 __field(long, nr_to_write
)
1468 __field(long, pages_skipped
)
1469 __field(loff_t
, range_start
)
1470 __field(loff_t
, range_end
)
1471 __field(pgoff_t
, writeback_index
)
1472 __field(int, sync_mode
)
1473 __field(char, for_kupdate
)
1474 __field(char, for_background
)
1475 __field(char, tagged_writepages
)
1476 __field(char, for_reclaim
)
1477 __field(char, range_cyclic
)
1478 __field(char, for_sync
)
1482 __entry
->dev
= inode
->i_sb
->s_dev
;
1483 __entry
->ino
= inode
->i_ino
;
1484 __entry
->type
= type
;
1485 __entry
->dir
= S_ISDIR(inode
->i_mode
);
1486 __entry
->nr_to_write
= wbc
->nr_to_write
;
1487 __entry
->pages_skipped
= wbc
->pages_skipped
;
1488 __entry
->range_start
= wbc
->range_start
;
1489 __entry
->range_end
= wbc
->range_end
;
1490 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
1491 __entry
->sync_mode
= wbc
->sync_mode
;
1492 __entry
->for_kupdate
= wbc
->for_kupdate
;
1493 __entry
->for_background
= wbc
->for_background
;
1494 __entry
->tagged_writepages
= wbc
->tagged_writepages
;
1495 __entry
->for_reclaim
= wbc
->for_reclaim
;
1496 __entry
->range_cyclic
= wbc
->range_cyclic
;
1497 __entry
->for_sync
= wbc
->for_sync
;
1500 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1501 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1502 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1503 show_dev_ino(__entry
),
1504 show_block_type(__entry
->type
),
1505 show_file_type(__entry
->dir
),
1506 __entry
->nr_to_write
,
1507 __entry
->pages_skipped
,
1508 __entry
->range_start
,
1510 (unsigned long)__entry
->writeback_index
,
1512 __entry
->for_kupdate
,
1513 __entry
->for_background
,
1514 __entry
->tagged_writepages
,
1515 __entry
->for_reclaim
,
1516 __entry
->range_cyclic
,
1520 TRACE_EVENT(f2fs_readpages
,
1522 TP_PROTO(struct inode
*inode
, pgoff_t start
, unsigned int nrpage
),
1524 TP_ARGS(inode
, start
, nrpage
),
1529 __field(pgoff_t
, start
)
1530 __field(unsigned int, nrpage
)
1534 __entry
->dev
= inode
->i_sb
->s_dev
;
1535 __entry
->ino
= inode
->i_ino
;
1536 __entry
->start
= start
;
1537 __entry
->nrpage
= nrpage
;
1540 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1541 show_dev_ino(__entry
),
1542 (unsigned long)__entry
->start
,
1546 TRACE_EVENT(f2fs_write_checkpoint
,
1548 TP_PROTO(struct super_block
*sb
, int reason
, const char *msg
),
1550 TP_ARGS(sb
, reason
, msg
),
1554 __field(int, reason
)
1555 __string(dest_msg
, msg
)
1559 __entry
->dev
= sb
->s_dev
;
1560 __entry
->reason
= reason
;
1561 __assign_str(dest_msg
);
1564 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1565 show_dev(__entry
->dev
),
1566 show_cpreason(__entry
->reason
),
1567 __get_str(dest_msg
))
1570 DECLARE_EVENT_CLASS(f2fs_discard
,
1572 TP_PROTO(struct block_device
*dev
, block_t blkstart
, block_t blklen
),
1574 TP_ARGS(dev
, blkstart
, blklen
),
1578 __field(block_t
, blkstart
)
1579 __field(block_t
, blklen
)
1583 __entry
->dev
= dev
->bd_dev
;
1584 __entry
->blkstart
= blkstart
;
1585 __entry
->blklen
= blklen
;
1588 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1589 show_dev(__entry
->dev
),
1590 (unsigned long long)__entry
->blkstart
,
1591 (unsigned long long)__entry
->blklen
)
1594 DEFINE_EVENT(f2fs_discard
, f2fs_queue_discard
,
1596 TP_PROTO(struct block_device
*dev
, block_t blkstart
, block_t blklen
),
1598 TP_ARGS(dev
, blkstart
, blklen
)
1601 DEFINE_EVENT(f2fs_discard
, f2fs_issue_discard
,
1603 TP_PROTO(struct block_device
*dev
, block_t blkstart
, block_t blklen
),
1605 TP_ARGS(dev
, blkstart
, blklen
)
1608 DEFINE_EVENT(f2fs_discard
, f2fs_remove_discard
,
1610 TP_PROTO(struct block_device
*dev
, block_t blkstart
, block_t blklen
),
1612 TP_ARGS(dev
, blkstart
, blklen
)
1615 DECLARE_EVENT_CLASS(f2fs_reset_zone
,
1617 TP_PROTO(struct block_device
*dev
, block_t blkstart
),
1619 TP_ARGS(dev
, blkstart
),
1623 __field(block_t
, blkstart
)
1627 __entry
->dev
= dev
->bd_dev
;
1628 __entry
->blkstart
= blkstart
;
1631 TP_printk("dev = (%d,%d), zone at block = 0x%llx",
1632 show_dev(__entry
->dev
),
1633 (unsigned long long)__entry
->blkstart
)
1636 DEFINE_EVENT(f2fs_reset_zone
, f2fs_queue_reset_zone
,
1638 TP_PROTO(struct block_device
*dev
, block_t blkstart
),
1640 TP_ARGS(dev
, blkstart
)
1643 DEFINE_EVENT(f2fs_reset_zone
, f2fs_issue_reset_zone
,
1645 TP_PROTO(struct block_device
*dev
, block_t blkstart
),
1647 TP_ARGS(dev
, blkstart
)
1650 TRACE_EVENT(f2fs_issue_flush
,
1652 TP_PROTO(struct block_device
*dev
, unsigned int nobarrier
,
1653 unsigned int flush_merge
, int ret
),
1655 TP_ARGS(dev
, nobarrier
, flush_merge
, ret
),
1659 __field(unsigned int, nobarrier
)
1660 __field(unsigned int, flush_merge
)
1665 __entry
->dev
= dev
->bd_dev
;
1666 __entry
->nobarrier
= nobarrier
;
1667 __entry
->flush_merge
= flush_merge
;
1671 TP_printk("dev = (%d,%d), %s %s, ret = %d",
1672 show_dev(__entry
->dev
),
1673 __entry
->nobarrier
? "skip (nobarrier)" : "issue",
1674 __entry
->flush_merge
? " with flush_merge" : "",
1678 TRACE_EVENT(f2fs_lookup_extent_tree_start
,
1680 TP_PROTO(struct inode
*inode
, unsigned int pgofs
, enum extent_type type
),
1682 TP_ARGS(inode
, pgofs
, type
),
1687 __field(unsigned int, pgofs
)
1688 __field(enum extent_type
, type
)
1692 __entry
->dev
= inode
->i_sb
->s_dev
;
1693 __entry
->ino
= inode
->i_ino
;
1694 __entry
->pgofs
= pgofs
;
1695 __entry
->type
= type
;
1698 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, type = %s",
1699 show_dev_ino(__entry
),
1701 show_extent_type(__entry
->type
))
1704 TRACE_EVENT_CONDITION(f2fs_lookup_read_extent_tree_end
,
1706 TP_PROTO(struct inode
*inode
, unsigned int pgofs
,
1707 struct extent_info
*ei
),
1709 TP_ARGS(inode
, pgofs
, ei
),
1716 __field(unsigned int, pgofs
)
1717 __field(unsigned int, fofs
)
1718 __field(unsigned int, len
)
1723 __entry
->dev
= inode
->i_sb
->s_dev
;
1724 __entry
->ino
= inode
->i_ino
;
1725 __entry
->pgofs
= pgofs
;
1726 __entry
->fofs
= ei
->fofs
;
1727 __entry
->len
= ei
->len
;
1728 __entry
->blk
= ei
->blk
;
1731 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1732 "read_ext_info(fofs: %u, len: %u, blk: %u)",
1733 show_dev_ino(__entry
),
1740 TRACE_EVENT_CONDITION(f2fs_lookup_age_extent_tree_end
,
1742 TP_PROTO(struct inode
*inode
, unsigned int pgofs
,
1743 struct extent_info
*ei
),
1745 TP_ARGS(inode
, pgofs
, ei
),
1752 __field(unsigned int, pgofs
)
1753 __field(unsigned int, fofs
)
1754 __field(unsigned int, len
)
1755 __field(unsigned long long, age
)
1756 __field(unsigned long long, blocks
)
1760 __entry
->dev
= inode
->i_sb
->s_dev
;
1761 __entry
->ino
= inode
->i_ino
;
1762 __entry
->pgofs
= pgofs
;
1763 __entry
->fofs
= ei
->fofs
;
1764 __entry
->len
= ei
->len
;
1765 __entry
->age
= ei
->age
;
1766 __entry
->blocks
= ei
->last_blocks
;
1769 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1770 "age_ext_info(fofs: %u, len: %u, age: %llu, blocks: %llu)",
1771 show_dev_ino(__entry
),
1779 TRACE_EVENT(f2fs_update_read_extent_tree_range
,
1781 TP_PROTO(struct inode
*inode
, unsigned int pgofs
, unsigned int len
,
1783 unsigned int c_len
),
1785 TP_ARGS(inode
, pgofs
, len
, blkaddr
, c_len
),
1790 __field(unsigned int, pgofs
)
1792 __field(unsigned int, len
)
1793 __field(unsigned int, c_len
)
1797 __entry
->dev
= inode
->i_sb
->s_dev
;
1798 __entry
->ino
= inode
->i_ino
;
1799 __entry
->pgofs
= pgofs
;
1801 __entry
->blk
= blkaddr
;
1802 __entry
->c_len
= c_len
;
1805 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1806 "len = %u, blkaddr = %u, c_len = %u",
1807 show_dev_ino(__entry
),
1814 TRACE_EVENT(f2fs_update_age_extent_tree_range
,
1816 TP_PROTO(struct inode
*inode
, unsigned int pgofs
, unsigned int len
,
1817 unsigned long long age
,
1818 unsigned long long last_blks
),
1820 TP_ARGS(inode
, pgofs
, len
, age
, last_blks
),
1825 __field(unsigned int, pgofs
)
1826 __field(unsigned int, len
)
1827 __field(unsigned long long, age
)
1828 __field(unsigned long long, blocks
)
1832 __entry
->dev
= inode
->i_sb
->s_dev
;
1833 __entry
->ino
= inode
->i_ino
;
1834 __entry
->pgofs
= pgofs
;
1837 __entry
->blocks
= last_blks
;
1840 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1841 "len = %u, age = %llu, blocks = %llu",
1842 show_dev_ino(__entry
),
1849 TRACE_EVENT(f2fs_shrink_extent_tree
,
1851 TP_PROTO(struct f2fs_sb_info
*sbi
, unsigned int node_cnt
,
1852 unsigned int tree_cnt
, enum extent_type type
),
1854 TP_ARGS(sbi
, node_cnt
, tree_cnt
, type
),
1858 __field(unsigned int, node_cnt
)
1859 __field(unsigned int, tree_cnt
)
1860 __field(enum extent_type
, type
)
1864 __entry
->dev
= sbi
->sb
->s_dev
;
1865 __entry
->node_cnt
= node_cnt
;
1866 __entry
->tree_cnt
= tree_cnt
;
1867 __entry
->type
= type
;
1870 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u, type = %s",
1871 show_dev(__entry
->dev
),
1874 show_extent_type(__entry
->type
))
1877 TRACE_EVENT(f2fs_destroy_extent_tree
,
1879 TP_PROTO(struct inode
*inode
, unsigned int node_cnt
,
1880 enum extent_type type
),
1882 TP_ARGS(inode
, node_cnt
, type
),
1887 __field(unsigned int, node_cnt
)
1888 __field(enum extent_type
, type
)
1892 __entry
->dev
= inode
->i_sb
->s_dev
;
1893 __entry
->ino
= inode
->i_ino
;
1894 __entry
->node_cnt
= node_cnt
;
1895 __entry
->type
= type
;
1898 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u, type = %s",
1899 show_dev_ino(__entry
),
1901 show_extent_type(__entry
->type
))
1904 DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes
,
1906 TP_PROTO(struct super_block
*sb
, int type
, s64 count
),
1908 TP_ARGS(sb
, type
, count
),
1917 __entry
->dev
= sb
->s_dev
;
1918 __entry
->type
= type
;
1919 __entry
->count
= count
;
1922 TP_printk("dev = (%d,%d), %s, dirty count = %lld",
1923 show_dev(__entry
->dev
),
1924 show_file_type(__entry
->type
),
1928 DEFINE_EVENT(f2fs_sync_dirty_inodes
, f2fs_sync_dirty_inodes_enter
,
1930 TP_PROTO(struct super_block
*sb
, int type
, s64 count
),
1932 TP_ARGS(sb
, type
, count
)
1935 DEFINE_EVENT(f2fs_sync_dirty_inodes
, f2fs_sync_dirty_inodes_exit
,
1937 TP_PROTO(struct super_block
*sb
, int type
, s64 count
),
1939 TP_ARGS(sb
, type
, count
)
1942 TRACE_EVENT(f2fs_shutdown
,
1944 TP_PROTO(struct f2fs_sb_info
*sbi
, unsigned int mode
, int ret
),
1946 TP_ARGS(sbi
, mode
, ret
),
1950 __field(unsigned int, mode
)
1955 __entry
->dev
= sbi
->sb
->s_dev
;
1956 __entry
->mode
= mode
;
1960 TP_printk("dev = (%d,%d), mode: %s, ret:%d",
1961 show_dev(__entry
->dev
),
1962 show_shutdown_mode(__entry
->mode
),
1966 DECLARE_EVENT_CLASS(f2fs_zip_start
,
1968 TP_PROTO(struct inode
*inode
, pgoff_t cluster_idx
,
1969 unsigned int cluster_size
, unsigned char algtype
),
1971 TP_ARGS(inode
, cluster_idx
, cluster_size
, algtype
),
1976 __field(pgoff_t
, idx
)
1977 __field(unsigned int, size
)
1978 __field(unsigned int, algtype
)
1982 __entry
->dev
= inode
->i_sb
->s_dev
;
1983 __entry
->ino
= inode
->i_ino
;
1984 __entry
->idx
= cluster_idx
;
1985 __entry
->size
= cluster_size
;
1986 __entry
->algtype
= algtype
;
1989 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
1990 "cluster_size = %u, algorithm = %s",
1991 show_dev_ino(__entry
),
1994 show_compress_algorithm(__entry
->algtype
))
1997 DECLARE_EVENT_CLASS(f2fs_zip_end
,
1999 TP_PROTO(struct inode
*inode
, pgoff_t cluster_idx
,
2000 unsigned int compressed_size
, int ret
),
2002 TP_ARGS(inode
, cluster_idx
, compressed_size
, ret
),
2007 __field(pgoff_t
, idx
)
2008 __field(unsigned int, size
)
2009 __field(unsigned int, ret
)
2013 __entry
->dev
= inode
->i_sb
->s_dev
;
2014 __entry
->ino
= inode
->i_ino
;
2015 __entry
->idx
= cluster_idx
;
2016 __entry
->size
= compressed_size
;
2020 TP_printk("dev = (%d,%d), ino = %lu, cluster_idx:%lu, "
2021 "compressed_size = %u, ret = %d",
2022 show_dev_ino(__entry
),
2028 DEFINE_EVENT(f2fs_zip_start
, f2fs_compress_pages_start
,
2030 TP_PROTO(struct inode
*inode
, pgoff_t cluster_idx
,
2031 unsigned int cluster_size
, unsigned char algtype
),
2033 TP_ARGS(inode
, cluster_idx
, cluster_size
, algtype
)
2036 DEFINE_EVENT(f2fs_zip_start
, f2fs_decompress_pages_start
,
2038 TP_PROTO(struct inode
*inode
, pgoff_t cluster_idx
,
2039 unsigned int cluster_size
, unsigned char algtype
),
2041 TP_ARGS(inode
, cluster_idx
, cluster_size
, algtype
)
2044 DEFINE_EVENT(f2fs_zip_end
, f2fs_compress_pages_end
,
2046 TP_PROTO(struct inode
*inode
, pgoff_t cluster_idx
,
2047 unsigned int compressed_size
, int ret
),
2049 TP_ARGS(inode
, cluster_idx
, compressed_size
, ret
)
2052 DEFINE_EVENT(f2fs_zip_end
, f2fs_decompress_pages_end
,
2054 TP_PROTO(struct inode
*inode
, pgoff_t cluster_idx
,
2055 unsigned int compressed_size
, int ret
),
2057 TP_ARGS(inode
, cluster_idx
, compressed_size
, ret
)
2060 #ifdef CONFIG_F2FS_IOSTAT
2061 TRACE_EVENT(f2fs_iostat
,
2063 TP_PROTO(struct f2fs_sb_info
*sbi
, unsigned long long *iostat
),
2065 TP_ARGS(sbi
, iostat
),
2069 __field(unsigned long long, app_dio
)
2070 __field(unsigned long long, app_bio
)
2071 __field(unsigned long long, app_wio
)
2072 __field(unsigned long long, app_mio
)
2073 __field(unsigned long long, app_bcdio
)
2074 __field(unsigned long long, app_mcdio
)
2075 __field(unsigned long long, fs_dio
)
2076 __field(unsigned long long, fs_cdio
)
2077 __field(unsigned long long, fs_nio
)
2078 __field(unsigned long long, fs_mio
)
2079 __field(unsigned long long, fs_gc_dio
)
2080 __field(unsigned long long, fs_gc_nio
)
2081 __field(unsigned long long, fs_cp_dio
)
2082 __field(unsigned long long, fs_cp_nio
)
2083 __field(unsigned long long, fs_cp_mio
)
2084 __field(unsigned long long, app_drio
)
2085 __field(unsigned long long, app_brio
)
2086 __field(unsigned long long, app_rio
)
2087 __field(unsigned long long, app_mrio
)
2088 __field(unsigned long long, app_bcrio
)
2089 __field(unsigned long long, app_mcrio
)
2090 __field(unsigned long long, fs_drio
)
2091 __field(unsigned long long, fs_gdrio
)
2092 __field(unsigned long long, fs_cdrio
)
2093 __field(unsigned long long, fs_nrio
)
2094 __field(unsigned long long, fs_mrio
)
2095 __field(unsigned long long, fs_discard
)
2096 __field(unsigned long long, fs_reset_zone
)
2100 __entry
->dev
= sbi
->sb
->s_dev
;
2101 __entry
->app_dio
= iostat
[APP_DIRECT_IO
];
2102 __entry
->app_bio
= iostat
[APP_BUFFERED_IO
];
2103 __entry
->app_wio
= iostat
[APP_WRITE_IO
];
2104 __entry
->app_mio
= iostat
[APP_MAPPED_IO
];
2105 __entry
->app_bcdio
= iostat
[APP_BUFFERED_CDATA_IO
];
2106 __entry
->app_mcdio
= iostat
[APP_MAPPED_CDATA_IO
];
2107 __entry
->fs_dio
= iostat
[FS_DATA_IO
];
2108 __entry
->fs_cdio
= iostat
[FS_CDATA_IO
];
2109 __entry
->fs_nio
= iostat
[FS_NODE_IO
];
2110 __entry
->fs_mio
= iostat
[FS_META_IO
];
2111 __entry
->fs_gc_dio
= iostat
[FS_GC_DATA_IO
];
2112 __entry
->fs_gc_nio
= iostat
[FS_GC_NODE_IO
];
2113 __entry
->fs_cp_dio
= iostat
[FS_CP_DATA_IO
];
2114 __entry
->fs_cp_nio
= iostat
[FS_CP_NODE_IO
];
2115 __entry
->fs_cp_mio
= iostat
[FS_CP_META_IO
];
2116 __entry
->app_drio
= iostat
[APP_DIRECT_READ_IO
];
2117 __entry
->app_brio
= iostat
[APP_BUFFERED_READ_IO
];
2118 __entry
->app_rio
= iostat
[APP_READ_IO
];
2119 __entry
->app_mrio
= iostat
[APP_MAPPED_READ_IO
];
2120 __entry
->app_bcrio
= iostat
[APP_BUFFERED_CDATA_READ_IO
];
2121 __entry
->app_mcrio
= iostat
[APP_MAPPED_CDATA_READ_IO
];
2122 __entry
->fs_drio
= iostat
[FS_DATA_READ_IO
];
2123 __entry
->fs_gdrio
= iostat
[FS_GDATA_READ_IO
];
2124 __entry
->fs_cdrio
= iostat
[FS_CDATA_READ_IO
];
2125 __entry
->fs_nrio
= iostat
[FS_NODE_READ_IO
];
2126 __entry
->fs_mrio
= iostat
[FS_META_READ_IO
];
2127 __entry
->fs_discard
= iostat
[FS_DISCARD_IO
];
2128 __entry
->fs_reset_zone
= iostat
[FS_ZONE_RESET_IO
];
2131 TP_printk("dev = (%d,%d), "
2132 "app [write=%llu (direct=%llu, buffered=%llu), mapped=%llu, "
2133 "compr(buffered=%llu, mapped=%llu)], "
2134 "fs [data=%llu, cdata=%llu, node=%llu, meta=%llu, discard=%llu, "
2135 "reset_zone=%llu], "
2136 "gc [data=%llu, node=%llu], "
2137 "cp [data=%llu, node=%llu, meta=%llu], "
2138 "app [read=%llu (direct=%llu, buffered=%llu), mapped=%llu], "
2139 "compr(buffered=%llu, mapped=%llu)], "
2140 "fs [data=%llu, (gc_data=%llu, cdata=%llu), "
2141 "node=%llu, meta=%llu]",
2142 show_dev(__entry
->dev
), __entry
->app_wio
, __entry
->app_dio
,
2143 __entry
->app_bio
, __entry
->app_mio
, __entry
->app_bcdio
,
2144 __entry
->app_mcdio
, __entry
->fs_dio
, __entry
->fs_cdio
,
2145 __entry
->fs_nio
, __entry
->fs_mio
, __entry
->fs_discard
,
2146 __entry
->fs_reset_zone
,
2147 __entry
->fs_gc_dio
, __entry
->fs_gc_nio
, __entry
->fs_cp_dio
,
2148 __entry
->fs_cp_nio
, __entry
->fs_cp_mio
,
2149 __entry
->app_rio
, __entry
->app_drio
, __entry
->app_brio
,
2150 __entry
->app_mrio
, __entry
->app_bcrio
, __entry
->app_mcrio
,
2151 __entry
->fs_drio
, __entry
->fs_gdrio
,
2152 __entry
->fs_cdrio
, __entry
->fs_nrio
, __entry
->fs_mrio
)
2155 #ifndef __F2FS_IOSTAT_LATENCY_TYPE
2156 #define __F2FS_IOSTAT_LATENCY_TYPE
2157 struct f2fs_iostat_latency
{
2158 unsigned int peak_lat
;
2159 unsigned int avg_lat
;
2162 #endif /* __F2FS_IOSTAT_LATENCY_TYPE */
2164 TRACE_EVENT(f2fs_iostat_latency
,
2166 TP_PROTO(struct f2fs_sb_info
*sbi
, struct f2fs_iostat_latency (*iostat_lat
)[NR_PAGE_TYPE
]),
2168 TP_ARGS(sbi
, iostat_lat
),
2172 __field(unsigned int, d_rd_peak
)
2173 __field(unsigned int, d_rd_avg
)
2174 __field(unsigned int, d_rd_cnt
)
2175 __field(unsigned int, n_rd_peak
)
2176 __field(unsigned int, n_rd_avg
)
2177 __field(unsigned int, n_rd_cnt
)
2178 __field(unsigned int, m_rd_peak
)
2179 __field(unsigned int, m_rd_avg
)
2180 __field(unsigned int, m_rd_cnt
)
2181 __field(unsigned int, d_wr_s_peak
)
2182 __field(unsigned int, d_wr_s_avg
)
2183 __field(unsigned int, d_wr_s_cnt
)
2184 __field(unsigned int, n_wr_s_peak
)
2185 __field(unsigned int, n_wr_s_avg
)
2186 __field(unsigned int, n_wr_s_cnt
)
2187 __field(unsigned int, m_wr_s_peak
)
2188 __field(unsigned int, m_wr_s_avg
)
2189 __field(unsigned int, m_wr_s_cnt
)
2190 __field(unsigned int, d_wr_as_peak
)
2191 __field(unsigned int, d_wr_as_avg
)
2192 __field(unsigned int, d_wr_as_cnt
)
2193 __field(unsigned int, n_wr_as_peak
)
2194 __field(unsigned int, n_wr_as_avg
)
2195 __field(unsigned int, n_wr_as_cnt
)
2196 __field(unsigned int, m_wr_as_peak
)
2197 __field(unsigned int, m_wr_as_avg
)
2198 __field(unsigned int, m_wr_as_cnt
)
2202 __entry
->dev
= sbi
->sb
->s_dev
;
2203 __entry
->d_rd_peak
= iostat_lat
[READ_IO
][DATA
].peak_lat
;
2204 __entry
->d_rd_avg
= iostat_lat
[READ_IO
][DATA
].avg_lat
;
2205 __entry
->d_rd_cnt
= iostat_lat
[READ_IO
][DATA
].cnt
;
2206 __entry
->n_rd_peak
= iostat_lat
[READ_IO
][NODE
].peak_lat
;
2207 __entry
->n_rd_avg
= iostat_lat
[READ_IO
][NODE
].avg_lat
;
2208 __entry
->n_rd_cnt
= iostat_lat
[READ_IO
][NODE
].cnt
;
2209 __entry
->m_rd_peak
= iostat_lat
[READ_IO
][META
].peak_lat
;
2210 __entry
->m_rd_avg
= iostat_lat
[READ_IO
][META
].avg_lat
;
2211 __entry
->m_rd_cnt
= iostat_lat
[READ_IO
][META
].cnt
;
2212 __entry
->d_wr_s_peak
= iostat_lat
[WRITE_SYNC_IO
][DATA
].peak_lat
;
2213 __entry
->d_wr_s_avg
= iostat_lat
[WRITE_SYNC_IO
][DATA
].avg_lat
;
2214 __entry
->d_wr_s_cnt
= iostat_lat
[WRITE_SYNC_IO
][DATA
].cnt
;
2215 __entry
->n_wr_s_peak
= iostat_lat
[WRITE_SYNC_IO
][NODE
].peak_lat
;
2216 __entry
->n_wr_s_avg
= iostat_lat
[WRITE_SYNC_IO
][NODE
].avg_lat
;
2217 __entry
->n_wr_s_cnt
= iostat_lat
[WRITE_SYNC_IO
][NODE
].cnt
;
2218 __entry
->m_wr_s_peak
= iostat_lat
[WRITE_SYNC_IO
][META
].peak_lat
;
2219 __entry
->m_wr_s_avg
= iostat_lat
[WRITE_SYNC_IO
][META
].avg_lat
;
2220 __entry
->m_wr_s_cnt
= iostat_lat
[WRITE_SYNC_IO
][META
].cnt
;
2221 __entry
->d_wr_as_peak
= iostat_lat
[WRITE_ASYNC_IO
][DATA
].peak_lat
;
2222 __entry
->d_wr_as_avg
= iostat_lat
[WRITE_ASYNC_IO
][DATA
].avg_lat
;
2223 __entry
->d_wr_as_cnt
= iostat_lat
[WRITE_ASYNC_IO
][DATA
].cnt
;
2224 __entry
->n_wr_as_peak
= iostat_lat
[WRITE_ASYNC_IO
][NODE
].peak_lat
;
2225 __entry
->n_wr_as_avg
= iostat_lat
[WRITE_ASYNC_IO
][NODE
].avg_lat
;
2226 __entry
->n_wr_as_cnt
= iostat_lat
[WRITE_ASYNC_IO
][NODE
].cnt
;
2227 __entry
->m_wr_as_peak
= iostat_lat
[WRITE_ASYNC_IO
][META
].peak_lat
;
2228 __entry
->m_wr_as_avg
= iostat_lat
[WRITE_ASYNC_IO
][META
].avg_lat
;
2229 __entry
->m_wr_as_cnt
= iostat_lat
[WRITE_ASYNC_IO
][META
].cnt
;
2232 TP_printk("dev = (%d,%d), "
2233 "iotype [peak lat.(ms)/avg lat.(ms)/count], "
2234 "rd_data [%u/%u/%u], rd_node [%u/%u/%u], rd_meta [%u/%u/%u], "
2235 "wr_sync_data [%u/%u/%u], wr_sync_node [%u/%u/%u], "
2236 "wr_sync_meta [%u/%u/%u], wr_async_data [%u/%u/%u], "
2237 "wr_async_node [%u/%u/%u], wr_async_meta [%u/%u/%u]",
2238 show_dev(__entry
->dev
),
2239 __entry
->d_rd_peak
, __entry
->d_rd_avg
, __entry
->d_rd_cnt
,
2240 __entry
->n_rd_peak
, __entry
->n_rd_avg
, __entry
->n_rd_cnt
,
2241 __entry
->m_rd_peak
, __entry
->m_rd_avg
, __entry
->m_rd_cnt
,
2242 __entry
->d_wr_s_peak
, __entry
->d_wr_s_avg
, __entry
->d_wr_s_cnt
,
2243 __entry
->n_wr_s_peak
, __entry
->n_wr_s_avg
, __entry
->n_wr_s_cnt
,
2244 __entry
->m_wr_s_peak
, __entry
->m_wr_s_avg
, __entry
->m_wr_s_cnt
,
2245 __entry
->d_wr_as_peak
, __entry
->d_wr_as_avg
, __entry
->d_wr_as_cnt
,
2246 __entry
->n_wr_as_peak
, __entry
->n_wr_as_avg
, __entry
->n_wr_as_cnt
,
2247 __entry
->m_wr_as_peak
, __entry
->m_wr_as_avg
, __entry
->m_wr_as_cnt
)
2251 TRACE_EVENT(f2fs_bmap
,
2253 TP_PROTO(struct inode
*inode
, sector_t lblock
, sector_t pblock
),
2255 TP_ARGS(inode
, lblock
, pblock
),
2260 __field(sector_t
, lblock
)
2261 __field(sector_t
, pblock
)
2265 __entry
->dev
= inode
->i_sb
->s_dev
;
2266 __entry
->ino
= inode
->i_ino
;
2267 __entry
->lblock
= lblock
;
2268 __entry
->pblock
= pblock
;
2271 TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld",
2272 show_dev_ino(__entry
),
2273 (unsigned long long)__entry
->lblock
,
2274 (unsigned long long)__entry
->pblock
)
2277 TRACE_EVENT(f2fs_fiemap
,
2279 TP_PROTO(struct inode
*inode
, sector_t lblock
, sector_t pblock
,
2280 unsigned long long len
, unsigned int flags
, int ret
),
2282 TP_ARGS(inode
, lblock
, pblock
, len
, flags
, ret
),
2287 __field(sector_t
, lblock
)
2288 __field(sector_t
, pblock
)
2289 __field(unsigned long long, len
)
2290 __field(unsigned int, flags
)
2295 __entry
->dev
= inode
->i_sb
->s_dev
;
2296 __entry
->ino
= inode
->i_ino
;
2297 __entry
->lblock
= lblock
;
2298 __entry
->pblock
= pblock
;
2300 __entry
->flags
= flags
;
2304 TP_printk("dev = (%d,%d), ino = %lu, lblock:%lld, pblock:%lld, "
2305 "len:%llu, flags:%u, ret:%d",
2306 show_dev_ino(__entry
),
2307 (unsigned long long)__entry
->lblock
,
2308 (unsigned long long)__entry
->pblock
,
2314 DECLARE_EVENT_CLASS(f2fs__rw_start
,
2316 TP_PROTO(struct inode
*inode
, loff_t offset
, int bytes
,
2317 pid_t pid
, char *pathname
, char *command
),
2319 TP_ARGS(inode
, offset
, bytes
, pid
, pathname
, command
),
2322 __string(pathbuf
, pathname
)
2323 __field(loff_t
, offset
)
2325 __field(loff_t
, i_size
)
2326 __string(cmdline
, command
)
2333 * Replace the spaces in filenames and cmdlines
2334 * because this screws up the tooling that parses
2337 __assign_str(pathbuf
);
2338 (void)strreplace(__get_str(pathbuf
), ' ', '_');
2339 __entry
->offset
= offset
;
2340 __entry
->bytes
= bytes
;
2341 __entry
->i_size
= i_size_read(inode
);
2342 __assign_str(cmdline
);
2343 (void)strreplace(__get_str(cmdline
), ' ', '_');
2345 __entry
->ino
= inode
->i_ino
;
2348 TP_printk("entry_name %s, offset %llu, bytes %d, cmdline %s,"
2349 " pid %d, i_size %llu, ino %lu",
2350 __get_str(pathbuf
), __entry
->offset
, __entry
->bytes
,
2351 __get_str(cmdline
), __entry
->pid
, __entry
->i_size
,
2352 (unsigned long) __entry
->ino
)
2355 DECLARE_EVENT_CLASS(f2fs__rw_end
,
2357 TP_PROTO(struct inode
*inode
, loff_t offset
, int bytes
),
2359 TP_ARGS(inode
, offset
, bytes
),
2363 __field(loff_t
, offset
)
2368 __entry
->ino
= inode
->i_ino
;
2369 __entry
->offset
= offset
;
2370 __entry
->bytes
= bytes
;
2373 TP_printk("ino %lu, offset %llu, bytes %d",
2374 (unsigned long) __entry
->ino
,
2375 __entry
->offset
, __entry
->bytes
)
2378 DEFINE_EVENT(f2fs__rw_start
, f2fs_dataread_start
,
2380 TP_PROTO(struct inode
*inode
, loff_t offset
, int bytes
,
2381 pid_t pid
, char *pathname
, char *command
),
2383 TP_ARGS(inode
, offset
, bytes
, pid
, pathname
, command
)
2386 DEFINE_EVENT(f2fs__rw_end
, f2fs_dataread_end
,
2388 TP_PROTO(struct inode
*inode
, loff_t offset
, int bytes
),
2390 TP_ARGS(inode
, offset
, bytes
)
2393 DEFINE_EVENT(f2fs__rw_start
, f2fs_datawrite_start
,
2395 TP_PROTO(struct inode
*inode
, loff_t offset
, int bytes
,
2396 pid_t pid
, char *pathname
, char *command
),
2398 TP_ARGS(inode
, offset
, bytes
, pid
, pathname
, command
)
2401 DEFINE_EVENT(f2fs__rw_end
, f2fs_datawrite_end
,
2403 TP_PROTO(struct inode
*inode
, loff_t offset
, int bytes
),
2405 TP_ARGS(inode
, offset
, bytes
)
2408 #endif /* _TRACE_F2FS_H */
2410 /* This part must be outside protection */
2411 #include <trace/define_trace.h>