Commit 6ec178da authored by Namjae Jeon's avatar Namjae Jeon Committed by Jaegeuk Kim

f2fs: add tracepoints for write page operations

Add tracepoints to debug the various page write operation
like data pages, meta pages.
Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarPankaj Kumar <pankaj.km@samsung.com>
Acked-by: default avatarSteven Rostedt <rostedt@goodmis.org>
[Jaegeuk: remove unnecessary tracepoints]
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent c01e2853
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "f2fs.h" #include "f2fs.h"
#include "segment.h" #include "segment.h"
#include "node.h" #include "node.h"
#include <trace/events/f2fs.h>
/* /*
* This function balances dirty node and dentry pages. * This function balances dirty node and dentry pages.
...@@ -691,6 +692,9 @@ static void do_submit_bio(struct f2fs_sb_info *sbi, ...@@ -691,6 +692,9 @@ static void do_submit_bio(struct f2fs_sb_info *sbi,
struct bio_private *p = sbi->bio[btype]->bi_private; struct bio_private *p = sbi->bio[btype]->bi_private;
p->sbi = sbi; p->sbi = sbi;
sbi->bio[btype]->bi_end_io = f2fs_end_io_write; sbi->bio[btype]->bi_end_io = f2fs_end_io_write;
trace_f2fs_do_submit_bio(sbi->sb, btype, sync, sbi->bio[btype]);
if (type == META_FLUSH) { if (type == META_FLUSH) {
DECLARE_COMPLETION_ONSTACK(wait); DECLARE_COMPLETION_ONSTACK(wait);
p->is_sync = true; p->is_sync = true;
...@@ -745,6 +749,7 @@ static void submit_write_page(struct f2fs_sb_info *sbi, struct page *page, ...@@ -745,6 +749,7 @@ static void submit_write_page(struct f2fs_sb_info *sbi, struct page *page,
sbi->last_block_in_bio[type] = blk_addr; sbi->last_block_in_bio[type] = blk_addr;
up_write(&sbi->bio_sem); up_write(&sbi->bio_sem);
trace_f2fs_submit_write_page(page, blk_addr, type);
} }
static bool __has_curseg_space(struct f2fs_sb_info *sbi, int type) static bool __has_curseg_space(struct f2fs_sb_info *sbi, int type)
......
...@@ -8,6 +8,14 @@ ...@@ -8,6 +8,14 @@
#define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev) #define show_dev(entry) MAJOR(entry->dev), MINOR(entry->dev)
#define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino #define show_dev_ino(entry) show_dev(entry), (unsigned long)entry->ino
#define show_block_type(type) \
__print_symbolic(type, \
{ NODE, "NODE" }, \
{ DATA, "DATA" }, \
{ META, "META" }, \
{ META_FLUSH, "META_FLUSH" })
#define show_bio_type(type) \ #define show_bio_type(type) \
__print_symbolic(type, \ __print_symbolic(type, \
{ READ, "READ" }, \ { READ, "READ" }, \
...@@ -578,6 +586,65 @@ TRACE_EVENT(f2fs_reserve_new_block, ...@@ -578,6 +586,65 @@ TRACE_EVENT(f2fs_reserve_new_block,
__entry->ofs_in_node) __entry->ofs_in_node)
); );
TRACE_EVENT(f2fs_do_submit_bio,
TP_PROTO(struct super_block *sb, int btype, bool sync, struct bio *bio),
TP_ARGS(sb, btype, sync, bio),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(int, btype)
__field(bool, sync)
__field(sector_t, sector)
__field(unsigned int, size)
),
TP_fast_assign(
__entry->dev = sb->s_dev;
__entry->btype = btype;
__entry->sync = sync;
__entry->sector = bio->bi_sector;
__entry->size = bio->bi_size;
),
TP_printk("dev = (%d,%d), type = %s, io = %s, sector = %lld, size = %u",
show_dev(__entry),
show_block_type(__entry->btype),
__entry->sync ? "sync" : "no sync",
(unsigned long long)__entry->sector,
__entry->size)
);
TRACE_EVENT(f2fs_submit_write_page,
TP_PROTO(struct page *page, block_t blk_addr, int type),
TP_ARGS(page, blk_addr, type),
TP_STRUCT__entry(
__field(dev_t, dev)
__field(ino_t, ino)
__field(int, type)
__field(pgoff_t, index)
__field(block_t, block)
),
TP_fast_assign(
__entry->dev = page->mapping->host->i_sb->s_dev;
__entry->ino = page->mapping->host->i_ino;
__entry->type = type;
__entry->index = page->index;
__entry->block = blk_addr;
),
TP_printk("dev = (%d,%d), ino = %lu, %s, index = %lu, blkaddr = 0x%llx",
show_dev_ino(__entry),
show_block_type(__entry->type),
(unsigned long)__entry->index,
(unsigned long long)__entry->block)
);
#endif /* _TRACE_F2FS_H */ #endif /* _TRACE_F2FS_H */
/* This part must be outside protection */ /* This part must be outside protection */
......
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