aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-05-06 04:47:23 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-05-06 21:21:59 -0400
commitdfb2bf38bf89e15a65f9996566b2945921388a2f (patch)
treeefe5c9496469fd694a19c57422a4a42bac8ba1e0
parent62aed044ea4bef36ac3f6885611b013b11c9be2d (diff)
f2fs: add a tracepoint for f2fs_write_end
This patch adds a tracepoint for f2fs_write_end to trace write op of 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.h30
2 files changed, 32 insertions, 0 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index cde0d69969b9..ea58fb698ac6 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -989,6 +989,8 @@ static int f2fs_write_end(struct file *file,
989{ 989{
990 struct inode *inode = page->mapping->host; 990 struct inode *inode = page->mapping->host;
991 991
992 trace_f2fs_write_end(inode, pos, len, copied);
993
992 SetPageUptodate(page); 994 SetPageUptodate(page);
993 set_page_dirty(page); 995 set_page_dirty(page);
994 996
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 1e9375aa9340..483804b55742 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -689,6 +689,36 @@ TRACE_EVENT(f2fs_write_begin,
689 __entry->flags) 689 __entry->flags)
690); 690);
691 691
692TRACE_EVENT(f2fs_write_end,
693
694 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
695 unsigned int copied),
696
697 TP_ARGS(inode, pos, len, copied),
698
699 TP_STRUCT__entry(
700 __field(dev_t, dev)
701 __field(ino_t, ino)
702 __field(loff_t, pos)
703 __field(unsigned int, len)
704 __field(unsigned int, copied)
705 ),
706
707 TP_fast_assign(
708 __entry->dev = inode->i_sb->s_dev;
709 __entry->ino = inode->i_ino;
710 __entry->pos = pos;
711 __entry->len = len;
712 __entry->copied = copied;
713 ),
714
715 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
716 show_dev_ino(__entry),
717 (unsigned long long)__entry->pos,
718 __entry->len,
719 __entry->copied)
720);
721
692DECLARE_EVENT_CLASS(f2fs__page, 722DECLARE_EVENT_CLASS(f2fs__page,
693 723
694 TP_PROTO(struct page *page, int type), 724 TP_PROTO(struct page *page, int type),