1 #ifndef _BCACHE_DEBUG_H
2 #define _BCACHE_DEBUG_H
11 #define BCH_DEBUG_PARAM(name, description) extern bool bch_##name;
13 #undef BCH_DEBUG_PARAM
15 #define BCH_DEBUG_PARAM(name, description) \
16 static inline bool name(struct cache_set *c) \
17 { return bch_##name || c->name; }
18 BCH_DEBUG_PARAMS_ALWAYS()
19 #undef BCH_DEBUG_PARAM
21 #ifdef CONFIG_BCACHE_DEBUG
23 #define BCH_DEBUG_PARAM(name, description) \
24 static inline bool name(struct cache_set *c) \
25 { return bch_##name || c->name; }
26 BCH_DEBUG_PARAMS_DEBUG()
27 #undef BCH_DEBUG_PARAM
29 void __bch_btree_verify(struct cache_set *, struct btree *);
30 void bch_data_verify(struct cached_dev *, struct bio *);
32 #define bypass_torture_test(d) ((d)->bypass_torture_test)
36 #define BCH_DEBUG_PARAM(name, description) \
37 static inline bool name(struct cache_set *c) { return false; }
38 BCH_DEBUG_PARAMS_DEBUG()
39 #undef BCH_DEBUG_PARAM
41 static inline void __bch_btree_verify(struct cache_set *c, struct btree *b) {}
42 static inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {}
44 #define bypass_torture_test(d) 0
48 static inline void bch_btree_verify(struct cache_set *c, struct btree *b)
50 if (verify_btree_ondisk(c))
51 __bch_btree_verify(c, b);
54 #ifdef CONFIG_DEBUG_FS
55 void bch_debug_exit_cache_set(struct cache_set *);
56 void bch_debug_init_cache_set(struct cache_set *);
58 static inline void bch_debug_exit_cache_set(struct cache_set *c) {}
59 static inline void bch_debug_init_cache_set(struct cache_set *c) {}
62 void bch_debug_exit(void);
63 int bch_debug_init(void);