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 { INMEM_REVOKE, "INMEM_REVOKE" }, \
56 { IPU, "IN-PLACE" }, \
57 { OPU, "OUT-OF-PLACE" })
59 #define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA))
60 #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
62 #define show_bio_type(type) show_bio_base(type), show_bio_extra(type)
64 #define show_bio_base(type) \
65 __print_symbolic(F2FS_BIO_MASK(type), \
67 { READA, "READAHEAD" }, \
68 { READ_SYNC, "READ_SYNC" }, \
70 { WRITE_SYNC, "WRITE_SYNC" }, \
71 { WRITE_FLUSH, "WRITE_FLUSH" }, \
72 { WRITE_FUA, "WRITE_FUA" }, \
73 { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
75 #define show_bio_extra(type) \
76 __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \
77 { REQ_META, "(M)" }, \
78 { REQ_PRIO, "(P)" }, \
79 { REQ_META | REQ_PRIO, "(MP)" }, \
82 #define show_data_type(type) \
83 __print_symbolic(type, \
84 { CURSEG_HOT_DATA, "Hot DATA" }, \
85 { CURSEG_WARM_DATA, "Warm DATA" }, \
86 { CURSEG_COLD_DATA, "Cold DATA" }, \
87 { CURSEG_HOT_NODE, "Hot NODE" }, \
88 { CURSEG_WARM_NODE, "Warm NODE" }, \
89 { CURSEG_COLD_NODE, "Cold NODE" }, \
90 { NO_CHECK_TYPE, "No TYPE" })
92 #define show_file_type(type) \
93 __print_symbolic(type, \
97 #define show_gc_type(type) \
98 __print_symbolic(type, \
99 { FG_GC, "Foreground GC" }, \
100 { BG_GC, "Background GC" })
102 #define show_alloc_mode(type) \
103 __print_symbolic(type, \
104 { LFS, "LFS-mode" }, \
107 #define show_victim_policy(type) \
108 __print_symbolic(type, \
109 { GC_GREEDY, "Greedy" }, \
110 { GC_CB, "Cost-Benefit" })
112 #define show_cpreason(type) \
113 __print_symbolic(type, \
114 { CP_UMOUNT, "Umount" }, \
115 { CP_FASTBOOT, "Fastboot" }, \
116 { CP_SYNC, "Sync" }, \
117 { CP_RECOVERY, "Recovery" }, \
118 { CP_DISCARD, "Discard" })
120 struct victim_sel_policy
;
121 struct f2fs_map_blocks
;
123 DECLARE_EVENT_CLASS(f2fs__inode
,
125 TP_PROTO(struct inode
*inode
),
133 __field(umode_t
, mode
)
134 __field(loff_t
, size
)
135 __field(unsigned int, nlink
)
136 __field(blkcnt_t
, blocks
)
137 __field(__u8
, advise
)
141 __entry
->dev
= inode
->i_sb
->s_dev
;
142 __entry
->ino
= inode
->i_ino
;
143 __entry
->pino
= F2FS_I(inode
)->i_pino
;
144 __entry
->mode
= inode
->i_mode
;
145 __entry
->nlink
= inode
->i_nlink
;
146 __entry
->size
= inode
->i_size
;
147 __entry
->blocks
= inode
->i_blocks
;
148 __entry
->advise
= F2FS_I(inode
)->i_advise
;
151 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
152 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
153 show_dev_ino(__entry
),
154 (unsigned long)__entry
->pino
,
157 (unsigned int)__entry
->nlink
,
158 (unsigned long long)__entry
->blocks
,
159 (unsigned char)__entry
->advise
)
162 DECLARE_EVENT_CLASS(f2fs__inode_exit
,
164 TP_PROTO(struct inode
*inode
, int ret
),
175 __entry
->dev
= inode
->i_sb
->s_dev
;
176 __entry
->ino
= inode
->i_ino
;
180 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
181 show_dev_ino(__entry
),
185 DEFINE_EVENT(f2fs__inode
, f2fs_sync_file_enter
,
187 TP_PROTO(struct inode
*inode
),
192 TRACE_EVENT(f2fs_sync_file_exit
,
194 TP_PROTO(struct inode
*inode
, int need_cp
, int datasync
, int ret
),
196 TP_ARGS(inode
, need_cp
, datasync
, ret
),
201 __field(int, need_cp
)
202 __field(int, datasync
)
207 __entry
->dev
= inode
->i_sb
->s_dev
;
208 __entry
->ino
= inode
->i_ino
;
209 __entry
->need_cp
= need_cp
;
210 __entry
->datasync
= datasync
;
214 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
215 "datasync = %d, ret = %d",
216 show_dev_ino(__entry
),
217 __entry
->need_cp
? "needed" : "not needed",
222 TRACE_EVENT(f2fs_sync_fs
,
224 TP_PROTO(struct super_block
*sb
, int wait
),
235 __entry
->dev
= sb
->s_dev
;
236 __entry
->dirty
= is_sbi_flag_set(F2FS_SB(sb
), SBI_IS_DIRTY
);
237 __entry
->wait
= wait
;
240 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
242 __entry
->dirty
? "dirty" : "not dirty",
246 DEFINE_EVENT(f2fs__inode
, f2fs_iget
,
248 TP_PROTO(struct inode
*inode
),
253 DEFINE_EVENT(f2fs__inode_exit
, f2fs_iget_exit
,
255 TP_PROTO(struct inode
*inode
, int ret
),
260 DEFINE_EVENT(f2fs__inode
, f2fs_evict_inode
,
262 TP_PROTO(struct inode
*inode
),
267 DEFINE_EVENT(f2fs__inode_exit
, f2fs_new_inode
,
269 TP_PROTO(struct inode
*inode
, int ret
),
274 TRACE_EVENT(f2fs_unlink_enter
,
276 TP_PROTO(struct inode
*dir
, struct dentry
*dentry
),
278 TP_ARGS(dir
, dentry
),
283 __field(loff_t
, size
)
284 __field(blkcnt_t
, blocks
)
285 __field(const char *, name
)
289 __entry
->dev
= dir
->i_sb
->s_dev
;
290 __entry
->ino
= dir
->i_ino
;
291 __entry
->size
= dir
->i_size
;
292 __entry
->blocks
= dir
->i_blocks
;
293 __entry
->name
= dentry
->d_name
.name
;
296 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
297 "i_blocks = %llu, name = %s",
298 show_dev_ino(__entry
),
300 (unsigned long long)__entry
->blocks
,
304 DEFINE_EVENT(f2fs__inode_exit
, f2fs_unlink_exit
,
306 TP_PROTO(struct inode
*inode
, int ret
),
311 DEFINE_EVENT(f2fs__inode
, f2fs_truncate
,
313 TP_PROTO(struct inode
*inode
),
318 TRACE_EVENT(f2fs_truncate_data_blocks_range
,
320 TP_PROTO(struct inode
*inode
, nid_t nid
, unsigned int ofs
, int free
),
322 TP_ARGS(inode
, nid
, ofs
, free
),
328 __field(unsigned int, ofs
)
333 __entry
->dev
= inode
->i_sb
->s_dev
;
334 __entry
->ino
= inode
->i_ino
;
337 __entry
->free
= free
;
340 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
341 show_dev_ino(__entry
),
342 (unsigned int)__entry
->nid
,
347 DECLARE_EVENT_CLASS(f2fs__truncate_op
,
349 TP_PROTO(struct inode
*inode
, u64 from
),
351 TP_ARGS(inode
, from
),
356 __field(loff_t
, size
)
357 __field(blkcnt_t
, blocks
)
362 __entry
->dev
= inode
->i_sb
->s_dev
;
363 __entry
->ino
= inode
->i_ino
;
364 __entry
->size
= inode
->i_size
;
365 __entry
->blocks
= inode
->i_blocks
;
366 __entry
->from
= from
;
369 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
370 "start file offset = %llu",
371 show_dev_ino(__entry
),
373 (unsigned long long)__entry
->blocks
,
374 (unsigned long long)__entry
->from
)
377 DEFINE_EVENT(f2fs__truncate_op
, f2fs_truncate_blocks_enter
,
379 TP_PROTO(struct inode
*inode
, u64 from
),
384 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_blocks_exit
,
386 TP_PROTO(struct inode
*inode
, int ret
),
391 DEFINE_EVENT(f2fs__truncate_op
, f2fs_truncate_inode_blocks_enter
,
393 TP_PROTO(struct inode
*inode
, u64 from
),
398 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_inode_blocks_exit
,
400 TP_PROTO(struct inode
*inode
, int ret
),
405 DECLARE_EVENT_CLASS(f2fs__truncate_node
,
407 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
409 TP_ARGS(inode
, nid
, blk_addr
),
415 __field(block_t
, blk_addr
)
419 __entry
->dev
= inode
->i_sb
->s_dev
;
420 __entry
->ino
= inode
->i_ino
;
422 __entry
->blk_addr
= blk_addr
;
425 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
426 show_dev_ino(__entry
),
427 (unsigned int)__entry
->nid
,
428 (unsigned long long)__entry
->blk_addr
)
431 DEFINE_EVENT(f2fs__truncate_node
, f2fs_truncate_nodes_enter
,
433 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
435 TP_ARGS(inode
, nid
, blk_addr
)
438 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_nodes_exit
,
440 TP_PROTO(struct inode
*inode
, int ret
),
445 DEFINE_EVENT(f2fs__truncate_node
, f2fs_truncate_node
,
447 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
449 TP_ARGS(inode
, nid
, blk_addr
)
452 TRACE_EVENT(f2fs_truncate_partial_nodes
,
454 TP_PROTO(struct inode
*inode
, nid_t nid
[], int depth
, int err
),
456 TP_ARGS(inode
, nid
, depth
, err
),
461 __field(nid_t
, nid
[3])
467 __entry
->dev
= inode
->i_sb
->s_dev
;
468 __entry
->ino
= inode
->i_ino
;
469 __entry
->nid
[0] = nid
[0];
470 __entry
->nid
[1] = nid
[1];
471 __entry
->nid
[2] = nid
[2];
472 __entry
->depth
= depth
;
476 TP_printk("dev = (%d,%d), ino = %lu, "
477 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
478 show_dev_ino(__entry
),
479 (unsigned int)__entry
->nid
[0],
480 (unsigned int)__entry
->nid
[1],
481 (unsigned int)__entry
->nid
[2],
486 TRACE_EVENT(f2fs_map_blocks
,
487 TP_PROTO(struct inode
*inode
, struct f2fs_map_blocks
*map
, int ret
),
489 TP_ARGS(inode
, map
, ret
),
494 __field(block_t
, m_lblk
)
495 __field(block_t
, m_pblk
)
496 __field(unsigned int, m_len
)
501 __entry
->dev
= inode
->i_sb
->s_dev
;
502 __entry
->ino
= inode
->i_ino
;
503 __entry
->m_lblk
= map
->m_lblk
;
504 __entry
->m_pblk
= map
->m_pblk
;
505 __entry
->m_len
= map
->m_len
;
509 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
510 "start blkaddr = 0x%llx, len = 0x%llx, err = %d",
511 show_dev_ino(__entry
),
512 (unsigned long long)__entry
->m_lblk
,
513 (unsigned long long)__entry
->m_pblk
,
514 (unsigned long long)__entry
->m_len
,
518 TRACE_EVENT(f2fs_background_gc
,
520 TP_PROTO(struct super_block
*sb
, long wait_ms
,
521 unsigned int prefree
, unsigned int free
),
523 TP_ARGS(sb
, wait_ms
, prefree
, free
),
527 __field(long, wait_ms
)
528 __field(unsigned int, prefree
)
529 __field(unsigned int, free
)
533 __entry
->dev
= sb
->s_dev
;
534 __entry
->wait_ms
= wait_ms
;
535 __entry
->prefree
= prefree
;
536 __entry
->free
= free
;
539 TP_printk("dev = (%d,%d), wait_ms = %ld, prefree = %u, free = %u",
546 TRACE_EVENT(f2fs_get_victim
,
548 TP_PROTO(struct super_block
*sb
, int type
, int gc_type
,
549 struct victim_sel_policy
*p
, unsigned int pre_victim
,
550 unsigned int prefree
, unsigned int free
),
552 TP_ARGS(sb
, type
, gc_type
, p
, pre_victim
, prefree
, free
),
557 __field(int, gc_type
)
558 __field(int, alloc_mode
)
559 __field(int, gc_mode
)
560 __field(unsigned int, victim
)
561 __field(unsigned int, ofs_unit
)
562 __field(unsigned int, pre_victim
)
563 __field(unsigned int, prefree
)
564 __field(unsigned int, free
)
568 __entry
->dev
= sb
->s_dev
;
569 __entry
->type
= type
;
570 __entry
->gc_type
= gc_type
;
571 __entry
->alloc_mode
= p
->alloc_mode
;
572 __entry
->gc_mode
= p
->gc_mode
;
573 __entry
->victim
= p
->min_segno
;
574 __entry
->ofs_unit
= p
->ofs_unit
;
575 __entry
->pre_victim
= pre_victim
;
576 __entry
->prefree
= prefree
;
577 __entry
->free
= free
;
580 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u "
581 "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u",
583 show_data_type(__entry
->type
),
584 show_gc_type(__entry
->gc_type
),
585 show_alloc_mode(__entry
->alloc_mode
),
586 show_victim_policy(__entry
->gc_mode
),
589 (int)__entry
->pre_victim
,
594 TRACE_EVENT(f2fs_fallocate
,
596 TP_PROTO(struct inode
*inode
, int mode
,
597 loff_t offset
, loff_t len
, int ret
),
599 TP_ARGS(inode
, mode
, offset
, len
, ret
),
605 __field(loff_t
, offset
)
607 __field(loff_t
, size
)
608 __field(blkcnt_t
, blocks
)
613 __entry
->dev
= inode
->i_sb
->s_dev
;
614 __entry
->ino
= inode
->i_ino
;
615 __entry
->mode
= mode
;
616 __entry
->offset
= offset
;
618 __entry
->size
= inode
->i_size
;
619 __entry
->blocks
= inode
->i_blocks
;
623 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
624 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
625 show_dev_ino(__entry
),
627 (unsigned long long)__entry
->offset
,
628 (unsigned long long)__entry
->len
,
629 (unsigned long long)__entry
->size
,
630 (unsigned long long)__entry
->blocks
,
634 TRACE_EVENT(f2fs_direct_IO_enter
,
636 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
, int rw
),
638 TP_ARGS(inode
, offset
, len
, rw
),
644 __field(unsigned long, len
)
649 __entry
->dev
= inode
->i_sb
->s_dev
;
650 __entry
->ino
= inode
->i_ino
;
651 __entry
->pos
= offset
;
656 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
657 show_dev_ino(__entry
),
663 TRACE_EVENT(f2fs_direct_IO_exit
,
665 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
,
668 TP_ARGS(inode
, offset
, len
, rw
, ret
),
674 __field(unsigned long, len
)
680 __entry
->dev
= inode
->i_sb
->s_dev
;
681 __entry
->ino
= inode
->i_ino
;
682 __entry
->pos
= offset
;
688 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
690 show_dev_ino(__entry
),
697 TRACE_EVENT(f2fs_reserve_new_block
,
699 TP_PROTO(struct inode
*inode
, nid_t nid
, unsigned int ofs_in_node
),
701 TP_ARGS(inode
, nid
, ofs_in_node
),
706 __field(unsigned int, ofs_in_node
)
710 __entry
->dev
= inode
->i_sb
->s_dev
;
712 __entry
->ofs_in_node
= ofs_in_node
;
715 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u",
717 (unsigned int)__entry
->nid
,
718 __entry
->ofs_in_node
)
721 DECLARE_EVENT_CLASS(f2fs__submit_page_bio
,
723 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
730 __field(pgoff_t
, index
)
731 __field(block_t
, old_blkaddr
)
732 __field(block_t
, new_blkaddr
)
738 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
739 __entry
->ino
= page
->mapping
->host
->i_ino
;
740 __entry
->index
= page
->index
;
741 __entry
->old_blkaddr
= fio
->old_blkaddr
;
742 __entry
->new_blkaddr
= fio
->new_blkaddr
;
743 __entry
->rw
= fio
->rw
;
744 __entry
->type
= fio
->type
;
747 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
748 "oldaddr = 0x%llx, newaddr = 0x%llx rw = %s%s, type = %s",
749 show_dev_ino(__entry
),
750 (unsigned long)__entry
->index
,
751 (unsigned long long)__entry
->old_blkaddr
,
752 (unsigned long long)__entry
->new_blkaddr
,
753 show_bio_type(__entry
->rw
),
754 show_block_type(__entry
->type
))
757 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio
, f2fs_submit_page_bio
,
759 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
763 TP_CONDITION(page
->mapping
)
766 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio
, f2fs_submit_page_mbio
,
768 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
772 TP_CONDITION(page
->mapping
)
775 DECLARE_EVENT_CLASS(f2fs__submit_bio
,
777 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
780 TP_ARGS(sb
, fio
, bio
),
786 __field(sector_t
, sector
)
787 __field(unsigned int, size
)
791 __entry
->dev
= sb
->s_dev
;
792 __entry
->rw
= fio
->rw
;
793 __entry
->type
= fio
->type
;
794 __entry
->sector
= bio
->bi_iter
.bi_sector
;
795 __entry
->size
= bio
->bi_iter
.bi_size
;
798 TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u",
800 show_bio_type(__entry
->rw
),
801 show_block_type(__entry
->type
),
802 (unsigned long long)__entry
->sector
,
806 DEFINE_EVENT_CONDITION(f2fs__submit_bio
, f2fs_submit_write_bio
,
808 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
811 TP_ARGS(sb
, fio
, bio
),
816 DEFINE_EVENT_CONDITION(f2fs__submit_bio
, f2fs_submit_read_bio
,
818 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
821 TP_ARGS(sb
, fio
, bio
),
826 TRACE_EVENT(f2fs_write_begin
,
828 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
831 TP_ARGS(inode
, pos
, len
, flags
),
837 __field(unsigned int, len
)
838 __field(unsigned int, flags
)
842 __entry
->dev
= inode
->i_sb
->s_dev
;
843 __entry
->ino
= inode
->i_ino
;
846 __entry
->flags
= flags
;
849 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
850 show_dev_ino(__entry
),
851 (unsigned long long)__entry
->pos
,
856 TRACE_EVENT(f2fs_write_end
,
858 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
859 unsigned int copied
),
861 TP_ARGS(inode
, pos
, len
, copied
),
867 __field(unsigned int, len
)
868 __field(unsigned int, copied
)
872 __entry
->dev
= inode
->i_sb
->s_dev
;
873 __entry
->ino
= inode
->i_ino
;
876 __entry
->copied
= copied
;
879 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
880 show_dev_ino(__entry
),
881 (unsigned long long)__entry
->pos
,
886 DECLARE_EVENT_CLASS(f2fs__page
,
888 TP_PROTO(struct page
*page
, int type
),
897 __field(pgoff_t
, index
)
899 __field(int, uptodate
)
903 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
904 __entry
->ino
= page
->mapping
->host
->i_ino
;
905 __entry
->type
= type
;
906 __entry
->dir
= S_ISDIR(page
->mapping
->host
->i_mode
);
907 __entry
->index
= page
->index
;
908 __entry
->dirty
= PageDirty(page
);
909 __entry
->uptodate
= PageUptodate(page
);
912 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
913 "dirty = %d, uptodate = %d",
914 show_dev_ino(__entry
),
915 show_block_type(__entry
->type
),
916 show_file_type(__entry
->dir
),
917 (unsigned long)__entry
->index
,
922 DEFINE_EVENT(f2fs__page
, f2fs_writepage
,
924 TP_PROTO(struct page
*page
, int type
),
929 DEFINE_EVENT(f2fs__page
, f2fs_do_write_data_page
,
931 TP_PROTO(struct page
*page
, int type
),
936 DEFINE_EVENT(f2fs__page
, f2fs_readpage
,
938 TP_PROTO(struct page
*page
, int type
),
943 DEFINE_EVENT(f2fs__page
, f2fs_set_page_dirty
,
945 TP_PROTO(struct page
*page
, int type
),
950 DEFINE_EVENT(f2fs__page
, f2fs_vm_page_mkwrite
,
952 TP_PROTO(struct page
*page
, int type
),
957 DEFINE_EVENT(f2fs__page
, f2fs_register_inmem_page
,
959 TP_PROTO(struct page
*page
, int type
),
964 DEFINE_EVENT(f2fs__page
, f2fs_commit_inmem_page
,
966 TP_PROTO(struct page
*page
, int type
),
971 TRACE_EVENT(f2fs_writepages
,
973 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
, int type
),
975 TP_ARGS(inode
, wbc
, type
),
982 __field(long, nr_to_write
)
983 __field(long, pages_skipped
)
984 __field(loff_t
, range_start
)
985 __field(loff_t
, range_end
)
986 __field(pgoff_t
, writeback_index
)
987 __field(int, sync_mode
)
988 __field(char, for_kupdate
)
989 __field(char, for_background
)
990 __field(char, tagged_writepages
)
991 __field(char, for_reclaim
)
992 __field(char, range_cyclic
)
993 __field(char, for_sync
)
997 __entry
->dev
= inode
->i_sb
->s_dev
;
998 __entry
->ino
= inode
->i_ino
;
999 __entry
->type
= type
;
1000 __entry
->dir
= S_ISDIR(inode
->i_mode
);
1001 __entry
->nr_to_write
= wbc
->nr_to_write
;
1002 __entry
->pages_skipped
= wbc
->pages_skipped
;
1003 __entry
->range_start
= wbc
->range_start
;
1004 __entry
->range_end
= wbc
->range_end
;
1005 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
1006 __entry
->sync_mode
= wbc
->sync_mode
;
1007 __entry
->for_kupdate
= wbc
->for_kupdate
;
1008 __entry
->for_background
= wbc
->for_background
;
1009 __entry
->tagged_writepages
= wbc
->tagged_writepages
;
1010 __entry
->for_reclaim
= wbc
->for_reclaim
;
1011 __entry
->range_cyclic
= wbc
->range_cyclic
;
1012 __entry
->for_sync
= wbc
->for_sync
;
1015 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
1016 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
1017 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
1018 show_dev_ino(__entry
),
1019 show_block_type(__entry
->type
),
1020 show_file_type(__entry
->dir
),
1021 __entry
->nr_to_write
,
1022 __entry
->pages_skipped
,
1023 __entry
->range_start
,
1025 (unsigned long)__entry
->writeback_index
,
1027 __entry
->for_kupdate
,
1028 __entry
->for_background
,
1029 __entry
->tagged_writepages
,
1030 __entry
->for_reclaim
,
1031 __entry
->range_cyclic
,
1035 TRACE_EVENT(f2fs_readpages
,
1037 TP_PROTO(struct inode
*inode
, struct page
*page
, unsigned int nrpage
),
1039 TP_ARGS(inode
, page
, nrpage
),
1044 __field(pgoff_t
, start
)
1045 __field(unsigned int, nrpage
)
1049 __entry
->dev
= inode
->i_sb
->s_dev
;
1050 __entry
->ino
= inode
->i_ino
;
1051 __entry
->start
= page
->index
;
1052 __entry
->nrpage
= nrpage
;
1055 TP_printk("dev = (%d,%d), ino = %lu, start = %lu nrpage = %u",
1056 show_dev_ino(__entry
),
1057 (unsigned long)__entry
->start
,
1061 TRACE_EVENT(f2fs_write_checkpoint
,
1063 TP_PROTO(struct super_block
*sb
, int reason
, char *msg
),
1065 TP_ARGS(sb
, reason
, msg
),
1069 __field(int, reason
)
1070 __field(char *, msg
)
1074 __entry
->dev
= sb
->s_dev
;
1075 __entry
->reason
= reason
;
1079 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1081 show_cpreason(__entry
->reason
),
1085 TRACE_EVENT(f2fs_issue_discard
,
1087 TP_PROTO(struct super_block
*sb
, block_t blkstart
, block_t blklen
),
1089 TP_ARGS(sb
, blkstart
, blklen
),
1093 __field(block_t
, blkstart
)
1094 __field(block_t
, blklen
)
1098 __entry
->dev
= sb
->s_dev
;
1099 __entry
->blkstart
= blkstart
;
1100 __entry
->blklen
= blklen
;
1103 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1105 (unsigned long long)__entry
->blkstart
,
1106 (unsigned long long)__entry
->blklen
)
1109 TRACE_EVENT(f2fs_issue_flush
,
1111 TP_PROTO(struct super_block
*sb
, unsigned int nobarrier
,
1112 unsigned int flush_merge
),
1114 TP_ARGS(sb
, nobarrier
, flush_merge
),
1118 __field(unsigned int, nobarrier
)
1119 __field(unsigned int, flush_merge
)
1123 __entry
->dev
= sb
->s_dev
;
1124 __entry
->nobarrier
= nobarrier
;
1125 __entry
->flush_merge
= flush_merge
;
1128 TP_printk("dev = (%d,%d), %s %s",
1130 __entry
->nobarrier
? "skip (nobarrier)" : "issue",
1131 __entry
->flush_merge
? " with flush_merge" : "")
1134 TRACE_EVENT(f2fs_lookup_extent_tree_start
,
1136 TP_PROTO(struct inode
*inode
, unsigned int pgofs
),
1138 TP_ARGS(inode
, pgofs
),
1143 __field(unsigned int, pgofs
)
1147 __entry
->dev
= inode
->i_sb
->s_dev
;
1148 __entry
->ino
= inode
->i_ino
;
1149 __entry
->pgofs
= pgofs
;
1152 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1153 show_dev_ino(__entry
),
1157 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end
,
1159 TP_PROTO(struct inode
*inode
, unsigned int pgofs
,
1160 struct extent_info
*ei
),
1162 TP_ARGS(inode
, pgofs
, ei
),
1169 __field(unsigned int, pgofs
)
1170 __field(unsigned int, fofs
)
1172 __field(unsigned int, len
)
1176 __entry
->dev
= inode
->i_sb
->s_dev
;
1177 __entry
->ino
= inode
->i_ino
;
1178 __entry
->pgofs
= pgofs
;
1179 __entry
->fofs
= ei
->fofs
;
1180 __entry
->blk
= ei
->blk
;
1181 __entry
->len
= ei
->len
;
1184 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1185 "ext_info(fofs: %u, blk: %u, len: %u)",
1186 show_dev_ino(__entry
),
1193 TRACE_EVENT(f2fs_update_extent_tree_range
,
1195 TP_PROTO(struct inode
*inode
, unsigned int pgofs
, block_t blkaddr
,
1198 TP_ARGS(inode
, pgofs
, blkaddr
, len
),
1203 __field(unsigned int, pgofs
)
1205 __field(unsigned int, len
)
1209 __entry
->dev
= inode
->i_sb
->s_dev
;
1210 __entry
->ino
= inode
->i_ino
;
1211 __entry
->pgofs
= pgofs
;
1212 __entry
->blk
= blkaddr
;
1216 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1217 "blkaddr = %u, len = %u",
1218 show_dev_ino(__entry
),
1224 TRACE_EVENT(f2fs_shrink_extent_tree
,
1226 TP_PROTO(struct f2fs_sb_info
*sbi
, unsigned int node_cnt
,
1227 unsigned int tree_cnt
),
1229 TP_ARGS(sbi
, node_cnt
, tree_cnt
),
1233 __field(unsigned int, node_cnt
)
1234 __field(unsigned int, tree_cnt
)
1238 __entry
->dev
= sbi
->sb
->s_dev
;
1239 __entry
->node_cnt
= node_cnt
;
1240 __entry
->tree_cnt
= tree_cnt
;
1243 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1249 TRACE_EVENT(f2fs_destroy_extent_tree
,
1251 TP_PROTO(struct inode
*inode
, unsigned int node_cnt
),
1253 TP_ARGS(inode
, node_cnt
),
1258 __field(unsigned int, node_cnt
)
1262 __entry
->dev
= inode
->i_sb
->s_dev
;
1263 __entry
->ino
= inode
->i_ino
;
1264 __entry
->node_cnt
= node_cnt
;
1267 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1268 show_dev_ino(__entry
),
1272 DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes
,
1274 TP_PROTO(struct super_block
*sb
, int type
, int count
),
1276 TP_ARGS(sb
, type
, count
),
1285 __entry
->dev
= sb
->s_dev
;
1286 __entry
->type
= type
;
1287 __entry
->count
= count
;
1290 TP_printk("dev = (%d,%d), %s, dirty count = %d",
1292 show_file_type(__entry
->type
),
1296 DEFINE_EVENT(f2fs_sync_dirty_inodes
, f2fs_sync_dirty_inodes_enter
,
1298 TP_PROTO(struct super_block
*sb
, int type
, int count
),
1300 TP_ARGS(sb
, type
, count
)
1303 DEFINE_EVENT(f2fs_sync_dirty_inodes
, f2fs_sync_dirty_inodes_exit
,
1305 TP_PROTO(struct super_block
*sb
, int type
, int count
),
1307 TP_ARGS(sb
, type
, count
)
1310 #endif /* _TRACE_F2FS_H */
1312 /* This part must be outside protection */
1313 #include <trace/define_trace.h>