From ae10fe017bf54653a61a93e49fac1c3e2b474e20 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 4 Nov 2022 16:06:55 -0400 Subject: bcachefs: bucket_alloc_state This refactoring puts our various allocation path counters into a dedicated struct - the upcoming nocow patch is going to add another counter. Signed-off-by: Kent Overstreet --- fs/bcachefs/trace.h | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'fs/bcachefs/trace.h') diff --git a/fs/bcachefs/trace.h b/fs/bcachefs/trace.h index 24d089507a21..b5f44c4e80d1 100644 --- a/fs/bcachefs/trace.h +++ b/fs/bcachefs/trace.h @@ -518,15 +518,12 @@ DECLARE_EVENT_CLASS(bucket_alloc, u64 avail, u64 copygc_wait_amount, s64 copygc_waiting_for, - u64 seen, - u64 open, - u64 need_journal_commit, - u64 nouse, + struct bucket_alloc_state *s, bool nonblocking, const char *err), TP_ARGS(ca, alloc_reserve, user, bucket, free, avail, copygc_wait_amount, copygc_waiting_for, - seen, open, need_journal_commit, nouse, nonblocking, err), + s, nonblocking, err), TP_STRUCT__entry( __field(dev_t, dev ) @@ -554,10 +551,10 @@ DECLARE_EVENT_CLASS(bucket_alloc, __entry->avail = avail; __entry->copygc_wait_amount = copygc_wait_amount; __entry->copygc_waiting_for = copygc_waiting_for; - __entry->seen = seen; - __entry->open = open; - __entry->need_journal_commit = need_journal_commit; - __entry->nouse = nouse; + __entry->seen = s->buckets_seen; + __entry->open = s->skipped_open; + __entry->need_journal_commit = s->skipped_need_journal_commit; + __entry->nouse = s->skipped_nouse; __entry->nonblocking = nonblocking; strlcpy(__entry->err, err, sizeof(__entry->err)); ), @@ -587,15 +584,12 @@ DEFINE_EVENT(bucket_alloc, bucket_alloc, u64 avail, u64 copygc_wait_amount, s64 copygc_waiting_for, - u64 seen, - u64 open, - u64 need_journal_commit, - u64 nouse, + struct bucket_alloc_state *s, bool nonblocking, const char *err), TP_ARGS(ca, alloc_reserve, user, bucket, free, avail, copygc_wait_amount, copygc_waiting_for, - seen, open, need_journal_commit, nouse, nonblocking, err) + s, nonblocking, err) ); DEFINE_EVENT(bucket_alloc, bucket_alloc_fail, @@ -606,15 +600,12 @@ DEFINE_EVENT(bucket_alloc, bucket_alloc_fail, u64 avail, u64 copygc_wait_amount, s64 copygc_waiting_for, - u64 seen, - u64 open, - u64 need_journal_commit, - u64 nouse, + struct bucket_alloc_state *s, bool nonblocking, const char *err), TP_ARGS(ca, alloc_reserve, user, bucket, free, avail, copygc_wait_amount, copygc_waiting_for, - seen, open, need_journal_commit, nouse, nonblocking, err) + s, nonblocking, err) ); TRACE_EVENT(discard_buckets, -- cgit v1.2.3