aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-05-06 04:53:08 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-05-06 21:21:59 -0400
commitc20e89cde669799eff62bf8c00ca9a4819c4e11f (patch)
tree9fba31d66ff9bff75ddb72438d3ac5d2e6a7d207
parente57484343898094bb8f72a2aa1a50929d27aa027 (diff)
f2fs: add a tracepoint for f2fs_read_data_page
This patch adds a tracepoint for f2fs_read_data_page to trace when page is readed by user. Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
-rw-r--r--fs/f2fs/data.c2
-rw-r--r--include/trace/events/f2fs.h15
2 files changed, 15 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 21bfafaafe83..8c250a5d6f26 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -713,6 +713,8 @@ static int f2fs_read_data_page(struct file *file, struct page *page)
713 struct inode *inode = page->mapping->host; 713 struct inode *inode = page->mapping->host;
714 int ret; 714 int ret;
715 715
716 trace_f2fs_readpage(page, DATA);
717
716 /* If the file has inline data, try to read it directlly */ 718 /* If the file has inline data, try to read it directlly */
717 if (f2fs_has_inline_data(inode)) 719 if (f2fs_has_inline_data(inode))
718 ret = f2fs_read_inline_data(inode, page); 720 ret = f2fs_read_inline_data(inode, page);
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 91b1fcc5ec93..b983990b4a9f 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -732,6 +732,7 @@ DECLARE_EVENT_CLASS(f2fs__page,
732 __field(int, dir) 732 __field(int, dir)
733 __field(pgoff_t, index) 733 __field(pgoff_t, index)
734 __field(int, dirty) 734 __field(int, dirty)
735 __field(int, uptodate)
735 ), 736 ),
736 737
737 TP_fast_assign( 738 TP_fast_assign(
@@ -741,14 +742,17 @@ DECLARE_EVENT_CLASS(f2fs__page,
741 __entry->dir = S_ISDIR(page->mapping->host->i_mode); 742 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
742 __entry->index = page->index; 743 __entry->index = page->index;
743 __entry->dirty = PageDirty(page); 744 __entry->dirty = PageDirty(page);
745 __entry->uptodate = PageUptodate(page);
744 ), 746 ),
745 747
746 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, dirty = %d", 748 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
749 "dirty = %d, uptodate = %d",
747 show_dev_ino(__entry), 750 show_dev_ino(__entry),
748 show_block_type(__entry->type), 751 show_block_type(__entry->type),
749 show_file_type(__entry->dir), 752 show_file_type(__entry->dir),
750 (unsigned long)__entry->index, 753 (unsigned long)__entry->index,
751 __entry->dirty) 754 __entry->dirty,
755 __entry->uptodate)
752); 756);
753 757
754DEFINE_EVENT(f2fs__page, f2fs_writepage, 758DEFINE_EVENT(f2fs__page, f2fs_writepage,
@@ -758,6 +762,13 @@ DEFINE_EVENT(f2fs__page, f2fs_writepage,
758 TP_ARGS(page, type) 762 TP_ARGS(page, type)
759); 763);
760 764
765DEFINE_EVENT(f2fs__page, f2fs_readpage,
766
767 TP_PROTO(struct page *page, int type),
768
769 TP_ARGS(page, type)
770);
771
761DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty, 772DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
762 773
763 TP_PROTO(struct page *page, int type), 774 TP_PROTO(struct page *page, int type),