aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
authorFilipe Manana <fdmanana@suse.com>2026-05-08 17:09:48 +0100
committerDavid Sterba <dsterba@suse.com>2026-05-24 03:01:09 +0200
commitb118d401f662190dec0e2b82906934940ea97b35 (patch)
treecce1240a93bb3b3c131920130184d0aaa0dd75b7 /fs
parenta34c4d8dda4d7e93fe411a2217e0dfbc7418aba8 (diff)
downloadlinux-next-history-b118d401f662190dec0e2b82906934940ea97b35.tar.gz
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>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/tree-log.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 6be98f8a3b43e..7a1cd93c45824 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -6845,6 +6845,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) {
@@ -6887,6 +6896,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;
}