bcachefs: Improve trans_restart_journal_preres_get tracepoint

It now includes journal_flags.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2022-08-27 12:23:38 -04:00
parent 5f1dd9a633
commit ce56bf7fc2
3 changed files with 23 additions and 5 deletions

View File

@ -1053,7 +1053,7 @@ bch2_btree_update_start(struct btree_trans *trans, struct btree_path *path,
BTREE_UPDATE_JOURNAL_RES,
journal_flags);
if (ret) {
trace_trans_restart_journal_preres_get(trans, _RET_IP_);
trace_trans_restart_journal_preres_get(trans, _RET_IP_, journal_flags);
ret = btree_trans_restart(trans, BCH_ERR_transaction_restart_journal_preres_get);
goto err;
}

View File

@ -285,7 +285,7 @@ bch2_trans_journal_preres_get_cold(struct btree_trans *trans, unsigned u64s,
ret = bch2_trans_relock(trans);
if (ret) {
trace_trans_restart_journal_preres_get(trans, trace_ip);
trace_trans_restart_journal_preres_get(trans, trace_ip, 0);
return ret;
}

View File

@ -781,10 +781,28 @@ DEFINE_EVENT(transaction_event, trans_restart_journal_res_get,
TP_ARGS(trans, caller_ip)
);
DEFINE_EVENT(transaction_event, trans_restart_journal_preres_get,
TRACE_EVENT(trans_restart_journal_preres_get,
TP_PROTO(struct btree_trans *trans,
unsigned long caller_ip),
TP_ARGS(trans, caller_ip)
unsigned long caller_ip,
unsigned flags),
TP_ARGS(trans, caller_ip, flags),
TP_STRUCT__entry(
__array(char, trans_fn, 32 )
__field(unsigned long, caller_ip )
__field(unsigned, flags )
),
TP_fast_assign(
strlcpy(__entry->trans_fn, trans->fn, sizeof(__entry->trans_fn));
__entry->caller_ip = caller_ip;
__entry->flags = flags;
),
TP_printk("%s %pS %x", __entry->trans_fn,
(void *) __entry->caller_ip,
__entry->flags)
);
DEFINE_EVENT(transaction_event, trans_restart_journal_reclaim,