f2fs: add a tracepoint for f2fs_write_{meta,node,data}_page
authorChao Yu <chao2.yu@samsung.com>
Tue, 6 May 2014 08:48:26 +0000 (16:48 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Wed, 7 May 2014 01:21:59 +0000 (10:21 +0900)
This patch adds a tracepoint for f2fs_write_{meta,node,data}_page to trace when
page is writting out.

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

index 4206f1664be51c8e918170ee40792b8cda0d09ca..c95d62281d7e2ab07f0a92adfceb49a6f7f41d9d 100644 (file)
@@ -157,6 +157,8 @@ static int f2fs_write_meta_page(struct page *page,
        struct inode *inode = page->mapping->host;
        struct f2fs_sb_info *sbi = F2FS_SB(inode->i_sb);
 
+       trace_f2fs_writepage(page, META);
+
        if (unlikely(sbi->por_doing))
                goto redirty_out;
        if (wbc->for_reclaim)
index ea58fb698ac6bd01c6e901c8a93c64f1c12f2202..b997d552880ea97a9517994cf8207b50c13deb4e 100644 (file)
@@ -788,6 +788,8 @@ static int f2fs_write_data_page(struct page *page,
                .rw = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : WRITE,
        };
 
+       trace_f2fs_writepage(page, DATA);
+
        if (page->index < end_index)
                goto write;
 
index 059aaf5dda2b3173480de3f4687f2b9584b52980..49bdddbcadead16147fe7b7b27c1e2fde2ce76ec 100644 (file)
@@ -1199,6 +1199,8 @@ static int f2fs_write_node_page(struct page *page,
                .rw = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : WRITE,
        };
 
+       trace_f2fs_writepage(page, NODE);
+
        if (unlikely(sbi->por_doing))
                goto redirty_out;
 
index 483804b557428b43d3bc59349c1078d95e3d9529..d70991e69e58e4d3753d3836ad763b81e468f3a6 100644 (file)
@@ -751,6 +751,13 @@ DECLARE_EVENT_CLASS(f2fs__page,
                __entry->dirty)
 );
 
+DEFINE_EVENT(f2fs__page, f2fs_writepage,
+
+       TP_PROTO(struct page *page, int type),
+
+       TP_ARGS(page, type)
+);
+
 DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
 
        TP_PROTO(struct page *page, int type),