summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2026-04-23 15:17:16 +0100
committerDavid Sterba <dsterba@suse.com>2026-06-08 15:53:33 +0200
commitb4bbe7d7591e65cf9cc4975ea124fc717df9f128 (patch)
treeca7189cb2c501103b6d1f5092da96d5b5c555999 /include
parent889ad3845a8c029e93a46251f78d61b277cf5e61 (diff)
downloadlwn-b4bbe7d7591e65cf9cc4975ea124fc717df9f128.tar.gz
lwn-b4bbe7d7591e65cf9cc4975ea124fc717df9f128.zip
btrfs: tracepoints: add trace event for transaction aborts
While tracing it's useful to know not just when a transaction is committed but also when one is aborted. So add a trace event for transaction aborts. 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')
-rw-r--r--include/trace/events/btrfs.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 4e077abd6704..cb9b6188fcdd 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -201,6 +201,28 @@ TRACE_EVENT(btrfs_transaction_commit,
__entry->in_fsync)
);
+TRACE_EVENT(btrfs_transaction_abort,
+
+ TP_PROTO(const struct btrfs_trans_handle *trans),
+
+ TP_ARGS(trans),
+
+ TP_STRUCT__entry_btrfs(
+ __field( u64, generation )
+ __field( bool, in_fsync )
+ __field( int, error )
+ ),
+
+ TP_fast_assign_btrfs(trans->fs_info,
+ __entry->generation = trans->transid;
+ __entry->in_fsync = trans->in_fsync;
+ __entry->error = trans->aborted;
+ ),
+
+ TP_printk_btrfs("gen=%llu in_fsync=%d error=%d", __entry->generation,
+ __entry->in_fsync, __entry->error)
+);
+
DECLARE_EVENT_CLASS(btrfs__inode,
TP_PROTO(const struct inode *inode),