diff options
| author | Filipe Manana <fdmanana@suse.com> | 2026-04-30 16:05:56 +0100 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-05-24 03:01:08 +0200 |
| commit | 7b1af54baecfec39c20bc7f87120de9811c6d77a (patch) | |
| tree | eb49f00ad027adc6cdbd0faf78fa03fe3468b066 /fs | |
| parent | a51d89f183838deaf918e10b4d2dd0389e1c6c02 (diff) | |
| download | linux-next-history-7b1af54baecfec39c20bc7f87120de9811c6d77a.tar.gz | |
btrfs: tracepoints: add trace event for btrfs_log_inode()
btrfs_log_inode() is one of the most important steps 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/super.c | 1 | ||||
| -rw-r--r-- | fs/btrfs/tree-log.c | 16 |
2 files changed, 12 insertions, 5 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index fb15decb08618..9de67276a8edd 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -60,6 +60,7 @@ #include "verity.h" #include "super.h" #include "extent-tree.h" +#include "tree-log.h" #define CREATE_TRACE_POINTS #include <trace/events/btrfs.h> diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 70795cd76d6f3..22066635f75f3 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -6884,7 +6884,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, struct btrfs_log_ctx *ctx) { struct btrfs_path *path; - struct btrfs_path *dst_path; + struct btrfs_path *dst_path = NULL; struct btrfs_key min_key; struct btrfs_key max_key; struct btrfs_root *log = inode->root->log_root; @@ -6900,13 +6900,17 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, LIST_HEAD(delayed_ins_list); LIST_HEAD(delayed_del_list); + trace_btrfs_log_inode_enter(trans, inode, ctx, log_mode); + path = btrfs_alloc_path(); - if (!path) - return -ENOMEM; + if (!path) { + ret = -ENOMEM; + goto out; + } dst_path = btrfs_alloc_path(); if (!dst_path) { - btrfs_free_path(path); - return -ENOMEM; + ret = -ENOMEM; + goto out; } min_key.objectid = ino; @@ -7221,6 +7225,8 @@ out: &delayed_del_list); } + trace_btrfs_log_inode_exit(trans, inode, ret); + return ret; } |
