diff options
Diffstat (limited to 'libbcachefs/btree_cache.h')
-rw-r--r-- | libbcachefs/btree_cache.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libbcachefs/btree_cache.h b/libbcachefs/btree_cache.h index ca3c1b14..3264801c 100644 --- a/libbcachefs/btree_cache.h +++ b/libbcachefs/btree_cache.h @@ -153,4 +153,15 @@ void bch2_btree_pos_to_text(struct printbuf *, struct bch_fs *, const struct btr void bch2_btree_node_to_text(struct printbuf *, struct bch_fs *, const struct btree *); void bch2_btree_cache_to_text(struct printbuf *, const struct btree_cache *); +#define trace_btree_node(_c, _b, event) \ +do { \ + if (trace_##event##_enabled()) { \ + CLASS(printbuf, buf)(); \ + printbuf_indent_add(&buf, 2); \ + bch2_btree_pos_to_text(&buf, c, b); \ + trace_##event(c, buf.buf); \ + } \ + count_event(c, event); \ +} while (0); + #endif /* _BCACHEFS_BTREE_CACHE_H */ |