mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 19:43:40 +02:00
bcachefs: count_event()
Small helper for event counters. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
cb13f47139
commit
7464403009
|
|
@ -1674,7 +1674,7 @@ static int bch2_discard_one_bucket(struct btree_trans *trans,
|
|||
if (ret)
|
||||
goto out;
|
||||
|
||||
this_cpu_inc(c->counters[BCH_COUNTER_bucket_discard]);
|
||||
count_event(c, bucket_discard);
|
||||
(*discarded)++;
|
||||
out:
|
||||
(*seen)++;
|
||||
|
|
|
|||
|
|
@ -223,9 +223,11 @@
|
|||
|
||||
#define race_fault(...) dynamic_fault("bcachefs:race")
|
||||
|
||||
#define count_event(_c, _name) this_cpu_inc((_c)->counters[BCH_COUNTER_##_name])
|
||||
|
||||
#define trace_and_count(_c, _name, ...) \
|
||||
do { \
|
||||
this_cpu_inc((_c)->counters[BCH_COUNTER_##_name]); \
|
||||
count_event(_c, _name); \
|
||||
trace_##_name(__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ static int __bch2_data_update_index_update(struct btree_trans *trans,
|
|||
&m->stats->sectors_raced);
|
||||
}
|
||||
|
||||
this_cpu_inc(c->counters[BCH_COUNTER_move_extent_fail]);
|
||||
count_event(c, move_extent_fail);
|
||||
|
||||
bch2_btree_iter_advance(&iter);
|
||||
goto next;
|
||||
|
|
|
|||
|
|
@ -349,7 +349,8 @@ int bch2_move_extent(struct moving_context *ctxt,
|
|||
bch2_err_matches(ret, BCH_ERR_transaction_restart))
|
||||
return ret;
|
||||
|
||||
this_cpu_inc(c->counters[BCH_COUNTER_move_extent_start_fail]);
|
||||
count_event(c, move_extent_start_fail);
|
||||
|
||||
if (trace_move_extent_start_fail_enabled()) {
|
||||
struct printbuf buf = PRINTBUF;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user