summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2026-05-07 11:17:55 +0100
committerFilipe Manana <fdmanana@suse.com>2026-06-09 11:49:23 +0100
commitaa0487b003a814beedd1af32b79478d834d15b2d (patch)
tree78ae21c00cd2873d60aa80bf5e0aa08eee579fbe /include/trace
parentbb10bfba7526f6c1fc27dc60bd4f53b213dc3102 (diff)
downloadlwn-aa0487b003a814beedd1af32b79478d834d15b2d.tar.gz
lwn-aa0487b003a814beedd1af32b79478d834d15b2d.zip
btrfs: tracepoints: add trace event for add_conflicting_inode()
add_conflicting_inode() 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>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/btrfs.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index c13c1ce0b344..ad18b09fb3cd 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -1228,6 +1228,72 @@ TRACE_EVENT(btrfs_log_new_dir_dentries_exit,
__entry->transid, __entry->ret)
);
+TRACE_EVENT(btrfs_add_conflicting_inode_enter,
+
+ TP_PROTO(const struct btrfs_trans_handle *trans,
+ const struct btrfs_log_ctx *ctx,
+ u64 ino, u64 parent),
+
+ TP_ARGS(trans, ctx, ino, parent),
+
+ TP_STRUCT__entry_btrfs(
+ __field( u64, root_objectid )
+ __field( u64, transid )
+ __field( u64, ctx_ino )
+ __field( u64, conflict_ino )
+ __field( u64, conflict_ino_parent )
+ ),
+
+ TP_fast_assign(
+ TP_fast_assign_fsid(trans->fs_info);
+ __entry->root_objectid = btrfs_root_id(ctx->inode->root);
+ __entry->transid = trans->transid;
+ __entry->ctx_ino = btrfs_ino(ctx->inode);
+ __entry->conflict_ino = ino;
+ __entry->conflict_ino_parent = parent;
+ ),
+
+ TP_printk_btrfs("root=%llu(%s) transid=%llu ctx_ino=%llu conflict_ino=%llu"
+ " conflict_ino_parent=%llu",
+ show_root_type(__entry->root_objectid), __entry->transid,
+ __entry->ctx_ino, __entry->conflict_ino,
+ __entry->conflict_ino_parent)
+);
+
+TRACE_EVENT(btrfs_add_conflicting_inode_exit,
+
+ TP_PROTO(const struct btrfs_trans_handle *trans,
+ const struct btrfs_log_ctx *ctx,
+ u64 ino, u64 parent, int ret),
+
+ TP_ARGS(trans, ctx, ino, parent, ret),
+
+ TP_STRUCT__entry_btrfs(
+ __field( u64, root_objectid )
+ __field( u64, transid )
+ __field( u64, ctx_ino )
+ __field( u64, conflict_ino )
+ __field( u64, conflict_ino_parent )
+ __field( int, ret )
+ ),
+
+ TP_fast_assign(
+ TP_fast_assign_fsid(trans->fs_info);
+ __entry->root_objectid = btrfs_root_id(ctx->inode->root);
+ __entry->transid = trans->transid;
+ __entry->ctx_ino = btrfs_ino(ctx->inode);
+ __entry->conflict_ino = ino;
+ __entry->conflict_ino_parent = parent;
+ __entry->ret = ret;
+ ),
+
+ TP_printk_btrfs("root=%llu(%s) transid=%llu ctx_ino=%llu conflict_ino=%llu"
+ " conflict_ino_parent=%llu ret=%d",
+ show_root_type(__entry->root_objectid), __entry->transid,
+ __entry->ctx_ino, __entry->conflict_ino,
+ __entry->conflict_ino_parent, __entry->ret)
+);
+
TRACE_EVENT(btrfs_sync_fs,
TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),