From: Filipe Manana Date: Mon, 11 May 2026 15:13:18 +0000 (+0100) Subject: btrfs: tracepoints: add trace event for btrfs_record_new_subvolume() X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=4f065ebdf8c5ad477dc7be57c76e0fcb50670a6c;p=thirdparty%2Flinux.git btrfs: tracepoints: add trace event for btrfs_record_new_subvolume() btrfs_record_new_subvolume() is an important operation that affects inode logging and is called during subvolume creation. Add a trace event for it to help debug issues. Reviewed-by: Johannes Thumshirn Signed-off-by: Filipe Manana Signed-off-by: David Sterba --- diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 7f014e6be4b71..3f3c87f580b3d 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -8024,6 +8024,8 @@ void btrfs_record_snapshot_destroy(struct btrfs_trans_handle *trans, void btrfs_record_new_subvolume(const struct btrfs_trans_handle *trans, struct btrfs_inode *dir) { + trace_btrfs_record_new_subvolume(trans, dir); + mutex_lock(&dir->log_mutex); dir->last_unlink_trans = trans->transid; mutex_unlock(&dir->log_mutex); diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h index a14a8d32a6f18..47e6f382e22ab 100644 --- a/include/trace/events/btrfs.h +++ b/include/trace/events/btrfs.h @@ -1456,6 +1456,31 @@ TRACE_EVENT(btrfs_record_snapshot_destroy, __entry->dir) ); +TRACE_EVENT(btrfs_record_new_subvolume, + + TP_PROTO(const struct btrfs_trans_handle *trans, + const struct btrfs_inode *dir), + + TP_ARGS(trans, dir), + + TP_STRUCT__entry_btrfs( + __field( u64, root_objectid ) + __field( u64, transid ) + __field( u64, dir ) + ), + + TP_fast_assign( + TP_fast_assign_fsid(trans->fs_info); + __entry->root_objectid = btrfs_root_id(dir->root); + __entry->transid = trans->transid; + __entry->dir = btrfs_ino(dir); + ), + + TP_printk_btrfs("root=%llu(%s) transid=%llu dir=%llu", + show_root_type(__entry->root_objectid), __entry->transid, + __entry->dir) +); + TRACE_EVENT(btrfs_sync_fs, TP_PROTO(const struct btrfs_fs_info *fs_info, int wait),