1 #ifndef _BCACHEFS_DEBUG_H
2 #define _BCACHEFS_DEBUG_H
10 #define BCH_DEBUG_PARAM(name, description) extern bool bch2_##name;
12 #undef BCH_DEBUG_PARAM
14 #define BCH_DEBUG_PARAM(name, description) \
15 static inline bool name(struct bch_fs *c) \
16 { return bch2_##name || c->name; }
17 BCH_DEBUG_PARAMS_ALWAYS()
18 #undef BCH_DEBUG_PARAM
20 #ifdef CONFIG_BCACHEFS_DEBUG
22 #define BCH_DEBUG_PARAM(name, description) \
23 static inline bool name(struct bch_fs *c) \
24 { return bch2_##name || c->name; }
25 BCH_DEBUG_PARAMS_DEBUG()
26 #undef BCH_DEBUG_PARAM
28 void __bch2_btree_verify(struct bch_fs *, struct btree *);
30 #define bypass_torture_test(d) ((d)->bypass_torture_test)
34 #define BCH_DEBUG_PARAM(name, description) \
35 static inline bool name(struct bch_fs *c) { return false; }
36 BCH_DEBUG_PARAMS_DEBUG()
37 #undef BCH_DEBUG_PARAM
39 static inline void __bch2_btree_verify(struct bch_fs *c, struct btree *b) {}
41 #define bypass_torture_test(d) 0
45 static inline void bch2_btree_verify(struct bch_fs *c, struct btree *b)
47 if (verify_btree_ondisk(c))
48 __bch2_btree_verify(c, b);
51 #ifdef CONFIG_DEBUG_FS
52 void bch2_fs_debug_exit(struct bch_fs *);
53 void bch2_fs_debug_init(struct bch_fs *);
55 static inline void bch2_fs_debug_exit(struct bch_fs *c) {}
56 static inline void bch2_fs_debug_init(struct bch_fs *c) {}
59 void bch2_debug_exit(void);
60 int bch2_debug_init(void);
62 #endif /* _BCACHEFS_DEBUG_H */