f2fs: adds a tracepoint for submit_read_page
authorChao Yu <chao2.yu@samsung.com>
Wed, 20 Nov 2013 08:40:10 +0000 (16:40 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 23 Dec 2013 01:18:02 +0000 (10:18 +0900)
This patch adds a tracepoint for submit_read_page.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
[Jaegeuk Kim: integrate tracepoints of f2fs_submit_read(_write)_page]
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/data.c
fs/f2fs/segment.c
include/trace/events/f2fs.h

index ce3cbd92585e73d68c66177221c7f565bb1b03b8..cdb342eeb4214ee5db45bfcb0793f2cdbdd3d596 100644 (file)
@@ -462,6 +462,7 @@ alloc_new:
        io->last_block_in_bio = blk_addr;
 
        mutex_unlock(&io->io_mutex);
+       trace_f2fs_submit_read_page(page, rw, META, blk_addr);
 }
 
 /*
index 38c1a89f54cca74ab982a88dd6c48a53a91fb2e0..d42426dc3706bc0a012a20f8c9abdec052450f92 100644 (file)
@@ -923,7 +923,7 @@ retry:
        io->last_block_in_bio = blk_addr;
 
        mutex_unlock(&io->io_mutex);
-       trace_f2fs_submit_write_page(page, blk_addr, type);
+       trace_f2fs_submit_write_page(page, WRITE, type, blk_addr);
 }
 
 void f2fs_wait_on_page_writeback(struct page *page,
index 47ee70de7fedd0f72e1e0588234b3e7dab18ed2b..73cc5f07d1babaa0179bb0520e0be17dbd37fa76 100644 (file)
@@ -674,15 +674,16 @@ DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
        TP_ARGS(page, type)
 );
 
-TRACE_EVENT(f2fs_submit_write_page,
+DECLARE_EVENT_CLASS(f2fs_io_page,
 
-       TP_PROTO(struct page *page, block_t blk_addr, int type),
+       TP_PROTO(struct page *page, int rw, int type, block_t blk_addr),
 
-       TP_ARGS(page, blk_addr, type),
+       TP_ARGS(page, rw, type, blk_addr),
 
        TP_STRUCT__entry(
                __field(dev_t,  dev)
                __field(ino_t,  ino)
+               __field(int, rw)
                __field(int, type)
                __field(pgoff_t, index)
                __field(block_t, block)
@@ -691,18 +692,34 @@ TRACE_EVENT(f2fs_submit_write_page,
        TP_fast_assign(
                __entry->dev    = page->mapping->host->i_sb->s_dev;
                __entry->ino    = page->mapping->host->i_ino;
+               __entry->rw     = rw;
                __entry->type   = type;
                __entry->index  = page->index;
                __entry->block  = blk_addr;
        ),
 
-       TP_printk("dev = (%d,%d), ino = %lu, %s, index = %lu, blkaddr = 0x%llx",
+       TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, blkaddr = 0x%llx",
                show_dev_ino(__entry),
+               show_bio_type(__entry->rw),
                show_block_type(__entry->type),
                (unsigned long)__entry->index,
                (unsigned long long)__entry->block)
 );
 
+DEFINE_EVENT(f2fs_io_page, f2fs_submit_write_page,
+
+       TP_PROTO(struct page *page, int rw, int type, block_t blk_addr),
+
+       TP_ARGS(page, rw, type, blk_addr)
+);
+
+DEFINE_EVENT(f2fs_io_page, f2fs_submit_read_page,
+
+       TP_PROTO(struct page *page, int rw, int type, block_t blk_addr),
+
+       TP_ARGS(page, rw, type, blk_addr)
+);
+
 TRACE_EVENT(f2fs_write_checkpoint,
 
        TP_PROTO(struct super_block *sb, bool is_umount, char *msg),