summaryrefslogtreecommitdiff
path: root/fs/bcachefs/trace.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-17 20:22:30 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:37 -0400
commita0cb8d784f309d22323974e47b103bf01d0b62c0 (patch)
tree9c7cab02e1fddbe1a4224b6c17f24a6a4eb8cc2f /fs/bcachefs/trace.h
parent549d173c1bd9b58c2ad41217522462e012a6545f (diff)
bcachefs: Inject transaction restarts in debug mode
In CONFIG_BCACHEFS_DEBUG mode, we'll now randomly issue transaction restarts - with a decaying probability based on the number of restarts we've already had, to ensure that transactions eventually make forward progress. This should help shake out some bugs. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/trace.h')
-rw-r--r--fs/bcachefs/trace.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/bcachefs/trace.h b/fs/bcachefs/trace.h
index a52da91f279e..1e9e93161509 100644
--- a/fs/bcachefs/trace.h
+++ b/fs/bcachefs/trace.h
@@ -707,6 +707,12 @@ DEFINE_EVENT(transaction_event, transaction_restart_ip,
TP_ARGS(trans_fn, caller_ip)
);
+DEFINE_EVENT(transaction_event, transaction_restart_injected,
+ TP_PROTO(const char *trans_fn,
+ unsigned long caller_ip),
+ TP_ARGS(trans_fn, caller_ip)
+);
+
DEFINE_EVENT(transaction_event, trans_blocked_journal_reclaim,
TP_PROTO(const char *trans_fn,
unsigned long caller_ip),