Commit dfb2bf38 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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: default avatarChao Yu <chao2.yu@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 62aed044
...@@ -989,6 +989,8 @@ static int f2fs_write_end(struct file *file, ...@@ -989,6 +989,8 @@ static int f2fs_write_end(struct file *file,
{ {
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
trace_f2fs_write_end(inode, pos, len, copied);
SetPageUptodate(page); SetPageUptodate(page);
set_page_dirty(page); set_page_dirty(page);
......
...@@ -689,6 +689,36 @@ TRACE_EVENT(f2fs_write_begin, ...@@ -689,6 +689,36 @@ TRACE_EVENT(f2fs_write_begin,
__entry->flags) __entry->flags)
); );
TRACE_EVENT(f2fs_write_end,
TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
unsigned int copied),
TP_ARGS(inode, pos, len, copied),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(ino_t, ino)
__field(loff_t, pos)
__field(unsigned int, len)
__field(unsigned int, copied)
),
TP_fast_assign(
__entry->dev = inode->i_sb->s_dev;
__entry->ino = inode->i_ino;
__entry->pos = pos;
__entry->len = len;
__entry->copied = copied;
),
TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
show_dev_ino(__entry),
(unsigned long long)__entry->pos,
__entry->len,
__entry->copied)
);
DECLARE_EVENT_CLASS(f2fs__page, DECLARE_EVENT_CLASS(f2fs__page,
TP_PROTO(struct page *page, int type), TP_PROTO(struct page *page, int type),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment