Skip to contentSkip to conversation

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

PATCH In review Namjae Jeon 2 participants 2 messages Apr 19, 2013 – Apr 23, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v4 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              |   16 +++++++++--
 include/trace/events/f2fs.h |   63 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 77 insertions(+), 2 deletions(-)
fs/f2fs/data.c +14 -2
index ea200d9..394ab68 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:
@@ -349,6 +350,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, blk_addr, type);
+
 	down_read(&sbi->bio_sem);
 
 	/* Allocate a new bio */
@@ -389,14 +392,20 @@ static int get_data_block_ro(struct inode *inode, sector_t iblock,
 	/* Get the page offset from the block offset(iblock) */
 	pgofs =	(pgoff_t)(iblock >> (PAGE_CACHE_SHIFT - blkbits));
 
-	if (check_extent_cache(inode, pgofs, bh_result))
+	if (check_extent_cache(inode, pgofs, bh_result)) {
+		trace_f2fs_get_data_block(inode, iblock, bh_result->b_blocknr,
+							 bh_result->b_size, 0);
 		return 0;
+	}
 
 	/* 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(inode, iblock, bh_result->b_blocknr,
+							bh_result->b_size, err);
 		return (err == -ENOENT) ? 0 : err;
+	}
 
 	/* It does not support data allocation */
 	BUG_ON(create);
@@ -421,6 +430,9 @@ 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(inode, iblock, bh_result->b_blocknr,
+							bh_result->b_size, err);
+
 	return 0;
 }
 
include/trace/events/f2fs.h +63 -0

69 lines not on this page · raw message

Signature · 1 line
1.7.9.5
Acked-by Steven Rostedt on v4 3/7
#1 lore raw

From 848753aa3b19a6513315ca54f22ba1e2732ea94a Mon Sep 17 00:00:00 2001
From: Namjae Jeon <[email protected]>
Date: Tue, 23 Apr 2013 16:38:02 +0900
Subject: [PATCH 3/7] f2fs: add tracepoint for tracing the page i/o
Cc: [email protected], [email protected], [email protected]

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

[Jaegeuk: combine and modify the tracepoint structures]
---
 fs/f2fs/data.c              | 12 ++++++--
 include/trace/events/f2fs.h | 74
+++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 84 insertions(+), 2 deletions(-)
fs/f2fs/data.c +1 -0
index 3c31ec7..8e8b14d 100644
@@ -21,6 +21,7 @@
 #include "f2fs.h"
 #include "node.h"
 #include "segment.h"
+#include <trace/events/f2fs.h>
 
 /*
  * Lock ordering for the change of data block address:
@@ -348,6 +349,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, blk_addr, type);
+
down_read(&sbi->bio_sem);

/* Allocate a new bio */
@@ -388,14 +391,18 @@ static int get_data_block_ro(struct inode *inode, sector_t iblock,
/* Get the page offset from the block offset(iblock) */
pgofs = (pgoff_t)(iblock >> (PAGE_CACHE_SHIFT - blkbits));

- if (check_extent_cache(inode, pgofs, bh_result))
+ if (check_extent_cache(inode, pgofs, bh_result)) {
+ trace_f2fs_get_data_block(inode, iblock, bh_result, 0);
return 0;
+ }

/* 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(inode, iblock, bh_result, err);
return (err == -ENOENT) ? 0 : err;
+ }

/* It does not support data allocation */ BUG_ON(create);
@@ -420,6 +427,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(inode, iblock, bh_result, 0);
return 0;
}

include/trace/events/f2fs.h +74 -0

86 lines not on this page · raw message

Signature · 6 lines
1.8.1.3.566.gaa39828


-- 
Jaegeuk Kim
Samsung