aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-05-06 04:46:04 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-05-06 21:21:59 -0400
commit62aed044ea4bef36ac3f6885611b013b11c9be2d (patch)
tree650bb88860691bfae122e4be3f56c8c9789d465e
parent8b376249e7e659c41896e0d3e9b25d1230a4e7f6 (diff)
f2fs: add a tracepoint for f2fs_write_begin
This patch adds a tracepoint for f2fs_write_begin 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 a7bb98f5831a..cde0d69969b9 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -900,6 +900,8 @@ static int f2fs_write_begin(struct file *file, struct address_space *mapping,
900 struct dnode_of_data dn; 900 struct dnode_of_data dn;
901 int err = 0; 901 int err = 0;
902 902
903 trace_f2fs_write_begin(inode, pos, len, flags);
904
903 f2fs_balance_fs(sbi); 905 f2fs_balance_fs(sbi);
904repeat: 906repeat:
905 err = f2fs_convert_inline_data(inode, pos + len); 907 err = f2fs_convert_inline_data(inode, pos + len);
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 67f38faac589..1e9375aa9340 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -659,6 +659,36 @@ DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
659 TP_CONDITION(bio) 659 TP_CONDITION(bio)
660); 660);
661 661
662TRACE_EVENT(f2fs_write_begin,
663
664 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
665 unsigned int flags),
666
667 TP_ARGS(inode, pos, len, flags),
668
669 TP_STRUCT__entry(
670 __field(dev_t, dev)
671 __field(ino_t, ino)
672 __field(loff_t, pos)
673 __field(unsigned int, len)
674 __field(unsigned int, flags)
675 ),
676
677 TP_fast_assign(
678 __entry->dev = inode->i_sb->s_dev;
679 __entry->ino = inode->i_ino;
680 __entry->pos = pos;
681 __entry->len = len;
682 __entry->flags = flags;
683 ),
684
685 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
686 show_dev_ino(__entry),
687 (unsigned long long)__entry->pos,
688 __entry->len,
689 __entry->flags)
690);
691
662DECLARE_EVENT_CLASS(f2fs__page, 692DECLARE_EVENT_CLASS(f2fs__page,
663 693
664 TP_PROTO(struct page *page, int type), 694 TP_PROTO(struct page *page, int type),