f2fs: add a tracepoint on f2fs_new_inode
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Thu, 25 Apr 2013 04:24:33 +0000 (13:24 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 29 Apr 2013 01:52:01 +0000 (10:52 +0900)
This can help when debugging the free nid allocation flows.

Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/namei.c
include/trace/events/f2fs.h

index c57fd18..4aa26e5 100644 (file)
@@ -63,7 +63,7 @@ static struct inode *f2fs_new_inode(struct inode *dir, umode_t mode)
                nid_free = true;
                goto out;
        }
-
+       trace_f2fs_new_inode(inode, 0);
        mark_inode_dirty(inode);
        return inode;
 
@@ -71,6 +71,7 @@ out:
        clear_nlink(inode);
        unlock_new_inode(inode);
 fail:
+       trace_f2fs_new_inode(inode, err);
        iput(inode);
        if (nid_free)
                alloc_nid_failed(sbi, ino);
index b2b2f72..52ae548 100644 (file)
@@ -197,6 +197,13 @@ DEFINE_EVENT(f2fs__inode, f2fs_evict_inode,
        TP_ARGS(inode)
 );
 
+DEFINE_EVENT(f2fs__inode_exit, f2fs_new_inode,
+
+       TP_PROTO(struct inode *inode, int ret),
+
+       TP_ARGS(inode, ret)
+);
+
 TRACE_EVENT(f2fs_unlink_enter,
 
        TP_PROTO(struct inode *dir, struct dentry *dentry),