diff options
-rw-r--r-- | fs/f2fs/checkpoint.c | 7 | ||||
-rw-r--r-- | include/trace/events/f2fs.h | 24 |
2 files changed, 31 insertions, 0 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index be6aa2eef894..f54b83b4d90b 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include "f2fs.h" | 20 | #include "f2fs.h" |
21 | #include "node.h" | 21 | #include "node.h" |
22 | #include "segment.h" | 22 | #include "segment.h" |
23 | #include <trace/events/f2fs.h> | ||
23 | 24 | ||
24 | static struct kmem_cache *orphan_entry_slab; | 25 | static struct kmem_cache *orphan_entry_slab; |
25 | static struct kmem_cache *inode_entry_slab; | 26 | static struct kmem_cache *inode_entry_slab; |
@@ -714,9 +715,13 @@ void write_checkpoint(struct f2fs_sb_info *sbi, bool is_umount) | |||
714 | struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); | 715 | struct f2fs_checkpoint *ckpt = F2FS_CKPT(sbi); |
715 | unsigned long long ckpt_ver; | 716 | unsigned long long ckpt_ver; |
716 | 717 | ||
718 | trace_f2fs_write_checkpoint(sbi->sb, is_umount, "start block_ops"); | ||
719 | |||
717 | mutex_lock(&sbi->cp_mutex); | 720 | mutex_lock(&sbi->cp_mutex); |
718 | block_operations(sbi); | 721 | block_operations(sbi); |
719 | 722 | ||
723 | trace_f2fs_write_checkpoint(sbi->sb, is_umount, "finish block_ops"); | ||
724 | |||
720 | f2fs_submit_bio(sbi, DATA, true); | 725 | f2fs_submit_bio(sbi, DATA, true); |
721 | f2fs_submit_bio(sbi, NODE, true); | 726 | f2fs_submit_bio(sbi, NODE, true); |
722 | f2fs_submit_bio(sbi, META, true); | 727 | f2fs_submit_bio(sbi, META, true); |
@@ -738,6 +743,8 @@ void write_checkpoint(struct f2fs_sb_info *sbi, bool is_umount) | |||
738 | 743 | ||
739 | unblock_operations(sbi); | 744 | unblock_operations(sbi); |
740 | mutex_unlock(&sbi->cp_mutex); | 745 | mutex_unlock(&sbi->cp_mutex); |
746 | |||
747 | trace_f2fs_write_checkpoint(sbi->sb, is_umount, "finish checkpoint"); | ||
741 | } | 748 | } |
742 | 749 | ||
743 | void init_orphan_info(struct f2fs_sb_info *sbi) | 750 | void init_orphan_info(struct f2fs_sb_info *sbi) |
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h index ae2da92e0768..b2b2f72a023d 100644 --- a/include/trace/events/f2fs.h +++ b/include/trace/events/f2fs.h | |||
@@ -645,6 +645,30 @@ TRACE_EVENT(f2fs_submit_write_page, | |||
645 | (unsigned long long)__entry->block) | 645 | (unsigned long long)__entry->block) |
646 | ); | 646 | ); |
647 | 647 | ||
648 | TRACE_EVENT(f2fs_write_checkpoint, | ||
649 | |||
650 | TP_PROTO(struct super_block *sb, bool is_umount, char *msg), | ||
651 | |||
652 | TP_ARGS(sb, is_umount, msg), | ||
653 | |||
654 | TP_STRUCT__entry( | ||
655 | __field(dev_t, dev) | ||
656 | __field(bool, is_umount) | ||
657 | __field(char *, msg) | ||
658 | ), | ||
659 | |||
660 | TP_fast_assign( | ||
661 | __entry->dev = sb->s_dev; | ||
662 | __entry->is_umount = is_umount; | ||
663 | __entry->msg = msg; | ||
664 | ), | ||
665 | |||
666 | TP_printk("dev = (%d,%d), checkpoint for %s, state = %s", | ||
667 | show_dev(__entry), | ||
668 | __entry->is_umount ? "clean umount" : "consistency", | ||
669 | __entry->msg) | ||
670 | ); | ||
671 | |||
648 | #endif /* _TRACE_F2FS_H */ | 672 | #endif /* _TRACE_F2FS_H */ |
649 | 673 | ||
650 | /* This part must be outside protection */ | 674 | /* This part must be outside protection */ |