mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
btrfs: tracepoints: add trace event for btrfs_record_unlink_dir()
btrfs_record_unlink_dir() is an important operation that affects inode logging and is called during unlink and rename operations. Add a trace event for it to help debug issues. 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:
@@ -7938,6 +7938,8 @@ void btrfs_record_unlink_dir(struct btrfs_trans_handle *trans,
|
||||
struct btrfs_inode *dir, struct btrfs_inode *inode,
|
||||
bool for_rename)
|
||||
{
|
||||
trace_btrfs_record_unlink_dir(trans, dir, inode, for_rename);
|
||||
|
||||
/*
|
||||
* when we're logging a file, if it hasn't been renamed
|
||||
* or unlinked, and its inode is fully committed on disk,
|
||||
|
||||
@@ -1400,6 +1400,37 @@ TRACE_EVENT(btrfs_log_new_delayed_dentries_exit,
|
||||
__entry->ino, __entry->ret)
|
||||
);
|
||||
|
||||
TRACE_EVENT(btrfs_record_unlink_dir,
|
||||
|
||||
TP_PROTO(const struct btrfs_trans_handle *trans,
|
||||
const struct btrfs_inode *dir,
|
||||
const struct btrfs_inode *inode,
|
||||
bool for_rename),
|
||||
|
||||
TP_ARGS(trans, dir, inode, for_rename),
|
||||
|
||||
TP_STRUCT__entry_btrfs(
|
||||
__field( u64, root_objectid )
|
||||
__field( u64, transid )
|
||||
__field( u64, ino )
|
||||
__field( u64, dir )
|
||||
__field( bool, for_rename )
|
||||
),
|
||||
|
||||
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->dir = btrfs_ino(dir);
|
||||
__entry->for_rename = for_rename;
|
||||
),
|
||||
|
||||
TP_printk_btrfs("root=%llu(%s) transid=%llu ino=%llu dir=%llu for_rename=%d",
|
||||
show_root_type(__entry->root_objectid), __entry->transid,
|
||||
__entry->ino, __entry->dir, __entry->for_rename)
|
||||
);
|
||||
|
||||
TRACE_EVENT(btrfs_sync_fs,
|
||||
|
||||
TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),
|
||||
|
||||
Reference in New Issue
Block a user