summaryrefslogtreecommitdiff
path: root/fs/bcachefs/debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-08-12 02:36:24 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:38 +0300
commit4aba7d4569f70167edf183055e809a37cd73cdd1 (patch)
tree2078c37c1144867805ff9fff72fa5e0f7f230d93 /fs/bcachefs/debug.c
parent11c1a62f3b872d2345c97e72700ed4d1b2511888 (diff)
downloadlinux-4aba7d4569f70167edf183055e809a37cd73cdd1.tar.xz
bcachefs: Rename lock_held_stats -> btree_transaction_stats
Going to be adding more things to this in the next patch. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/debug.c')
-rw-r--r--fs/bcachefs/debug.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/fs/bcachefs/debug.c b/fs/bcachefs/debug.c
index b9b6cad8cd40..d40846f99f52 100644
--- a/fs/bcachefs/debug.c
+++ b/fs/bcachefs/debug.c
@@ -653,14 +653,17 @@ static ssize_t lock_held_stats_read(struct file *file, char __user *buf,
size_t size, loff_t *ppos)
{
struct dump_iter *i = file->private_data;
- struct lock_held_stats *lhs = &i->c->lock_held_stats;
+ struct bch_fs *c = i->c;
int err;
i->ubuf = buf;
i->size = size;
i->ret = 0;
- while (lhs->names[i->iter] != 0 && i->iter < BCH_LOCK_TIME_NR) {
+ while (i->iter < ARRAY_SIZE(c->btree_transaction_fns) &&
+ c->btree_transaction_fns[i->iter]) {
+ struct btree_transaction_stats *s = &c->btree_transaction_stats[i->iter];
+
err = flush_buf(i);
if (err)
return err;
@@ -668,11 +671,11 @@ static ssize_t lock_held_stats_read(struct file *file, char __user *buf,
if (!i->size)
break;
- prt_printf(&i->buf, "%s:", lhs->names[i->iter]);
+ prt_printf(&i->buf, "%s: ", c->btree_transaction_fns[i->iter]);
prt_newline(&i->buf);
- printbuf_indent_add(&i->buf, 8);
- bch2_time_stats_to_text(&i->buf, &lhs->times[i->iter]);
- printbuf_indent_sub(&i->buf, 8);
+ printbuf_indent_add(&i->buf, 2);
+ bch2_time_stats_to_text(&i->buf, &s->lock_hold_times);
+ printbuf_indent_sub(&i->buf, 2);
prt_newline(&i->buf);
i->iter++;
}
@@ -721,7 +724,7 @@ void bch2_fs_debug_init(struct bch_fs *c)
c->btree_debug, &journal_pins_ops);
if (IS_ENABLED(CONFIG_BCACHEFS_LOCK_TIME_STATS)) {
- debugfs_create_file("lock_held_stats", 0400, c->fs_debug_dir,
+ debugfs_create_file("btree_transaction_stats", 0400, c->fs_debug_dir,
c, &lock_held_stats_op);
}