Re: [RFC 5/5] f2fs: add tracepoints to debug inline data operations

From: Steven Rostedt
Date: Mon Jun 03 2013 - 09:50:09 EST


On Mon, 2013-06-03 at 18:04 +0800, Huajun Li wrote:
> From: Haicheng Li <haicheng.li@xxxxxxxxxxxxxxx>
>
> Add tracepoints for: f2fs_read_inline_data(), f2fs_convert_inline_data(),
> f2fs_write_inline_data().
>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Signed-off-by: Haicheng Li <haicheng.li@xxxxxxxxxxxxxxx>
> Signed-off-by: Huajun Li <huajun.li@xxxxxxxxx>
> ---
> fs/f2fs/inline.c | 4 +++
> include/trace/events/f2fs.h | 69 +++++++++++++++++++++++++++++++++++++++++++
> 2 files changed, 73 insertions(+)
>
> diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
> index a2aa056..9ec66e5 100644
> --- a/fs/f2fs/inline.c
> +++ b/fs/f2fs/inline.c
> @@ -14,6 +14,7 @@
> #include <linux/f2fs_fs.h>
>
> #include "f2fs.h"
> +#include <trace/events/f2fs.h>
>
> void f2fs_clear_inode_inline_flag(struct f2fs_inode *raw_inode)
> {
> @@ -44,6 +45,7 @@ static int f2fs_read_inline_data(struct inode *inode, struct page *page)
> if (IS_ERR(ipage))
> return PTR_ERR(ipage);
>
> + trace_f2fs_read_inline_data(inode, page);
> src_addr = page_address(ipage);
> dst_addr = page_address(page);
>
> @@ -107,6 +109,7 @@ int f2fs_convert_inline_data(struct page *p,
> set_page_dirty(ipage);
> f2fs_put_page(ipage, 1);
>
> + trace_f2fs_convert_inline_data(inode, page);
> if (!p->index) {
> SetPageUptodate(page);
> } else {
> @@ -138,6 +141,7 @@ int f2fs_write_inline_data(struct inode *inode,
> if (IS_ERR(ipage))
> return PTR_ERR(ipage);
>
> + trace_f2fs_write_inline_data(inode, page);
> src_addr = page_address(page);
> dst_addr = page_address(ipage);
>
> diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
> index 52ae548..bc7a84e 100644
> --- a/include/trace/events/f2fs.h
> +++ b/include/trace/events/f2fs.h
> @@ -676,6 +676,75 @@ TRACE_EVENT(f2fs_write_checkpoint,
> __entry->msg)
> );
>
> +TRACE_EVENT(f2fs_read_inline_data,
> +
> + TP_PROTO(struct inode *inode, struct page *page),
> +
> + TP_ARGS(inode, page),
> +
> + TP_STRUCT__entry(
> + __field(dev_t, dev)
> + __field(ino_t, ino)
> + __field(pgoff_t, index)
> + ),
> +
> + TP_fast_assign(
> + __entry->dev = inode->i_sb->s_dev;
> + __entry->ino = inode->i_ino;
> + __entry->index = page->index;
> + ),
> +
> + TP_printk("dev = (%d,%d), ino = %lu, index = %lu",
> + show_dev_ino(__entry),
> + (unsigned long)__entry->index)
> +);
> +
> +TRACE_EVENT(f2fs_convert_inline_data,
> +
> + TP_PROTO(struct inode *inode, struct page *page),
> +
> + TP_ARGS(inode, page),
> +
> + TP_STRUCT__entry(
> + __field(dev_t, dev)
> + __field(ino_t, ino)
> + __field(pgoff_t, index)
> + ),
> +
> + TP_fast_assign(
> + __entry->dev = inode->i_sb->s_dev;
> + __entry->ino = inode->i_ino;
> + __entry->index = page->index;
> + ),
> +
> + TP_printk("dev = (%d,%d), ino = %lu, index = %lu",
> + show_dev_ino(__entry),
> + (unsigned long)__entry->index)
> +);
> +
> +TRACE_EVENT(f2fs_write_inline_data,
> +
> + TP_PROTO(struct inode *inode, struct page *page),
> +
> + TP_ARGS(inode, page),
> +
> + TP_STRUCT__entry(
> + __field(dev_t, dev)
> + __field(ino_t, ino)
> + __field(pgoff_t, index)
> + ),
> +
> + TP_fast_assign(
> + __entry->dev = inode->i_sb->s_dev;
> + __entry->ino = inode->i_ino;
> + __entry->index = page->index;
> + ),
> +
> + TP_printk("dev = (%d,%d), ino = %lu, index = %lu",
> + show_dev_ino(__entry),
> + (unsigned long)__entry->index)
> +);

Can you convert the above to use DECLARE_EVENT_CLASS() and
DEFINE_EVENT(), as the above three are basically the same. You'll save a
few K in text by doing so.

Thanks,

-- Steve



> +
> #endif /* _TRACE_F2FS_H */
>
> /* This part must be outside protection */


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/