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(CURSEG_HOT_DATA
);
17 TRACE_DEFINE_ENUM(CURSEG_WARM_DATA
);
18 TRACE_DEFINE_ENUM(CURSEG_COLD_DATA
);
19 TRACE_DEFINE_ENUM(CURSEG_HOT_NODE
);
20 TRACE_DEFINE_ENUM(CURSEG_WARM_NODE
);
21 TRACE_DEFINE_ENUM(CURSEG_COLD_NODE
);
22 TRACE_DEFINE_ENUM(NO_CHECK_TYPE
);
23 TRACE_DEFINE_ENUM(GC_GREEDY
);
24 TRACE_DEFINE_ENUM(GC_CB
);
25 TRACE_DEFINE_ENUM(FG_GC
);
26 TRACE_DEFINE_ENUM(BG_GC
);
27 TRACE_DEFINE_ENUM(LFS
);
28 TRACE_DEFINE_ENUM(SSR
);
29 TRACE_DEFINE_ENUM(__REQ_RAHEAD
);
30 TRACE_DEFINE_ENUM(__REQ_WRITE
);
31 TRACE_DEFINE_ENUM(__REQ_SYNC
);
32 TRACE_DEFINE_ENUM(__REQ_NOIDLE
);
33 TRACE_DEFINE_ENUM(__REQ_FLUSH
);
34 TRACE_DEFINE_ENUM(__REQ_FUA
);
35 TRACE_DEFINE_ENUM(__REQ_PRIO
);
36 TRACE_DEFINE_ENUM(__REQ_META
);
37 TRACE_DEFINE_ENUM(CP_UMOUNT
);
38 TRACE_DEFINE_ENUM(CP_FASTBOOT
);
39 TRACE_DEFINE_ENUM(CP_SYNC
);
40 TRACE_DEFINE_ENUM(CP_DISCARD
);
42 #define show_block_type(type) \
43 __print_symbolic(type, \
47 { META_FLUSH, "META_FLUSH" }, \
49 { INMEM_DROP, "INMEM_DROP" }, \
50 { IPU, "IN-PLACE" }, \
51 { OPU, "OUT-OF-PLACE" })
53 #define F2FS_BIO_MASK(t) (t & (READA | WRITE_FLUSH_FUA))
54 #define F2FS_BIO_EXTRA_MASK(t) (t & (REQ_META | REQ_PRIO))
56 #define show_bio_type(type) show_bio_base(type), show_bio_extra(type)
58 #define show_bio_base(type) \
59 __print_symbolic(F2FS_BIO_MASK(type), \
61 { READA, "READAHEAD" }, \
62 { READ_SYNC, "READ_SYNC" }, \
64 { WRITE_SYNC, "WRITE_SYNC" }, \
65 { WRITE_FLUSH, "WRITE_FLUSH" }, \
66 { WRITE_FUA, "WRITE_FUA" }, \
67 { WRITE_FLUSH_FUA, "WRITE_FLUSH_FUA" })
69 #define show_bio_extra(type) \
70 __print_symbolic(F2FS_BIO_EXTRA_MASK(type), \
71 { REQ_META, "(M)" }, \
72 { REQ_PRIO, "(P)" }, \
73 { REQ_META | REQ_PRIO, "(MP)" }, \
76 #define show_data_type(type) \
77 __print_symbolic(type, \
78 { CURSEG_HOT_DATA, "Hot DATA" }, \
79 { CURSEG_WARM_DATA, "Warm DATA" }, \
80 { CURSEG_COLD_DATA, "Cold DATA" }, \
81 { CURSEG_HOT_NODE, "Hot NODE" }, \
82 { CURSEG_WARM_NODE, "Warm NODE" }, \
83 { CURSEG_COLD_NODE, "Cold NODE" }, \
84 { NO_CHECK_TYPE, "No TYPE" })
86 #define show_file_type(type) \
87 __print_symbolic(type, \
91 #define show_gc_type(type) \
92 __print_symbolic(type, \
93 { FG_GC, "Foreground GC" }, \
94 { BG_GC, "Background GC" })
96 #define show_alloc_mode(type) \
97 __print_symbolic(type, \
98 { LFS, "LFS-mode" }, \
101 #define show_victim_policy(type) \
102 __print_symbolic(type, \
103 { GC_GREEDY, "Greedy" }, \
104 { GC_CB, "Cost-Benefit" })
106 #define show_cpreason(type) \
107 __print_symbolic(type, \
108 { CP_UMOUNT, "Umount" }, \
109 { CP_FASTBOOT, "Fastboot" }, \
110 { CP_SYNC, "Sync" }, \
111 { CP_RECOVERY, "Recovery" }, \
112 { CP_DISCARD, "Discard" })
114 struct victim_sel_policy
;
116 DECLARE_EVENT_CLASS(f2fs__inode
,
118 TP_PROTO(struct inode
*inode
),
126 __field(umode_t
, mode
)
127 __field(loff_t
, size
)
128 __field(unsigned int, nlink
)
129 __field(blkcnt_t
, blocks
)
130 __field(__u8
, advise
)
134 __entry
->dev
= inode
->i_sb
->s_dev
;
135 __entry
->ino
= inode
->i_ino
;
136 __entry
->pino
= F2FS_I(inode
)->i_pino
;
137 __entry
->mode
= inode
->i_mode
;
138 __entry
->nlink
= inode
->i_nlink
;
139 __entry
->size
= inode
->i_size
;
140 __entry
->blocks
= inode
->i_blocks
;
141 __entry
->advise
= F2FS_I(inode
)->i_advise
;
144 TP_printk("dev = (%d,%d), ino = %lu, pino = %lu, i_mode = 0x%hx, "
145 "i_size = %lld, i_nlink = %u, i_blocks = %llu, i_advise = 0x%x",
146 show_dev_ino(__entry
),
147 (unsigned long)__entry
->pino
,
150 (unsigned int)__entry
->nlink
,
151 (unsigned long long)__entry
->blocks
,
152 (unsigned char)__entry
->advise
)
155 DECLARE_EVENT_CLASS(f2fs__inode_exit
,
157 TP_PROTO(struct inode
*inode
, int ret
),
168 __entry
->dev
= inode
->i_sb
->s_dev
;
169 __entry
->ino
= inode
->i_ino
;
173 TP_printk("dev = (%d,%d), ino = %lu, ret = %d",
174 show_dev_ino(__entry
),
178 DEFINE_EVENT(f2fs__inode
, f2fs_sync_file_enter
,
180 TP_PROTO(struct inode
*inode
),
185 TRACE_EVENT(f2fs_sync_file_exit
,
187 TP_PROTO(struct inode
*inode
, int need_cp
, int datasync
, int ret
),
189 TP_ARGS(inode
, need_cp
, datasync
, ret
),
194 __field(int, need_cp
)
195 __field(int, datasync
)
200 __entry
->dev
= inode
->i_sb
->s_dev
;
201 __entry
->ino
= inode
->i_ino
;
202 __entry
->need_cp
= need_cp
;
203 __entry
->datasync
= datasync
;
207 TP_printk("dev = (%d,%d), ino = %lu, checkpoint is %s, "
208 "datasync = %d, ret = %d",
209 show_dev_ino(__entry
),
210 __entry
->need_cp
? "needed" : "not needed",
215 TRACE_EVENT(f2fs_sync_fs
,
217 TP_PROTO(struct super_block
*sb
, int wait
),
228 __entry
->dev
= sb
->s_dev
;
229 __entry
->dirty
= is_sbi_flag_set(F2FS_SB(sb
), SBI_IS_DIRTY
);
230 __entry
->wait
= wait
;
233 TP_printk("dev = (%d,%d), superblock is %s, wait = %d",
235 __entry
->dirty
? "dirty" : "not dirty",
239 DEFINE_EVENT(f2fs__inode
, f2fs_iget
,
241 TP_PROTO(struct inode
*inode
),
246 DEFINE_EVENT(f2fs__inode_exit
, f2fs_iget_exit
,
248 TP_PROTO(struct inode
*inode
, int ret
),
253 DEFINE_EVENT(f2fs__inode
, f2fs_evict_inode
,
255 TP_PROTO(struct inode
*inode
),
260 DEFINE_EVENT(f2fs__inode_exit
, f2fs_new_inode
,
262 TP_PROTO(struct inode
*inode
, int ret
),
267 TRACE_EVENT(f2fs_unlink_enter
,
269 TP_PROTO(struct inode
*dir
, struct dentry
*dentry
),
271 TP_ARGS(dir
, dentry
),
276 __field(loff_t
, size
)
277 __field(blkcnt_t
, blocks
)
278 __field(const char *, name
)
282 __entry
->dev
= dir
->i_sb
->s_dev
;
283 __entry
->ino
= dir
->i_ino
;
284 __entry
->size
= dir
->i_size
;
285 __entry
->blocks
= dir
->i_blocks
;
286 __entry
->name
= dentry
->d_name
.name
;
289 TP_printk("dev = (%d,%d), dir ino = %lu, i_size = %lld, "
290 "i_blocks = %llu, name = %s",
291 show_dev_ino(__entry
),
293 (unsigned long long)__entry
->blocks
,
297 DEFINE_EVENT(f2fs__inode_exit
, f2fs_unlink_exit
,
299 TP_PROTO(struct inode
*inode
, int ret
),
304 DEFINE_EVENT(f2fs__inode
, f2fs_truncate
,
306 TP_PROTO(struct inode
*inode
),
311 TRACE_EVENT(f2fs_truncate_data_blocks_range
,
313 TP_PROTO(struct inode
*inode
, nid_t nid
, unsigned int ofs
, int free
),
315 TP_ARGS(inode
, nid
, ofs
, free
),
321 __field(unsigned int, ofs
)
326 __entry
->dev
= inode
->i_sb
->s_dev
;
327 __entry
->ino
= inode
->i_ino
;
330 __entry
->free
= free
;
333 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, offset = %u, freed = %d",
334 show_dev_ino(__entry
),
335 (unsigned int)__entry
->nid
,
340 DECLARE_EVENT_CLASS(f2fs__truncate_op
,
342 TP_PROTO(struct inode
*inode
, u64 from
),
344 TP_ARGS(inode
, from
),
349 __field(loff_t
, size
)
350 __field(blkcnt_t
, blocks
)
355 __entry
->dev
= inode
->i_sb
->s_dev
;
356 __entry
->ino
= inode
->i_ino
;
357 __entry
->size
= inode
->i_size
;
358 __entry
->blocks
= inode
->i_blocks
;
359 __entry
->from
= from
;
362 TP_printk("dev = (%d,%d), ino = %lu, i_size = %lld, i_blocks = %llu, "
363 "start file offset = %llu",
364 show_dev_ino(__entry
),
366 (unsigned long long)__entry
->blocks
,
367 (unsigned long long)__entry
->from
)
370 DEFINE_EVENT(f2fs__truncate_op
, f2fs_truncate_blocks_enter
,
372 TP_PROTO(struct inode
*inode
, u64 from
),
377 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_blocks_exit
,
379 TP_PROTO(struct inode
*inode
, int ret
),
384 DEFINE_EVENT(f2fs__truncate_op
, f2fs_truncate_inode_blocks_enter
,
386 TP_PROTO(struct inode
*inode
, u64 from
),
391 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_inode_blocks_exit
,
393 TP_PROTO(struct inode
*inode
, int ret
),
398 DECLARE_EVENT_CLASS(f2fs__truncate_node
,
400 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
402 TP_ARGS(inode
, nid
, blk_addr
),
408 __field(block_t
, blk_addr
)
412 __entry
->dev
= inode
->i_sb
->s_dev
;
413 __entry
->ino
= inode
->i_ino
;
415 __entry
->blk_addr
= blk_addr
;
418 TP_printk("dev = (%d,%d), ino = %lu, nid = %u, block_address = 0x%llx",
419 show_dev_ino(__entry
),
420 (unsigned int)__entry
->nid
,
421 (unsigned long long)__entry
->blk_addr
)
424 DEFINE_EVENT(f2fs__truncate_node
, f2fs_truncate_nodes_enter
,
426 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
428 TP_ARGS(inode
, nid
, blk_addr
)
431 DEFINE_EVENT(f2fs__inode_exit
, f2fs_truncate_nodes_exit
,
433 TP_PROTO(struct inode
*inode
, int ret
),
438 DEFINE_EVENT(f2fs__truncate_node
, f2fs_truncate_node
,
440 TP_PROTO(struct inode
*inode
, nid_t nid
, block_t blk_addr
),
442 TP_ARGS(inode
, nid
, blk_addr
)
445 TRACE_EVENT(f2fs_truncate_partial_nodes
,
447 TP_PROTO(struct inode
*inode
, nid_t nid
[], int depth
, int err
),
449 TP_ARGS(inode
, nid
, depth
, err
),
454 __field(nid_t
, nid
[3])
460 __entry
->dev
= inode
->i_sb
->s_dev
;
461 __entry
->ino
= inode
->i_ino
;
462 __entry
->nid
[0] = nid
[0];
463 __entry
->nid
[1] = nid
[1];
464 __entry
->nid
[2] = nid
[2];
465 __entry
->depth
= depth
;
469 TP_printk("dev = (%d,%d), ino = %lu, "
470 "nid[0] = %u, nid[1] = %u, nid[2] = %u, depth = %d, err = %d",
471 show_dev_ino(__entry
),
472 (unsigned int)__entry
->nid
[0],
473 (unsigned int)__entry
->nid
[1],
474 (unsigned int)__entry
->nid
[2],
479 TRACE_EVENT(f2fs_get_data_block
,
480 TP_PROTO(struct inode
*inode
, sector_t iblock
,
481 struct buffer_head
*bh
, int ret
),
483 TP_ARGS(inode
, iblock
, bh
, ret
),
488 __field(sector_t
, iblock
)
489 __field(sector_t
, bh_start
)
490 __field(size_t, bh_size
)
495 __entry
->dev
= inode
->i_sb
->s_dev
;
496 __entry
->ino
= inode
->i_ino
;
497 __entry
->iblock
= iblock
;
498 __entry
->bh_start
= bh
->b_blocknr
;
499 __entry
->bh_size
= bh
->b_size
;
503 TP_printk("dev = (%d,%d), ino = %lu, file offset = %llu, "
504 "start blkaddr = 0x%llx, len = 0x%llx bytes, err = %d",
505 show_dev_ino(__entry
),
506 (unsigned long long)__entry
->iblock
,
507 (unsigned long long)__entry
->bh_start
,
508 (unsigned long long)__entry
->bh_size
,
512 TRACE_EVENT(f2fs_get_victim
,
514 TP_PROTO(struct super_block
*sb
, int type
, int gc_type
,
515 struct victim_sel_policy
*p
, unsigned int pre_victim
,
516 unsigned int prefree
, unsigned int free
),
518 TP_ARGS(sb
, type
, gc_type
, p
, pre_victim
, prefree
, free
),
523 __field(int, gc_type
)
524 __field(int, alloc_mode
)
525 __field(int, gc_mode
)
526 __field(unsigned int, victim
)
527 __field(unsigned int, ofs_unit
)
528 __field(unsigned int, pre_victim
)
529 __field(unsigned int, prefree
)
530 __field(unsigned int, free
)
534 __entry
->dev
= sb
->s_dev
;
535 __entry
->type
= type
;
536 __entry
->gc_type
= gc_type
;
537 __entry
->alloc_mode
= p
->alloc_mode
;
538 __entry
->gc_mode
= p
->gc_mode
;
539 __entry
->victim
= p
->min_segno
;
540 __entry
->ofs_unit
= p
->ofs_unit
;
541 __entry
->pre_victim
= pre_victim
;
542 __entry
->prefree
= prefree
;
543 __entry
->free
= free
;
546 TP_printk("dev = (%d,%d), type = %s, policy = (%s, %s, %s), victim = %u "
547 "ofs_unit = %u, pre_victim_secno = %d, prefree = %u, free = %u",
549 show_data_type(__entry
->type
),
550 show_gc_type(__entry
->gc_type
),
551 show_alloc_mode(__entry
->alloc_mode
),
552 show_victim_policy(__entry
->gc_mode
),
555 (int)__entry
->pre_victim
,
560 TRACE_EVENT(f2fs_fallocate
,
562 TP_PROTO(struct inode
*inode
, int mode
,
563 loff_t offset
, loff_t len
, int ret
),
565 TP_ARGS(inode
, mode
, offset
, len
, ret
),
571 __field(loff_t
, offset
)
573 __field(loff_t
, size
)
574 __field(blkcnt_t
, blocks
)
579 __entry
->dev
= inode
->i_sb
->s_dev
;
580 __entry
->ino
= inode
->i_ino
;
581 __entry
->mode
= mode
;
582 __entry
->offset
= offset
;
584 __entry
->size
= inode
->i_size
;
585 __entry
->blocks
= inode
->i_blocks
;
589 TP_printk("dev = (%d,%d), ino = %lu, mode = %x, offset = %lld, "
590 "len = %lld, i_size = %lld, i_blocks = %llu, ret = %d",
591 show_dev_ino(__entry
),
593 (unsigned long long)__entry
->offset
,
594 (unsigned long long)__entry
->len
,
595 (unsigned long long)__entry
->size
,
596 (unsigned long long)__entry
->blocks
,
600 TRACE_EVENT(f2fs_direct_IO_enter
,
602 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
, int rw
),
604 TP_ARGS(inode
, offset
, len
, rw
),
610 __field(unsigned long, len
)
615 __entry
->dev
= inode
->i_sb
->s_dev
;
616 __entry
->ino
= inode
->i_ino
;
617 __entry
->pos
= offset
;
622 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu rw = %d",
623 show_dev_ino(__entry
),
629 TRACE_EVENT(f2fs_direct_IO_exit
,
631 TP_PROTO(struct inode
*inode
, loff_t offset
, unsigned long len
,
634 TP_ARGS(inode
, offset
, len
, rw
, ret
),
640 __field(unsigned long, len
)
646 __entry
->dev
= inode
->i_sb
->s_dev
;
647 __entry
->ino
= inode
->i_ino
;
648 __entry
->pos
= offset
;
654 TP_printk("dev = (%d,%d), ino = %lu pos = %lld len = %lu "
656 show_dev_ino(__entry
),
663 TRACE_EVENT(f2fs_reserve_new_block
,
665 TP_PROTO(struct inode
*inode
, nid_t nid
, unsigned int ofs_in_node
),
667 TP_ARGS(inode
, nid
, ofs_in_node
),
672 __field(unsigned int, ofs_in_node
)
676 __entry
->dev
= inode
->i_sb
->s_dev
;
678 __entry
->ofs_in_node
= ofs_in_node
;
681 TP_printk("dev = (%d,%d), nid = %u, ofs_in_node = %u",
683 (unsigned int)__entry
->nid
,
684 __entry
->ofs_in_node
)
687 DECLARE_EVENT_CLASS(f2fs__submit_page_bio
,
689 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
696 __field(pgoff_t
, index
)
697 __field(block_t
, blkaddr
)
703 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
704 __entry
->ino
= page
->mapping
->host
->i_ino
;
705 __entry
->index
= page
->index
;
706 __entry
->blkaddr
= fio
->blk_addr
;
707 __entry
->rw
= fio
->rw
;
708 __entry
->type
= fio
->type
;
711 TP_printk("dev = (%d,%d), ino = %lu, page_index = 0x%lx, "
712 "blkaddr = 0x%llx, rw = %s%s, type = %s",
713 show_dev_ino(__entry
),
714 (unsigned long)__entry
->index
,
715 (unsigned long long)__entry
->blkaddr
,
716 show_bio_type(__entry
->rw
),
717 show_block_type(__entry
->type
))
720 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio
, f2fs_submit_page_bio
,
722 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
726 TP_CONDITION(page
->mapping
)
729 DEFINE_EVENT_CONDITION(f2fs__submit_page_bio
, f2fs_submit_page_mbio
,
731 TP_PROTO(struct page
*page
, struct f2fs_io_info
*fio
),
735 TP_CONDITION(page
->mapping
)
738 DECLARE_EVENT_CLASS(f2fs__submit_bio
,
740 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
743 TP_ARGS(sb
, fio
, bio
),
749 __field(sector_t
, sector
)
750 __field(unsigned int, size
)
754 __entry
->dev
= sb
->s_dev
;
755 __entry
->rw
= fio
->rw
;
756 __entry
->type
= fio
->type
;
757 __entry
->sector
= bio
->bi_iter
.bi_sector
;
758 __entry
->size
= bio
->bi_iter
.bi_size
;
761 TP_printk("dev = (%d,%d), %s%s, %s, sector = %lld, size = %u",
763 show_bio_type(__entry
->rw
),
764 show_block_type(__entry
->type
),
765 (unsigned long long)__entry
->sector
,
769 DEFINE_EVENT_CONDITION(f2fs__submit_bio
, f2fs_submit_write_bio
,
771 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
774 TP_ARGS(sb
, fio
, bio
),
779 DEFINE_EVENT_CONDITION(f2fs__submit_bio
, f2fs_submit_read_bio
,
781 TP_PROTO(struct super_block
*sb
, struct f2fs_io_info
*fio
,
784 TP_ARGS(sb
, fio
, bio
),
789 TRACE_EVENT(f2fs_write_begin
,
791 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
794 TP_ARGS(inode
, pos
, len
, flags
),
800 __field(unsigned int, len
)
801 __field(unsigned int, flags
)
805 __entry
->dev
= inode
->i_sb
->s_dev
;
806 __entry
->ino
= inode
->i_ino
;
809 __entry
->flags
= flags
;
812 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
813 show_dev_ino(__entry
),
814 (unsigned long long)__entry
->pos
,
819 TRACE_EVENT(f2fs_write_end
,
821 TP_PROTO(struct inode
*inode
, loff_t pos
, unsigned int len
,
822 unsigned int copied
),
824 TP_ARGS(inode
, pos
, len
, copied
),
830 __field(unsigned int, len
)
831 __field(unsigned int, copied
)
835 __entry
->dev
= inode
->i_sb
->s_dev
;
836 __entry
->ino
= inode
->i_ino
;
839 __entry
->copied
= copied
;
842 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
843 show_dev_ino(__entry
),
844 (unsigned long long)__entry
->pos
,
849 DECLARE_EVENT_CLASS(f2fs__page
,
851 TP_PROTO(struct page
*page
, int type
),
860 __field(pgoff_t
, index
)
862 __field(int, uptodate
)
866 __entry
->dev
= page
->mapping
->host
->i_sb
->s_dev
;
867 __entry
->ino
= page
->mapping
->host
->i_ino
;
868 __entry
->type
= type
;
869 __entry
->dir
= S_ISDIR(page
->mapping
->host
->i_mode
);
870 __entry
->index
= page
->index
;
871 __entry
->dirty
= PageDirty(page
);
872 __entry
->uptodate
= PageUptodate(page
);
875 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
876 "dirty = %d, uptodate = %d",
877 show_dev_ino(__entry
),
878 show_block_type(__entry
->type
),
879 show_file_type(__entry
->dir
),
880 (unsigned long)__entry
->index
,
885 DEFINE_EVENT(f2fs__page
, f2fs_writepage
,
887 TP_PROTO(struct page
*page
, int type
),
892 DEFINE_EVENT(f2fs__page
, f2fs_do_write_data_page
,
894 TP_PROTO(struct page
*page
, int type
),
899 DEFINE_EVENT(f2fs__page
, f2fs_readpage
,
901 TP_PROTO(struct page
*page
, int type
),
906 DEFINE_EVENT(f2fs__page
, f2fs_set_page_dirty
,
908 TP_PROTO(struct page
*page
, int type
),
913 DEFINE_EVENT(f2fs__page
, f2fs_vm_page_mkwrite
,
915 TP_PROTO(struct page
*page
, int type
),
920 DEFINE_EVENT(f2fs__page
, f2fs_register_inmem_page
,
922 TP_PROTO(struct page
*page
, int type
),
927 DEFINE_EVENT(f2fs__page
, f2fs_commit_inmem_page
,
929 TP_PROTO(struct page
*page
, int type
),
934 TRACE_EVENT(f2fs_writepages
,
936 TP_PROTO(struct inode
*inode
, struct writeback_control
*wbc
, int type
),
938 TP_ARGS(inode
, wbc
, type
),
945 __field(long, nr_to_write
)
946 __field(long, pages_skipped
)
947 __field(loff_t
, range_start
)
948 __field(loff_t
, range_end
)
949 __field(pgoff_t
, writeback_index
)
950 __field(int, sync_mode
)
951 __field(char, for_kupdate
)
952 __field(char, for_background
)
953 __field(char, tagged_writepages
)
954 __field(char, for_reclaim
)
955 __field(char, range_cyclic
)
956 __field(char, for_sync
)
960 __entry
->dev
= inode
->i_sb
->s_dev
;
961 __entry
->ino
= inode
->i_ino
;
962 __entry
->type
= type
;
963 __entry
->dir
= S_ISDIR(inode
->i_mode
);
964 __entry
->nr_to_write
= wbc
->nr_to_write
;
965 __entry
->pages_skipped
= wbc
->pages_skipped
;
966 __entry
->range_start
= wbc
->range_start
;
967 __entry
->range_end
= wbc
->range_end
;
968 __entry
->writeback_index
= inode
->i_mapping
->writeback_index
;
969 __entry
->sync_mode
= wbc
->sync_mode
;
970 __entry
->for_kupdate
= wbc
->for_kupdate
;
971 __entry
->for_background
= wbc
->for_background
;
972 __entry
->tagged_writepages
= wbc
->tagged_writepages
;
973 __entry
->for_reclaim
= wbc
->for_reclaim
;
974 __entry
->range_cyclic
= wbc
->range_cyclic
;
975 __entry
->for_sync
= wbc
->for_sync
;
978 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
979 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
980 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
981 show_dev_ino(__entry
),
982 show_block_type(__entry
->type
),
983 show_file_type(__entry
->dir
),
984 __entry
->nr_to_write
,
985 __entry
->pages_skipped
,
986 __entry
->range_start
,
988 (unsigned long)__entry
->writeback_index
,
990 __entry
->for_kupdate
,
991 __entry
->for_background
,
992 __entry
->tagged_writepages
,
993 __entry
->for_reclaim
,
994 __entry
->range_cyclic
,
998 TRACE_EVENT(f2fs_write_checkpoint
,
1000 TP_PROTO(struct super_block
*sb
, int reason
, char *msg
),
1002 TP_ARGS(sb
, reason
, msg
),
1006 __field(int, reason
)
1007 __field(char *, msg
)
1011 __entry
->dev
= sb
->s_dev
;
1012 __entry
->reason
= reason
;
1016 TP_printk("dev = (%d,%d), checkpoint for %s, state = %s",
1018 show_cpreason(__entry
->reason
),
1022 TRACE_EVENT(f2fs_issue_discard
,
1024 TP_PROTO(struct super_block
*sb
, block_t blkstart
, block_t blklen
),
1026 TP_ARGS(sb
, blkstart
, blklen
),
1030 __field(block_t
, blkstart
)
1031 __field(block_t
, blklen
)
1035 __entry
->dev
= sb
->s_dev
;
1036 __entry
->blkstart
= blkstart
;
1037 __entry
->blklen
= blklen
;
1040 TP_printk("dev = (%d,%d), blkstart = 0x%llx, blklen = 0x%llx",
1042 (unsigned long long)__entry
->blkstart
,
1043 (unsigned long long)__entry
->blklen
)
1046 TRACE_EVENT(f2fs_issue_flush
,
1048 TP_PROTO(struct super_block
*sb
, unsigned int nobarrier
,
1049 unsigned int flush_merge
),
1051 TP_ARGS(sb
, nobarrier
, flush_merge
),
1055 __field(unsigned int, nobarrier
)
1056 __field(unsigned int, flush_merge
)
1060 __entry
->dev
= sb
->s_dev
;
1061 __entry
->nobarrier
= nobarrier
;
1062 __entry
->flush_merge
= flush_merge
;
1065 TP_printk("dev = (%d,%d), %s %s",
1067 __entry
->nobarrier
? "skip (nobarrier)" : "issue",
1068 __entry
->flush_merge
? " with flush_merge" : "")
1071 TRACE_EVENT(f2fs_lookup_extent_tree_start
,
1073 TP_PROTO(struct inode
*inode
, unsigned int pgofs
),
1075 TP_ARGS(inode
, pgofs
),
1080 __field(unsigned int, pgofs
)
1084 __entry
->dev
= inode
->i_sb
->s_dev
;
1085 __entry
->ino
= inode
->i_ino
;
1086 __entry
->pgofs
= pgofs
;
1089 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u",
1090 show_dev_ino(__entry
),
1094 TRACE_EVENT_CONDITION(f2fs_lookup_extent_tree_end
,
1096 TP_PROTO(struct inode
*inode
, unsigned int pgofs
,
1097 struct extent_node
*en
),
1099 TP_ARGS(inode
, pgofs
, en
),
1106 __field(unsigned int, pgofs
)
1107 __field(unsigned int, fofs
)
1109 __field(unsigned int, len
)
1113 __entry
->dev
= inode
->i_sb
->s_dev
;
1114 __entry
->ino
= inode
->i_ino
;
1115 __entry
->pgofs
= pgofs
;
1116 __entry
->fofs
= en
->ei
.fofs
;
1117 __entry
->blk
= en
->ei
.blk
;
1118 __entry
->len
= en
->ei
.len
;
1121 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, "
1122 "ext_info(fofs: %u, blk: %u, len: %u)",
1123 show_dev_ino(__entry
),
1130 TRACE_EVENT(f2fs_update_extent_tree
,
1132 TP_PROTO(struct inode
*inode
, unsigned int pgofs
, block_t blkaddr
),
1134 TP_ARGS(inode
, pgofs
, blkaddr
),
1139 __field(unsigned int, pgofs
)
1144 __entry
->dev
= inode
->i_sb
->s_dev
;
1145 __entry
->ino
= inode
->i_ino
;
1146 __entry
->pgofs
= pgofs
;
1147 __entry
->blk
= blkaddr
;
1150 TP_printk("dev = (%d,%d), ino = %lu, pgofs = %u, blkaddr = %u",
1151 show_dev_ino(__entry
),
1156 TRACE_EVENT(f2fs_shrink_extent_tree
,
1158 TP_PROTO(struct f2fs_sb_info
*sbi
, unsigned int node_cnt
,
1159 unsigned int tree_cnt
),
1161 TP_ARGS(sbi
, node_cnt
, tree_cnt
),
1165 __field(unsigned int, node_cnt
)
1166 __field(unsigned int, tree_cnt
)
1170 __entry
->dev
= sbi
->sb
->s_dev
;
1171 __entry
->node_cnt
= node_cnt
;
1172 __entry
->tree_cnt
= tree_cnt
;
1175 TP_printk("dev = (%d,%d), shrunk: node_cnt = %u, tree_cnt = %u",
1181 TRACE_EVENT(f2fs_destroy_extent_tree
,
1183 TP_PROTO(struct inode
*inode
, unsigned int node_cnt
),
1185 TP_ARGS(inode
, node_cnt
),
1190 __field(unsigned int, node_cnt
)
1194 __entry
->dev
= inode
->i_sb
->s_dev
;
1195 __entry
->ino
= inode
->i_ino
;
1196 __entry
->node_cnt
= node_cnt
;
1199 TP_printk("dev = (%d,%d), ino = %lu, destroyed: node_cnt = %u",
1200 show_dev_ino(__entry
),
1204 #endif /* _TRACE_F2FS_H */
1206 /* This part must be outside protection */
1207 #include <trace/define_trace.h>