Commit 297604c9 authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Add a few tracepoints

Transaction restart tracing should probably be overhaulled at some
point.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent f270667a
...@@ -1555,8 +1555,10 @@ int bch2_btree_split_leaf(struct bch_fs *c, struct btree_iter *iter, ...@@ -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: */ /* Hack, because gc and splitting nodes doesn't mix yet: */
if (!(flags & BTREE_INSERT_GC_LOCK_HELD) && if (!(flags & BTREE_INSERT_GC_LOCK_HELD) &&
!down_read_trylock(&c->gc_lock)) { !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; return -EINTR;
}
bch2_trans_unlock(trans); bch2_trans_unlock(trans);
down_read(&c->gc_lock); down_read(&c->gc_lock);
...@@ -1584,6 +1586,8 @@ int bch2_btree_split_leaf(struct bch_fs *c, struct btree_iter *iter, ...@@ -1584,6 +1586,8 @@ int bch2_btree_split_leaf(struct bch_fs *c, struct btree_iter *iter,
BUG_ON(flags & BTREE_INSERT_NOUNLOCK); BUG_ON(flags & BTREE_INSERT_NOUNLOCK);
bch2_trans_unlock(trans); bch2_trans_unlock(trans);
ret = -EINTR; ret = -EINTR;
trace_transaction_restart_ip(trans->ip, _THIS_IP_);
} }
goto out; goto out;
} }
......
...@@ -499,6 +499,23 @@ TRACE_EVENT(copygc, ...@@ -499,6 +499,23 @@ TRACE_EVENT(copygc,
__entry->buckets_moved, __entry->buckets_not_moved) __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, DECLARE_EVENT_CLASS(transaction_restart,
TP_PROTO(unsigned long ip), TP_PROTO(unsigned long ip),
TP_ARGS(ip), TP_ARGS(ip),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment