Skip to contentSkip to conversation

f2fs: add tracepoints to debug the block allocation & fallocate

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 5/7 f2fs: add tracepoints to debug the block allocation & fallocate

From: Namjae Jeon <[email protected]>

Add tracepoints to debug the block allocation & fallocate.

---
 fs/f2fs/data.c              |    1 +
 fs/f2fs/file.c              |    6 ++++-
 include/trace/events/f2fs.h |   59 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 65 insertions(+), 1 deletion(-)
fs/f2fs/data.c +1 -0
index 394ab68..503b5bf 100644
@@ -56,6 +56,7 @@ int reserve_new_block(struct dnode_of_data *dn)
 	if (!inc_valid_block_count(sbi, dn->inode, 1))
 		return -ENOSPC;
 
+	trace_f2fs_reserve_new_block(dn->inode, dn->nid, dn->ofs_in_node);
 	__set_data_blkaddr(dn, NEW_ADDR);
 	dn->data_blkaddr = NEW_ADDR;
 	sync_inode_page(dn);
fs/f2fs/file.c +5 -1
index 31176d5..64eeb5a 100644
@@ -532,8 +532,10 @@ static long f2fs_fallocate(struct file *file, int mode,
 	struct inode *inode = file_inode(file);
 	long ret;
 
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
+	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE)) {
+		trace_f2fs_fallocate(inode, offset, len, mode, -EOPNOTSUPP);
 		return -EOPNOTSUPP;
+	}
 
 	if (mode & FALLOC_FL_PUNCH_HOLE)
 		ret = punch_hole(inode, offset, len, mode);
@@ -544,6 +546,8 @@ static long f2fs_fallocate(struct file *file, int mode,
 		inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 		mark_inode_dirty(inode);
 	}
+
+	trace_f2fs_fallocate(inode, offset, len, mode, ret);
 	return ret;
 }
 
include/trace/events/f2fs.h +59 -0

65 lines not on this page · raw message

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

From c01e285324793a86c2c90c8451ed6feb04b3d310 Mon Sep 17 00:00:00 2001
From: Namjae Jeon <[email protected]>
Date: Tue, 23 Apr 2013 17:00:52 +0900
Subject: [PATCH 5/7] f2fs: add tracepoints to debug the block allocation
Cc: [email protected], [email protected], [email protected]

Add tracepoints to debug the block allocation & fallocate.

---
 fs/f2fs/data.c              |  2 ++
 fs/f2fs/file.c              |  1 +
 include/trace/events/f2fs.h | 64
+++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+)
fs/f2fs/data.c +2 -0
index 8e8b14d..1220b5c 100644
@@ -55,6 +55,8 @@ int reserve_new_block(struct dnode_of_data *dn)
 	if (!inc_valid_block_count(sbi, dn->inode, 1))
 		return -ENOSPC;
 
+	trace_f2fs_reserve_new_block(dn->inode, dn->nid, dn->ofs_in_node);
+
 	__set_data_blkaddr(dn, NEW_ADDR);
 	dn->data_blkaddr = NEW_ADDR;
 	sync_inode_page(dn);
fs/f2fs/file.c +0 -0
index 71efa37..0e56db2 100644
@@ -546,6 +546,7 @@ static long f2fs_fallocate(struct file *file, int

mode,
inode->i_mtime = inode->i_ctime = CURRENT_TIME; mark_inode_dirty(inode);
}
+ trace_f2fs_fallocate(inode, mode, offset, len, ret);
return ret;
}

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

70 lines not on this page · raw message

Signature · 7 lines
1.8.1.3.566.gaa39828



-- 
Jaegeuk Kim
Samsung