mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 01:55:51 +02:00
btrfs: tracepoints: add trace event for log_new_dir_dentries()
log_new_dir_dentries() is an important step called during a fsync, as well as during rename and link operations on inodes that were previously logged. Add trace events for when entering and exiting that function. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
e61574f1a9
commit
bb10bfba75
|
|
@ -5902,9 +5902,13 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans,
|
|||
struct btrfs_inode *curr_inode = start_inode;
|
||||
int ret = 0;
|
||||
|
||||
trace_btrfs_log_new_dir_dentries_enter(trans, start_inode);
|
||||
|
||||
path = btrfs_alloc_path();
|
||||
if (!path)
|
||||
return -ENOMEM;
|
||||
if (!path) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Pairs with btrfs_add_delayed_iput below. */
|
||||
ihold(&curr_inode->vfs_inode);
|
||||
|
|
@ -6023,6 +6027,8 @@ static int log_new_dir_dentries(struct btrfs_trans_handle *trans,
|
|||
kfree(dir_elem);
|
||||
}
|
||||
|
||||
trace_btrfs_log_new_dir_dentries_exit(trans, start_inode, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1175,6 +1175,59 @@ TRACE_EVENT(btrfs_log_all_new_ancestors_exit,
|
|||
__entry->transid, __entry->ret)
|
||||
);
|
||||
|
||||
TRACE_EVENT(btrfs_log_new_dir_dentries_enter,
|
||||
|
||||
TP_PROTO(const struct btrfs_trans_handle *trans,
|
||||
const struct btrfs_inode *inode),
|
||||
|
||||
TP_ARGS(trans, inode),
|
||||
|
||||
TP_STRUCT__entry_btrfs(
|
||||
__field( u64, root_objectid )
|
||||
__field( u64, ino )
|
||||
__field( u64, transid )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
TP_fast_assign_fsid(inode->root->fs_info);
|
||||
__entry->root_objectid = btrfs_root_id(inode->root);
|
||||
__entry->ino = btrfs_ino(inode);
|
||||
__entry->transid = trans->transid;
|
||||
),
|
||||
|
||||
TP_printk_btrfs("root=%llu(%s) ino=%llu transid=%llu",
|
||||
show_root_type(__entry->root_objectid), __entry->ino,
|
||||
__entry->transid)
|
||||
);
|
||||
|
||||
TRACE_EVENT(btrfs_log_new_dir_dentries_exit,
|
||||
|
||||
TP_PROTO(const struct btrfs_trans_handle *trans,
|
||||
const struct btrfs_inode *inode,
|
||||
int ret),
|
||||
|
||||
TP_ARGS(trans, inode, ret),
|
||||
|
||||
TP_STRUCT__entry_btrfs(
|
||||
__field( u64, root_objectid )
|
||||
__field( u64, ino )
|
||||
__field( u64, transid )
|
||||
__field( int, ret )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
TP_fast_assign_fsid(inode->root->fs_info);
|
||||
__entry->root_objectid = btrfs_root_id(inode->root);
|
||||
__entry->ino = btrfs_ino(inode);
|
||||
__entry->transid = trans->transid;
|
||||
__entry->ret = ret;
|
||||
),
|
||||
|
||||
TP_printk_btrfs("root=%llu(%s) ino=%llu transid=%llu ret=%d",
|
||||
show_root_type(__entry->root_objectid), __entry->ino,
|
||||
__entry->transid, __entry->ret)
|
||||
);
|
||||
|
||||
TRACE_EVENT(btrfs_sync_fs,
|
||||
|
||||
TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user