mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 03:27:30 -04:00
btrfs: tracepoints: add trace event for log_new_delayed_dentries()
log_new_delayed_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:
@@ -6844,6 +6844,15 @@ static int log_new_delayed_dentries(struct btrfs_trans_handle *trans,
|
||||
lockdep_assert_not_held(&inode->log_mutex);
|
||||
|
||||
ASSERT(!ctx->logging_new_delayed_dentries);
|
||||
|
||||
/*
|
||||
* Return early if empty list, avoid emitting redundant trace events
|
||||
* that generate noise only.
|
||||
*/
|
||||
if (list_empty(delayed_ins_list))
|
||||
return 0;
|
||||
|
||||
trace_btrfs_log_new_delayed_dentries_enter(trans, inode);
|
||||
ctx->logging_new_delayed_dentries = true;
|
||||
|
||||
list_for_each_entry(item, delayed_ins_list, log_list) {
|
||||
@@ -6886,6 +6895,7 @@ static int log_new_delayed_dentries(struct btrfs_trans_handle *trans,
|
||||
|
||||
ctx->log_new_dentries = orig_log_new_dentries;
|
||||
ctx->logging_new_delayed_dentries = false;
|
||||
trace_btrfs_log_new_delayed_dentries_exit(trans, inode, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1347,6 +1347,59 @@ TRACE_EVENT(btrfs_log_conflicting_inodes_exit,
|
||||
__entry->ctx_ino, __entry->ret)
|
||||
);
|
||||
|
||||
TRACE_EVENT(btrfs_log_new_delayed_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, transid )
|
||||
__field( u64, ino )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
TP_fast_assign_fsid(trans->fs_info);
|
||||
__entry->root_objectid = btrfs_root_id(inode->root);
|
||||
__entry->transid = trans->transid;
|
||||
__entry->ino = btrfs_ino(inode);
|
||||
),
|
||||
|
||||
TP_printk_btrfs("root=%llu(%s) transid=%llu ino=%llu",
|
||||
show_root_type(__entry->root_objectid), __entry->transid,
|
||||
__entry->ino)
|
||||
);
|
||||
|
||||
TRACE_EVENT(btrfs_log_new_delayed_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, transid )
|
||||
__field( u64, ino )
|
||||
__field( int, ret )
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
TP_fast_assign_fsid(trans->fs_info);
|
||||
__entry->root_objectid = btrfs_root_id(inode->root);
|
||||
__entry->transid = trans->transid;
|
||||
__entry->ino = btrfs_ino(inode);
|
||||
__entry->ret = ret;
|
||||
),
|
||||
|
||||
TP_printk_btrfs("root=%llu(%s) transid=%llu ino=%llu ret=%d",
|
||||
show_root_type(__entry->root_objectid), __entry->transid,
|
||||
__entry->ino, __entry->ret)
|
||||
);
|
||||
|
||||
TRACE_EVENT(btrfs_sync_fs,
|
||||
|
||||
TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),
|
||||
|
||||
Reference in New Issue
Block a user