]> git.karo-electronics.de Git - linux-beck.git/commitdiff
f2fs: add a tracepoint for sync_dirty_inodes
authorChao Yu <chao2.yu@samsung.com>
Thu, 17 Dec 2015 09:17:16 +0000 (17:17 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 17 Dec 2015 17:55:27 +0000 (09:55 -0800)
This patch adds a tracepoint for sync_dirty_inodes.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/checkpoint.c
include/trace/events/f2fs.h

index 53044ea8bb5d89c43ad99547ac40950b76dcbd69..fdd43f71d2c6c03b016351f78a060a3ab7e4033b 100644 (file)
@@ -803,6 +803,11 @@ void sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
        struct list_head *head;
        struct inode *inode;
        struct f2fs_inode_info *fi;
+       bool is_dir = (type == DIR_INODE);
+
+       trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir,
+                               get_pages(sbi, is_dir ?
+                               F2FS_DIRTY_DENTS : F2FS_DIRTY_DATA));
 retry:
        if (unlikely(f2fs_cp_error(sbi)))
                return;
@@ -812,6 +817,9 @@ retry:
        head = &sbi->inode_list[type];
        if (list_empty(head)) {
                spin_unlock(&sbi->inode_lock[type]);
+               trace_f2fs_sync_dirty_inodes_exit(sbi->sb, is_dir,
+                               get_pages(sbi, is_dir ?
+                               F2FS_DIRTY_DENTS : F2FS_DIRTY_DATA));
                return;
        }
        fi = list_entry(head->next, struct f2fs_inode_info, dirty_list);
index 00b4a6308249ea5bd90df0b2f161d189fc326312..a1b488809f06992d98bed0566438cdf56ca87d84 100644 (file)
@@ -1265,6 +1265,44 @@ TRACE_EVENT(f2fs_destroy_extent_tree,
                __entry->node_cnt)
 );
 
+DECLARE_EVENT_CLASS(f2fs_sync_dirty_inodes,
+
+       TP_PROTO(struct super_block *sb, int type, int count),
+
+       TP_ARGS(sb, type, count),
+
+       TP_STRUCT__entry(
+               __field(dev_t, dev)
+               __field(int, type)
+               __field(int, count)
+       ),
+
+       TP_fast_assign(
+               __entry->dev    = sb->s_dev;
+               __entry->type   = type;
+               __entry->count  = count;
+       ),
+
+       TP_printk("dev = (%d,%d), %s, dirty count = %d",
+               show_dev(__entry),
+               show_file_type(__entry->type),
+               __entry->count)
+);
+
+DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_enter,
+
+       TP_PROTO(struct super_block *sb, int type, int count),
+
+       TP_ARGS(sb, type, count)
+);
+
+DEFINE_EVENT(f2fs_sync_dirty_inodes, f2fs_sync_dirty_inodes_exit,
+
+       TP_PROTO(struct super_block *sb, int type, int count),
+
+       TP_ARGS(sb, type, count)
+);
+
 #endif /* _TRACE_F2FS_H */
 
  /* This part must be outside protection */