1 #ifndef _BCACHE_DEBUG_H
2 #define _BCACHE_DEBUG_H
4 /* Btree/bkey debug printing */
6 int bch_bkey_to_text(char *buf
, size_t size
, const struct bkey
*k
);
7 int bch_btree_to_text(char *buf
, size_t size
, const struct btree
*b
);
9 #ifdef CONFIG_BCACHE_EDEBUG
11 unsigned bch_count_data(struct btree
*);
12 void bch_check_key_order_msg(struct btree
*, struct bset
*, const char *, ...);
13 void bch_check_keys(struct btree
*, const char *, ...);
15 #define bch_check_key_order(b, i) \
16 bch_check_key_order_msg(b, i, "keys out of order")
17 #define EBUG_ON(cond) BUG_ON(cond)
21 #define bch_count_data(b) 0
22 #define bch_check_key_order(b, i) do {} while (0)
23 #define bch_check_key_order_msg(b, i, ...) do {} while (0)
24 #define bch_check_keys(b, ...) do {} while (0)
25 #define EBUG_ON(cond) do {} while (0)
29 #ifdef CONFIG_BCACHE_DEBUG
31 void bch_btree_verify(struct btree
*, struct bset
*);
32 void bch_data_verify(struct search
*);
36 static inline void bch_btree_verify(struct btree
*b
, struct bset
*i
) {}
37 static inline void bch_data_verify(struct search
*s
) {};
41 #ifdef CONFIG_DEBUG_FS
42 void bch_debug_init_cache_set(struct cache_set
*);
44 static inline void bch_debug_init_cache_set(struct cache_set
*c
) {}