This patch adds a tracepoint for submit_read_page.

Signed-off-by: Chao Yu <chao2...@samsung.com>
---
 fs/f2fs/data.c              |    1 +
 include/trace/events/f2fs.h |   30 ++++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 9cf3f6c..0ca93be 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -448,6 +448,7 @@ alloc_new:
        io->last_block_in_bio = blk_addr;
 
        mutex_unlock(&io->io_mutex);
+       trace_f2fs_submit_read_page(page, blk_addr, rw);
 }
 
 /*
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index e0dc355..571f39a 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -453,6 +453,36 @@ TRACE_EVENT_CONDITION(f2fs_readpage,
                show_bio_type(__entry->type))
 );
 
+TRACE_EVENT(f2fs_submit_read_page,
+
+       TP_PROTO(struct page *page, block_t blk_addr, int rw),
+
+       TP_ARGS(page, blk_addr, rw),
+
+       TP_STRUCT__entry(
+               __field(dev_t,  dev)
+               __field(ino_t,  ino)
+               __field(int, rw)
+               __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->rw     = rw;
+               __entry->index  = page->index;
+               __entry->block  = blk_addr;
+       ),
+
+       TP_printk("dev = (%d,%d), ino = %lu, bio_type = %s, "
+               "index = %lu, blkaddr = 0x%llx",
+               show_dev_ino(__entry),
+               show_bio_type(__entry->rw),
+               (unsigned long)__entry->index,
+               (unsigned long long)__entry->block)
+);
+
 TRACE_EVENT(f2fs_get_data_block,
        TP_PROTO(struct inode *inode, sector_t iblock,
                                struct buffer_head *bh, int ret),
-- 
1.7.9.5

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

Reply via email to