Skip to contentSkip to conversation

f2fs: add tracepoint for tracing the page i/o operations

PATCH Superseded Namjae Jeon 1 participant 1 message Apr 6, 2013

Subsystems (3)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 3/7 f2fs: add tracepoint for tracing the page i/o operations

From: Namjae Jeon <[email protected]>

Add tracepoints for page i/o operations and block allocation tracing during page read operation.

---
 fs/f2fs/data.c              |    9 ++++++-
 include/trace/events/f2fs.h |   61 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 69 insertions(+), 1 deletion(-)
fs/f2fs/data.c +8 -1
index 4f4da0d..d5d5a7c 100644
@@ -22,6 +22,7 @@
 #include "f2fs.h"
 #include "node.h"
 #include "segment.h"
+#include <trace/events/f2fs.h>
 
 /*
  * Lock ordering for the change of data block address:
@@ -346,6 +347,8 @@ int f2fs_readpage(struct f2fs_sb_info *sbi, struct page *page,
 	struct block_device *bdev = sbi->sb->s_bdev;
 	struct bio *bio;
 
+	trace_f2fs_readpage(page);
+
 	down_read(&sbi->bio_sem);
 
 	/* Allocate a new bio */
@@ -383,6 +386,7 @@ static int get_data_block_ro(struct inode *inode, sector_t iblock,
 	pgoff_t pgofs;
 	int err;
 
+	trace_f2fs_get_data_block_enter(inode, iblock, 0);
 	/* Get the page offset from the block offset(iblock) */
 	pgofs =	(pgoff_t)(iblock >> (PAGE_CACHE_SHIFT - blkbits));
 
@@ -392,8 +396,10 @@ static int get_data_block_ro(struct inode *inode, sector_t iblock,
 	/* When reading holes, we need its node page */
 	set_new_dnode(&dn, inode, NULL, NULL, 0);
 	err = get_dnode_of_data(&dn, pgofs, LOOKUP_NODE_RA);
-	if (err)
+	if (err) {
+		trace_f2fs_get_data_block_exit(inode, iblock, err);
 		return (err == -ENOENT) ? 0 : err;
+	}
 
 	/* It does not support data allocation */
 	BUG_ON(create);
@@ -418,6 +424,7 @@ static int get_data_block_ro(struct inode *inode, sector_t iblock,
 		bh_result->b_size = (i << blkbits);
 	}
 	f2fs_put_dnode(&dn);
+	trace_f2fs_get_data_block_exit(inode, iblock, 0);
 	return 0;
 }
 
include/trace/events/f2fs.h +61 -0

67 lines not on this page · raw message

Signature · 1 line
1.7.9.5