diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-02 04:51:51 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 23:09:49 +0200 |
commit | adf6360b5d6071ea268fa6f5f03befba4909ffaa (patch) | |
tree | 5b9a65159e4494ee463b1c5ee8118991215e7f70 /fs/bcachefs | |
parent | bcachefs: Fix bch2_bucket_alloc_early() (diff) | |
download | linux-adf6360b5d6071ea268fa6f5f03befba4909ffaa.tar.xz linux-adf6360b5d6071ea268fa6f5f03befba4909ffaa.zip |
bcachefs: Improve btree_reserve_get_fail tracepoint
Now we include the return code.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r-- | fs/bcachefs/btree_update_interior.c | 3 | ||||
-rw-r--r-- | fs/bcachefs/trace.h | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/fs/bcachefs/btree_update_interior.c b/fs/bcachefs/btree_update_interior.c index d2e785b9c835..566838317845 100644 --- a/fs/bcachefs/btree_update_interior.c +++ b/fs/bcachefs/btree_update_interior.c @@ -1167,7 +1167,8 @@ bch2_btree_update_start(struct btree_trans *trans, struct btree_path *path, } if (ret) { - trace_and_count(c, btree_reserve_get_fail, trans->fn, _RET_IP_, nr_nodes[0] + nr_nodes[1]); + trace_and_count(c, btree_reserve_get_fail, trans->fn, + _RET_IP_, nr_nodes[0] + nr_nodes[1], ret); goto err; } diff --git a/fs/bcachefs/trace.h b/fs/bcachefs/trace.h index 7004da8d341f..17fc58e73702 100644 --- a/fs/bcachefs/trace.h +++ b/fs/bcachefs/trace.h @@ -344,25 +344,29 @@ DEFINE_EVENT(btree_node, btree_node_free, TRACE_EVENT(btree_reserve_get_fail, TP_PROTO(const char *trans_fn, unsigned long caller_ip, - size_t required), - TP_ARGS(trans_fn, caller_ip, required), + size_t required, + int ret), + TP_ARGS(trans_fn, caller_ip, required, ret), TP_STRUCT__entry( __array(char, trans_fn, 32 ) __field(unsigned long, caller_ip ) __field(size_t, required ) + __array(char, ret, 32 ) ), TP_fast_assign( strscpy(__entry->trans_fn, trans_fn, sizeof(__entry->trans_fn)); __entry->caller_ip = caller_ip; __entry->required = required; + strscpy(__entry->ret, bch2_err_str(ret), sizeof(__entry->ret)); ), - TP_printk("%s %pS required %zu", + TP_printk("%s %pS required %zu ret %s", __entry->trans_fn, (void *) __entry->caller_ip, - __entry->required) + __entry->required, + __entry->ret) ); DEFINE_EVENT(btree_node, btree_node_compact, |