2 #define TRACE_SYSTEM f2fs
4 #if !defined(_TRACE_F2FS_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/tracepoint.h>
9 #define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev)
10 #define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino
12 TRACE_DEFINE_ENUM(NODE
);
13 TRACE_DEFINE_ENUM(DATA
);
14 TRACE_DEFINE_ENUM(META
);
15 TRACE_DEFINE_ENUM(META_FLUSH
);
16 TRACE_DEFINE_ENUM(INMEM
);
17 TRACE_DEFINE_ENUM(INMEM_DROP
);
18 TRACE_DEFINE_ENUM(IPU
);
19 TRACE_DEFINE_ENUM(OPU
);
20 TRACE_DEFINE_ENUM(CURSEG_HOT_DATA
);
21 TRACE_DEFINE_ENUM(CURSEG_WARM_DATA
);
22 TRACE_DEFINE_ENUM(CURSEG_COLD_DATA
);
23 TRACE_DEFINE_ENUM(CURSEG_HOT_NODE
);
24 TRACE_DEFINE_ENUM(CURSEG_WARM_NODE
);
25 TRACE_DEFINE_ENUM(CURSEG_COLD_NODE
);
26 TRACE_DEFINE_ENUM(NO_CHECK_TYPE
);
27 TRACE_DEFINE_ENUM(GC_GREEDY
);
28 TRACE_DEFINE_ENUM(GC_CB
);
29 TRACE_DEFINE_ENUM(FG_GC
);
30 TRACE_DEFINE_ENUM(BG_GC
);
31 TRACE_DEFINE_ENUM(LFS
);
32 TRACE_DEFINE_ENUM(SSR
);
33 TRACE_DEFINE_ENUM(__REQ_RAHEAD
);
34 TRACE_DEFINE_ENUM(__REQ_WRITE
);
35 TRACE_DEFINE_ENUM(__REQ_SYNC
);
36 TRACE_DEFINE_ENUM(__REQ_NOIDLE
);
37 TRACE_DEFINE_ENUM(__REQ_FLUSH
);
38 TRACE_DEFINE_ENUM(__REQ_FUA
);
39 TRACE_DEFINE_ENUM(__REQ_PRIO
);
40 TRACE_DEFINE_ENUM(__REQ_META
);
41 TRACE_DEFINE_ENUM(CP_UMOUNT
);
42 TRACE_DEFINE_ENUM(CP_FASTBOOT
);
43 TRACE_DEFINE_ENUM(CP_SYNC
);
44 TRACE_DEFINE_ENUM(CP_RECOVERY
);
45 TRACE_DEFINE_ENUM(CP_DISCARD
);
47 #define show_block_type(type) \
48 __print_symbolic(type, \
52 { META_FLUSH, "META_FLUSH" }, \
54 { INMEM_DROP, "INMEM_DROP" }, \
55 { IPU, "IN-PLACE" }, \
56 { OPU, "OUT-OF-PLACE" })
58 #define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA))
59 #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
61 #define show_bio_type(type) show_bio_base(type), show_bio_extra(type)
63 #define show_bio_base(type) \
64 __print_symbolic(F2FS_BIO_MASK(type), \
66 { READA, "READAHEAD" }, \
67 { READ_SYNC, "READ_SYNC" }, \
69 { WRITE_SYNC, "WRITE_SYNC" }, \
70 { WRITE_FLUSH, "WRITE_FLUSH" }, \
71 { WRITE_FUA, "WRITE_FUA" }, \
72 { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
74 #define show_bio_extra(type) \
75 __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \
76 { REQ_META, "(M)" }, \
77 { REQ_PRIO, "(P)" }, \
78 { REQ_META | REQ_PRIO, "(MP)" }, \
81 #define show_data_type(type) \
82 __print_symbolic(type, \
83 { CURSEG_HOT_DATA, "Hot DATA" }, \
84 { CURSEG_WARM_DATA, "Warm DATA" }, \
85 { CURSEG_COLD_DATA, "Cold DATA" }, \
86 { CURSEG_HOT_NODE, "Hot NODE" }, \
87 { CURSEG_WARM_NODE, "Warm NODE" }, \
88 { CURSEG_COLD_NODE, "Cold NODE" }, \
89 { NO_CHECK_TYPE, "No TYPE" })
91 #define show_file_type(type) \
92 __print_symbolic(type, \
96 #define show_gc_type(type) \
97 __print_symbolic(type, \
98 { FG_GC, "Foreground GC" }, \
99 { BG_GC, "Background GC" })
101 #define show_alloc_mode(type) \
102 __print_symbolic(type, \
103 { LFS, "LFS-mode" }, \
106 #define show_victim_policy(type) \
107 __print_symbolic(type, \
108 { GC_GREEDY, "Greedy" }, \
109 { GC_CB, "Cost-Benefit" })
111 #define show_cpreason(type) \
112 __print_symbolic(type, \
113 { CP_UMOUNT, "Umount" }, \
114 { CP_FASTBOOT, "Fastboot" }, \
115 { CP_SYNC, "Sync" }, \
116 { CP_RECOVERY, "Recovery" }, \
117 { CP_DISCARD, "Discard" })
119 struct victim_sel_policy
;
120 struct f2fs_map_blocks
;
122 DECLARE_EVENT_CLASS(f2fs__inode
,
124 TP_PROTO(struct inode
*inode
),
132 __field(umode_t
, mode
)
133 __field(loff_t
, size
)
134 __field(unsigned int, nlink
)
135 __field(blkcnt_t
, blocks
)
136 __field(__u8
, advise
)
140 __entry
->dev
= inode
->i_sb
->s_dev
;
141 __entry
->ino
= inode
->i_ino
;
142 __entry
->pino
= F2FS_I(inode
)->i_pino
;
143 __entry
->mode
= inode
->i_mode
;
144 __entry
->nlink
= inode
->i_nlink
;
145 __entry
->size
= inode
->i_size
;
146 __entry
->blocks
= inode
->i_blocks
;
147 __entry
->advise
= F2FS_I(inode
)->i_advise
;
150 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
151 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
152 show_dev_ino(__entry
),
153 (unsigned long)__entry
->pino
,
156 (unsigned int)__entry
->nlink
,
157 (unsigned long long)__entry
->blocks
,
158 (unsigned char)__entry
->advise
)
161 DECLARE_EVENT_CLASS(f2fs__inode_exit
,
163 TP_PROTO(struct inode
*inode
, int ret
),
174 __entry
->dev
= inode
->i_sb
->s_dev
;
175 __entry
->ino
= inode
->i_ino
;
179 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
180 show_dev_ino(__entry
),
184 DEFINE_EVENT(f2fs__inode
, f2fs_sync_file_enter
,
186 TP_PROTO(struct inode
*inode
),
191 TRACE_EVENT(f2fs_sync_file_exit
,
193 TP_PROTO(struct inode
*inode
, int need_cp
, int datasync
, int ret
),
195 TP_ARGS(inode
, need_cp
, datasync
, ret
),
200 __field(int, need_cp
)
201 __field(int, datasync
)
206 __entry
->dev
= inode
->i_sb
->s_dev
;
207 __entry
->ino
= inode
->i_ino
;
208 __entry
->need_cp
= need_cp
;
209 __entry
->datasync
= datasync
;
213 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
214 "datasync = %d, ret = %d",
215 show_dev_ino(__entry
),
216 __entry
->need_cp
? "needed" : "not needed",
221 TRACE_EVENT(f2fs_sync_fs
,
223 TP_PROTO(struct super_block
*sb
, int wait
),
234 __entry
->dev
= sb
->s_dev
;
235 __entry
->dirty
= is_sbi_flag_set(F2FS_SB(sb
), SBI_IS_DIRTY
);
236 __entry
->wait
= wait
;
239 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
241 __entry
->dirty
? "dirty" : "not dirty",
245 DEFINE_EVENT(f2fs__inode
, f2fs_iget
,
247 TP_PROTO(struct inode
*inode
),
252 DEFINE_EVENT(f2fs__inode_exit
, f2fs_iget_exit
,
254 TP_PROTO(struct inode
*inode
, int ret
),
259 DEFINE_EVENT(f2fs__inode
, f2fs_evict_inode
,
261 TP_PROTO(struct inode
*inode
),
266 DEFINE_EVENT(f2fs__inode_exit
, f2fs_new_inode
,
268 TP_PROTO(struct inode
*inode
, int ret
),
273 TRACE_EVENT(f2fs_unlink_enter
,
275 TP_PROTO(struct inode
*dir
, struct dentry
*dentry
),
277 TP_ARGS(dir
, dentry
),
282 __field(loff_t
, size
)
283 __field(blkcnt_t
, blocks
)
284 __field(const char *, name
)
288 __entry
->dev
= dir
->i_sb
->s_dev
;
289 __entry
->ino
= dir
->i_ino
;
290 __entry
->size
= dir
->i_size
;
291 __entry
->blocks
= dir
->i_blocks
;
292 __entry
->name
= dentry
->d_name
.name
;
295 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
296 "i_blocks = %llu, name = %s",
297 show_dev_ino(__entry
),
299 (unsigned long long)__entry
->blocks
,
303 DEFINE_EVENT(f2fs__inode_exit
, f2fs_unlink_exit
,
305 TP_PROTO(struct inode
*inode
, int ret
),
310 DEFINE_EVENT(f2fs__inode
, f2fs_truncate
,
312 TP_PROTO(struct inode
*inode
),
317 TRACE_EVENT(f2fs_truncate_data_blocks_range
,
319 TP_PROTO(struct inode
*inode
, nid_t nid
, unsigned int ofs
, int free
),
321 TP_ARGS(inode
, nid
, ofs
, free
),
327 __field(unsigned int, ofs
)
332 __entry
->dev
= inode
->i_sb
->s_dev
;
333 __entry
->ino
= inode
->i_ino
;
336 __entry
->free
= free
;
339 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
340 show_dev_ino(__entry
),
341 (unsigned int)__entry
->nid
,
346 DECLARE_EVENT_CLASS(f2fs__truncate_op
,
348 TP_PROTO(struct inode
*inode
, u64 from
),
350 TP_ARGS(inode
, from
),
355 __field(loff_t
, size
)
356 __field(blkcnt_t
, blocks
)
361 __entry
->dev
= inode
->i_sb
->s_dev
;
362 __entry
->ino
= inode
->i_ino
;
363 __entry
->size
= inode
->i_size
;
364 __entry
->blocks
= inode
->i_blocks
;
365 __entry
->from
= from
;
368 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
369 "start file offset = %llu",
370 show_dev_ino(__entry
),
372 (unsigned long long)__entry
->blocks
,
373 (unsigned long long)__entry
->from
)
376 DEFINE_EVENT(f2fs__truncate_op
, f2fs_truncate_blocks_enter
,
378 TP_PROTO(struct inode
*inode
, u64 from
),
383 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_blocks_exit
,
385 TP_PROTO(struct inode
*inode
, int ret
),
390 DEFINE_EVENT(f2fs__truncate_op
, f2fs_truncate_inode_blocks_enter
,
392 TP_PROTO(struct inode
*inode
, u64 from
),
397 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_inode_blocks_exit
,
399 TP_PROTO(struct inode
*inode
, int ret
),
404 DECLARE_EVENT_CLASS(f2fs__truncate_node
,
406 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
408 TP_ARGS(inode
, nid
, blk_addr
),
414 __field(block_t
, blk_addr
)
418 __entry
->dev
= inode
->i_sb
->s_dev
;
419 __entry
->ino
= inode
->i_ino
;
421 __entry
->blk_addr
= blk_addr
;
424 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
425 show_dev_ino(__entry
),
426 (unsigned int)__entry
->nid
,
427 (unsigned long long)__entry
->blk_addr
)
430 DEFINE_EVENT(f2fs__truncate_node
, f2fs_truncate_nodes_enter
,
432 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
434 TP_ARGS(inode
, nid
, blk_addr
)
437 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_nodes_exit
,
439 TP_PROTO(struct inode
*inode
, int ret
),
444 DEFINE_EVENT(f2fs__truncate_node
, f2fs_truncate_node
,
446 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
448 TP_ARGS(inode
, nid
, blk_addr
)
451 TRACE_EVENT(f2fs_truncate_partial_nodes
,
453 TP_PROTO(struct inode
*inode
, nid_t nid
[], int depth
, int err
),
455 TP_ARGS(inode
, nid
, depth
, err
),
460 __field(nid_t
, nid
[3])
466 __entry
->dev
= inode
->i_sb
->s_dev
;
467 __entry
->ino
= inode
->i_ino
;
468 __entry
->nid
[0] = nid
[0];
469 __entry
->nid
[1] = nid
[1];
470 __entry
->nid
[2] = nid
[2];
471 __entry
->depth
= depth
;
475 TP_printk("dev = (%d,%d), ino = %lu, "
476 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
477 show_dev_ino(__entry
),
478 (unsigned int)__entry
->nid
[0],
479 (unsigned int)__entry
->nid
[1],
480 (unsigned int)__entry
->nid
[2],
485 TRACE_EVENT(f2fs_map_blocks
,
486 TP_PROTO(struct inode
*inode
, struct f2fs_map_blocks
*map
, int ret
),
488 TP_ARGS(inode
, map
, ret
),
493 __field(block_t
, m_lblk
)
494 __field(block_t
, m_pblk
)
495 __field(unsigned int, m_len
)
500 __entry
->dev
= inode
->i_sb
->s_dev
;
501 __entry
->ino
= inode
->i_ino
;
502 __entry
->m_lblk
= map
->m_lblk
;
503 __entry
->m_pblk
= map
->m_pblk
;
504 __entry
->m_len
= map
->m_len
;
508 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
509 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
510 show_dev_ino(__entry
),
511 (unsigned long long)__entry
->m_lblk
,
512 (unsigned long long)__entry
->m_pblk
,
513 (unsigned long long)__entry
->m_len
,
517 TRACE_EVENT(f2fs_background_gc
,
519 TP_PROTO(struct super_block
*sb
, long wait_ms
,
520 unsigned int prefree
, unsigned int free
),
522 TP_ARGS(sb
, wait_ms
, prefree
, free
),
526 __field(long, wait_ms
)
527 __field(unsigned int, prefree
)
528 __field(unsigned int, free
)
532 __entry
->dev
= sb
->s_dev
;
533 __entry
->wait_ms
= wait_ms
;
534 __entry
->prefree
= prefree
;
535 __entry
->free
= free
;
538 TP_printk("dev = (%d,%d), wait_ms = %ld, prefree = %u, free = %u",
545 TRACE_EVENT(f2fs_get_victim
,
547 TP_PROTO(struct super_block
*sb
, int type
, int gc_type
,
548 struct victim_sel_policy
*p
, unsigned int pre_victim
,
549 unsigned int prefree
, unsigned int free
),
551 TP_ARGS(sb
, type
, gc_type
, p
, pre_victim
, prefree
, free
),
556 __field(int, gc_type
)
557 __field(int, alloc_mode
)
558 __field(int, gc_mode
)
559 __field(unsigned int, victim
)
560 __field(unsigned int, ofs_unit
)
561 __field(unsigned int, pre_victim
)
562 __field(unsigned int, prefree
)
563 __field(unsigned int, free
)
567 __entry
->dev
= sb
->s_dev
;
568 __entry
->type
= type
;
569 __entry
->gc_type
= gc_type
;
570 __entry
->alloc_mode
= p
->alloc_mode
;
571 __entry
->gc_mode
= p
->gc_mode
;
572 __entry
->victim
= p
->min_segno
;
573 __entry
->ofs_unit
= p
->ofs_unit
;
574 __entry
->pre_victim
= pre_victim
;
575 __entry
->prefree
= prefree
;
576 __entry
->free
= free
;
579 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u "
580 "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u",
582 show_data_type(__entry
->type
),
583 show_gc_type(__entry
->gc_type
),
584 show_alloc_mode(__entry
->alloc_mode
),
585 show_victim_policy(__entry
->gc_mode
),
588 (int)__entry
->pre_victim
,
593 TRACE_EVENT(f2fs_fallocate
,
595 TP_PROTO(struct inode
*inode
, int mode
,
596 loff_t offset
, loff_t len
, int ret
),
598 TP_ARGS(inode
, mode
, offset
, len
, ret
),
604 __field(loff_t
, offset
)
606 __field(loff_t
, size
)
607 __field(blkcnt_t
, blocks
)
612 __entry
->dev
= inode
->i_sb
->s_dev
;
613 __entry
->ino
= inode
->i_ino
;
614 __entry
->mode
= mode
;
615 __entry
->offset
= offset
;
617 __entry
->size
= inode
->i_size
;
618 __entry
->blocks
= inode
->i_blocks
;
622 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
623 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
624 show_dev_ino(__entry
),
626 (unsigned long long)__entry
->offset
,
627 (unsigned long long)__entry
->len
,
628 (unsigned long long)__entry
->size
,
629 (unsigned long long)__entry
->blocks
,
633 TRACE_EVENT(f2fs_direct_IO_enter
,
635 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
, int rw
),
637 TP_ARGS(inode
, offset
, len
, rw
),
643 __field(unsigned long, len
)
648 __entry
->dev
= inode
->i_sb
->s_dev
;
649 __entry
->ino
= inode
->i_ino
;
650 __entry
->pos
= offset
;
655 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
656 show_dev_ino(__entry
),
662 TRACE_EVENT(f2fs_direct_IO_exit
,
664 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
,
667 TP_ARGS(inode
, offset
, len
, rw
, ret
),
673 __field(unsigned long, len
)
679 __entry
->dev
= inode
->i_sb
->s_dev
;
680 __entry
->ino
= inode
->i_ino
;
681 __entry
->pos
= offset
;
687 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
689 show_dev_ino(__entry
),
696 TRACE_EVENT(f2fs_reserve_new_block
,
698 TP_PROTO(struct inode
*inode
, nid_t nid
, unsigned int ofs_in_node
),
700 TP_ARGS(inode
, nid
, ofs_in_node
),
705 __field(unsigned int, ofs_in_node
)
709 __entry
->dev
= inode
->i_sb
->s_dev
;
711 __entry
->ofs_in_node
= ofs_in_node
;
714 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u",
716 (unsigned int)__entry
->nid
,
717 __entry
->ofs_in_node
)
720 DECLARE_EVENT_CLASS(f2fs__submit_page_bio
,
722 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
729 __field(pgoff_t
, index
)
730 __field(block_t
, blkaddr
)
736 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
737 __entry
->ino
= page
->mapping
->host
->i_ino
;
738 __entry
->index
= page
->index
;
739 __entry
->blkaddr
= fio
->blk_addr
;
740 __entry
->rw
= fio
->rw
;
741 __entry
->type
= fio
->type
;
744 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
745 "blkaddr = 0x%llx, rw = %s%s, type = %s",
746 show_dev_ino(__entry
),
747 (unsigned long)__entry
->index
,
748 (unsigned long long)__entry
->blkaddr
,
749 show_bio_type(__entry
->rw
),
750 show_block_type(__entry
->type
))
753 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio
, f2fs_submit_page_bio
,
755 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
759 TP_CONDITION(page
->mapping
)
762 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio
, f2fs_submit_page_mbio
,
764 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
768 TP_CONDITION(page
->mapping
)
771 DECLARE_EVENT_CLASS(f2fs__submit_bio
,
773 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
776 TP_ARGS(sb
, fio
, bio
),
782 __field(sector_t
, sector
)
783 __field(unsigned int, size
)
787 __entry
->dev
= sb
->s_dev
;
788 __entry
->rw
= fio
->rw
;
789 __entry
->type
= fio
->type
;
790 __entry
->sector
= bio
->bi_iter
.bi_sector
;
791 __entry
->size
= bio
->bi_iter
.bi_size
;
794 TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u",
796 show_bio_type(__entry
->rw
),
797 show_block_type(__entry
->type
),
798 (unsigned long long)__entry
->sector
,
802 DEFINE_EVENT_CONDITION(f2fs__submit_bio
, f2fs_submit_write_bio
,
804 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
807 TP_ARGS(sb
, fio
, bio
),
812 DEFINE_EVENT_CONDITION(f2fs__submit_bio
, f2fs_submit_read_bio
,
814 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
817 TP_ARGS(sb
, fio
, bio
),
822 TRACE_EVENT(f2fs_write_begin
,
824 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
827 TP_ARGS(inode
, pos
, len
, flags
),
833 __field(unsigned int, len
)
834 __field(unsigned int, flags
)
838 __entry
->dev
= inode
->i_sb
->s_dev
;
839 __entry
->ino
= inode
->i_ino
;
842 __entry
->flags
= flags
;
845 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
846 show_dev_ino(__entry
),
847 (unsigned long long)__entry
->pos
,
852 TRACE_EVENT(f2fs_write_end
,
854 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
855 unsigned int copied
),
857 TP_ARGS(inode
, pos
, len
, copied
),
863 __field(unsigned int, len
)
864 __field(unsigned int, copied
)
868 __entry
->dev
= inode
->i_sb
->s_dev
;
869 __entry
->ino
= inode
->i_ino
;
872 __entry
->copied
= copied
;
875 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
876 show_dev_ino(__entry
),
877 (unsigned long long)__entry
->pos
,
882 DECLARE_EVENT_CLASS(f2fs__page
,
884 TP_PROTO(struct page
*page
, int type
),
893 __field(pgoff_t
, index
)
895 __field(int, uptodate
)
899 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
900 __entry
->ino
= page
->mapping
->host
->i_ino
;
901 __entry
->type
= type
;
902 __entry
->dir
= S_ISDIR(page
->mapping
->host
->i_mode
);
903 __entry
->index
= page
->index
;
904 __entry
->dirty
= PageDirty(page
);
905 __entry
->uptodate
= PageUptodate(page
);
908 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
909 "dirty = %d, uptodate = %d",
910 show_dev_ino(__entry
),
911 show_block_type(__entry
->type
),
912 show_file_type(__entry
->dir
),
913 (unsigned long)__entry
->index
,
918 DEFINE_EVENT(f2fs__page
, f2fs_writepage
,
920 TP_PROTO(struct page
*page
, int type
),
925 DEFINE_EVENT(f2fs__page
, f2fs_do_write_data_page
,
927 TP_PROTO(struct page
*page
, int type
),
932 DEFINE_EVENT(f2fs__page
, f2fs_readpage
,
934 TP_PROTO(struct page
*page
, int type
),
939 DEFINE_EVENT(f2fs__page
, f2fs_set_page_dirty
,
941 TP_PROTO(struct page
*page
, int type
),
946 DEFINE_EVENT(f2fs__page
, f2fs_vm_page_mkwrite
,
948 TP_PROTO(struct page
*page
, int type
),
953 DEFINE_EVENT(f2fs__page
, f2fs_register_inmem_page
,
955 TP_PROTO(struct page
*page
, int type
),
960 DEFINE_EVENT(f2fs__page
, f2fs_commit_inmem_page
,
962 TP_PROTO(struct page
*page
, int type
),
967 TRACE_EVENT(f2fs_writepages
,
969 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
, int type
),
971 TP_ARGS(inode
, wbc
, type
),
978 __field(long, nr_to_write
)
979 __field(long, pages_skipped
)
980 __field(loff_t
, range_start
)
981 __field(loff_t
, range_end
)
982 __field(pgoff_t
, writeback_index
)
983 __field(int, sync_mode
)
984 __field(char, for_kupdate
)
985 __field(char, for_background
)
986 __field(char, tagged_writepages
)
987 __field(char, for_reclaim
)
988 __field(char, range_cyclic
)
989 __field(char, for_sync
)
993 __entry
->dev
= inode
->i_sb
->s_dev
;
994 __entry
->ino
= inode
->i_ino
;
995 __entry
->type
= type
;
996 __entry
->dir
= S_ISDIR(inode
->i_mode
);
997 __entry
->nr_to_write
= wbc
->nr_to_write
;
998 __entry
->pages_skipped
= wbc
->pages_skipped
;
999 __entry
->range_start
= wbc
->range_start
;
1000 __entry
->range_end
= wbc
->range_end
;
1001 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
1002 __entry
->sync_mode
= wbc
->sync_mode
;
1003 __entry
->for_kupdate
= wbc
->for_kupdate
;
1004 __entry
->for_background
= wbc
->for_background
;
1005 __entry
->tagged_writepages
= wbc
->tagged_writepages
;
1006 __entry
->for_reclaim
= wbc
->for_reclaim
;
1007 __entry
->range_cyclic
= wbc
->range_cyclic
;
1008 __entry
->for_sync
= wbc
->for_sync
;
1011 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1012 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1013 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1014 show_dev_ino(__entry
),
1015 show_block_type(__entry
->type
),
1016 show_file_type(__entry
->dir
),
1017 __entry
->nr_to_write
,
1018 __entry
->pages_skipped
,
1019 __entry
->range_start
,
1021 (unsigned long)__entry
->writeback_index
,
1023 __entry
->for_kupdate
,
1024 __entry
->for_background
,
1025 __entry
->tagged_writepages
,
1026 __entry
->for_reclaim
,
1027 __entry
->range_cyclic
,
1031 TRACE_EVENT(f2fs_readpages
,
1033 TP_PROTO(struct inode
*inode
, struct page
*page
, unsigned int nrpage
),
1035 TP_ARGS(inode
, page
, nrpage
),
1040 __field(pgoff_t
, start
)
1041 __field(unsigned int, nrpage
)
1045 __entry
->dev
= inode
->i_sb
->s_dev
;
1046 __entry
->ino
= inode
->i_ino
;
1047 __entry
->start
= page
->index
;
1048 __entry
->nrpage
= nrpage
;
1051 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1052 show_dev_ino(__entry
),
1053 (unsigned long)__entry
->start
,
1057 TRACE_EVENT(f2fs_write_checkpoint
,
1059 TP_PROTO(struct super_block
*sb
, int reason
, char *msg
),
1061 TP_ARGS(sb
, reason
, msg
),
1065 __field(int, reason
)
1066 __field(char *, msg
)
1070 __entry
->dev
= sb
->s_dev
;
1071 __entry
->reason
= reason
;
1075 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1077 show_cpreason(__entry
->reason
),
1081 TRACE_EVENT(f2fs_issue_discard
,
1083 TP_PROTO(struct super_block
*sb
, block_t blkstart
, block_t blklen
),
1085 TP_ARGS(sb
, blkstart
, blklen
),
1089 __field(block_t
, blkstart
)
1090 __field(block_t
, blklen
)
1094 __entry
->dev
= sb
->s_dev
;
1095 __entry
->blkstart
= blkstart
;
1096 __entry
->blklen
= blklen
;
1099 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1101 (unsigned long long)__entry
->blkstart
,
1102 (unsigned long long)__entry
->blklen
)
1105 TRACE_EVENT(f2fs_issue_flush
,
1107 TP_PROTO(struct super_block
*sb
, unsigned int nobarrier
,
1108 unsigned int flush_merge
),
1110 TP_ARGS(sb
, nobarrier
, flush_merge
),
1114 __field(unsigned int, nobarrier
)
1115 __field(unsigned int, flush_merge
)
1119 __entry
->dev
= sb
->s_dev
;
1120 __entry
->nobarrier
= nobarrier
;
1121 __entry
->flush_merge
= flush_merge
;
1124 TP_printk("dev = (%d,%d), %s %s",
1126 __entry
->nobarrier
? "skip (nobarrier)" : "issue",
1127 __entry
->flush_merge
? " with flush_merge" : "")
1130 TRACE_EVENT(f2fs_lookup_extent_tree_start
,
1132 TP_PROTO(struct inode
*inode
, unsigned int pgofs
),
1134 TP_ARGS(inode
, pgofs
),
1139 __field(unsigned int, pgofs
)
1143 __entry
->dev
= inode
->i_sb
->s_dev
;
1144 __entry
->ino
= inode
->i_ino
;
1145 __entry
->pgofs
= pgofs
;
1148 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1149 show_dev_ino(__entry
),
1153 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end
,
1155 TP_PROTO(struct inode
*inode
, unsigned int pgofs
,
1156 struct extent_info
*ei
),
1158 TP_ARGS(inode
, pgofs
, ei
),
1165 __field(unsigned int, pgofs
)
1166 __field(unsigned int, fofs
)
1168 __field(unsigned int, len
)
1172 __entry
->dev
= inode
->i_sb
->s_dev
;
1173 __entry
->ino
= inode
->i_ino
;
1174 __entry
->pgofs
= pgofs
;
1175 __entry
->fofs
= ei
->fofs
;
1176 __entry
->blk
= ei
->blk
;
1177 __entry
->len
= ei
->len
;
1180 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1181 "ext_info(fofs: %u, blk: %u, len: %u)",
1182 show_dev_ino(__entry
),
1189 TRACE_EVENT(f2fs_update_extent_tree_range
,
1191 TP_PROTO(struct inode
*inode
, unsigned int pgofs
, block_t blkaddr
,
1194 TP_ARGS(inode
, pgofs
, blkaddr
, len
),
1199 __field(unsigned int, pgofs
)
1201 __field(unsigned int, len
)
1205 __entry
->dev
= inode
->i_sb
->s_dev
;
1206 __entry
->ino
= inode
->i_ino
;
1207 __entry
->pgofs
= pgofs
;
1208 __entry
->blk
= blkaddr
;
1212 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1213 "blkaddr = %u, len = %u",
1214 show_dev_ino(__entry
),
1220 TRACE_EVENT(f2fs_shrink_extent_tree
,
1222 TP_PROTO(struct f2fs_sb_info
*sbi
, unsigned int node_cnt
,
1223 unsigned int tree_cnt
),
1225 TP_ARGS(sbi
, node_cnt
, tree_cnt
),
1229 __field(unsigned int, node_cnt
)
1230 __field(unsigned int, tree_cnt
)
1234 __entry
->dev
= sbi
->sb
->s_dev
;
1235 __entry
->node_cnt
= node_cnt
;
1236 __entry
->tree_cnt
= tree_cnt
;
1239 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1245 TRACE_EVENT(f2fs_destroy_extent_tree
,
1247 TP_PROTO(struct inode
*inode
, unsigned int node_cnt
),
1249 TP_ARGS(inode
, node_cnt
),
1254 __field(unsigned int, node_cnt
)
1258 __entry
->dev
= inode
->i_sb
->s_dev
;
1259 __entry
->ino
= inode
->i_ino
;
1260 __entry
->node_cnt
= node_cnt
;
1263 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1264 show_dev_ino(__entry
),
1268 #endif /* _TRACE_F2FS_H */
1270 /* This part must be outside protection */
1271 #include <trace/define_trace.h>