aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2020-04-11 12:32:27 -0400
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:08:38 -0400
commit297604c92337cd546f41a38f53d420093f7ce963 (patch)
tree68253e8e94a308bfebe7b55f265d84cdbe6d72b3
parentbcachefs: Slightly reduce btree split threshold (diff)
downloadlinux-297604c92337cd546f41a38f53d420093f7ce963.tar.gz
linux-297604c92337cd546f41a38f53d420093f7ce963.tar.bz2
linux-297604c92337cd546f41a38f53d420093f7ce963.zip
bcachefs: Add a few tracepoints
Transaction restart tracing should probably be overhaulled at some point. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/btree_update_interior.c6
-rw-r--r--fs/bcachefs/trace.h17
2 files changed, 22 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c
index 772595b3da9f..153d13b9c96e 100644
--- a/fs/bcachefs/btree_update_interior.c
+++ b/fs/bcachefs/btree_update_interior.c
@@ -1555,8 +1555,10 @@ int bch2_btree_split_leaf(struct bch_fs *c, struct btree_iter *iter,
/* Hack, because gc and splitting nodes doesn't mix yet: */
if (!(flags & BTREE_INSERT_GC_LOCK_HELD) &&
!down_read_trylock(&c->gc_lock)) {
- if (flags & BTREE_INSERT_NOUNLOCK)
+ if (flags & BTREE_INSERT_NOUNLOCK) {
+ trace_transaction_restart_ip(trans->ip, _THIS_IP_);
return -EINTR;
+ }
bch2_trans_unlock(trans);
down_read(&c->gc_lock);
@@ -1584,6 +1586,8 @@ int bch2_btree_split_leaf(struct bch_fs *c, struct btree_iter *iter,
BUG_ON(flags & BTREE_INSERT_NOUNLOCK);
bch2_trans_unlock(trans);
ret = -EINTR;
+
+ trace_transaction_restart_ip(trans->ip, _THIS_IP_);
}
goto out;
}
diff --git a/fs/bcachefs/trace.h b/fs/bcachefs/trace.h
index a9fcb5442186..d109ef174fd0 100644
--- a/fs/bcachefs/trace.h
+++ b/fs/bcachefs/trace.h
@@ -499,6 +499,23 @@ TRACE_EVENT(copygc,
__entry->buckets_moved, __entry->buckets_not_moved)
);
+TRACE_EVENT(transaction_restart_ip,
+ TP_PROTO(unsigned long caller, unsigned long ip),
+ TP_ARGS(caller, ip),
+
+ TP_STRUCT__entry(
+ __field(unsigned long, caller )
+ __field(unsigned long, ip )
+ ),
+
+ TP_fast_assign(
+ __entry->caller = caller;
+ __entry->ip = ip;
+ ),
+
+ TP_printk("%pF %pF", (void *) __entry->caller, (void *) __entry->ip)
+);
+
DECLARE_EVENT_CLASS(transaction_restart,
TP_PROTO(unsigned long ip),
TP_ARGS(ip),