Skip to contentSkip to conversation

f2fs: add tracepoints to debug the block allocation and fallocate

PATCH Superseded Namjae Jeon 1 participant 1 message Mar 17, 2013

Subsystems (3)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 5/7 f2fs: add tracepoints to debug the block allocation and fallocate

From: Namjae Jeon <[email protected]>

Add tracepoints to debug the block allocation and fallocate.

---
 fs/f2fs/data.c              |    1 +
 fs/f2fs/file.c              |    3 ++
 include/trace/events/f2fs.h |   76 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 80 insertions(+)
fs/f2fs/data.c +1 -0
index bb9117b..0f928b7 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);
 	__set_data_blkaddr(dn, NEW_ADDR);
 	dn->data_blkaddr = NEW_ADDR;
 	sync_inode_page(dn);
fs/f2fs/file.c +3 -0
index 77262e0..9566f21 100644
@@ -554,6 +554,7 @@ static long f2fs_fallocate(struct file *file, int mode,
 	struct inode *inode = file_inode(file);
 	long ret;
 
+	trace_f2fs_fallocate_enter(inode, offset, len, mode);
 	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
 		return -EOPNOTSUPP;
 
@@ -566,6 +567,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_exit(inode, offset, len, ret);
 	return ret;
 }
 
include/trace/events/f2fs.h +76 -0

82 lines not on this page · raw message

Signature · 1 line
1.7.9.5