summaryrefslogtreecommitdiff
path: root/fs/bcachefs/rebalance.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-11-25 05:52:17 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 19:47:38 +0300
commit25d1e39df0e28494f1e82c68a3967c84dca009b3 (patch)
tree77a6f80d2b717a7f7ec8af8ddb70662346df89db /fs/bcachefs/rebalance.c
parentd05db12715c989c36e81737a737418af9e6232d1 (diff)
downloadlinux-25d1e39df0e28494f1e82c68a3967c84dca009b3.tar.xz
bcachefs: Add a rebalance, data_update tracepoints
Add a tracepoint for rebalance, printing out - the target option - the compression option - the key being rebalanced Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/rebalance.c')
-rw-r--r--fs/bcachefs/rebalance.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/bcachefs/rebalance.c b/fs/bcachefs/rebalance.c
index db2139c0545d..1846f38cea38 100644
--- a/fs/bcachefs/rebalance.c
+++ b/fs/bcachefs/rebalance.c
@@ -171,6 +171,21 @@ static struct bkey_s_c next_rebalance_extent(struct btree_trans *trans,
return bkey_s_c_null;
}
+ if (trace_rebalance_extent_enabled()) {
+ struct printbuf buf = PRINTBUF;
+
+ prt_str(&buf, "target=");
+ bch2_target_to_text(&buf, c, r->target);
+ prt_str(&buf, " compression=");
+ struct bch_compression_opt opt = __bch2_compression_decode(r->compression);
+ prt_str(&buf, bch2_compression_opts[opt.type]);
+ prt_str(&buf, " ");
+ bch2_bkey_val_to_text(&buf, c, k);
+
+ trace_rebalance_extent(c, buf.buf);
+ printbuf_exit(&buf);
+ }
+
return k;
}