]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - drivers/md/bcache/debug.h
1 #ifndef _BCACHE_DEBUG_H
2 #define _BCACHE_DEBUG_H
4 /* Btree/bkey debug printing */
6 #define KEYHACK_SIZE 80
11 struct keyprint_hack
bch_pkey(const struct bkey
*k
);
12 struct keyprint_hack
bch_pbtree(const struct btree
*b
);
13 #define pkey(k) (&bch_pkey(k).s[0])
14 #define pbtree(b) (&bch_pbtree(b).s[0])
16 #ifdef CONFIG_BCACHE_EDEBUG
18 unsigned bch_count_data(struct btree
*);
19 void bch_check_key_order_msg(struct btree
*, struct bset
*, const char *, ...);
20 void bch_check_keys(struct btree
*, const char *, ...);
22 #define bch_check_key_order(b, i) \
23 bch_check_key_order_msg(b, i, "keys out of order")
24 #define EBUG_ON(cond) BUG_ON(cond)
28 #define bch_count_data(b) 0
29 #define bch_check_key_order(b, i) do {} while (0)
30 #define bch_check_key_order_msg(b, i, ...) do {} while (0)
31 #define bch_check_keys(b, ...) do {} while (0)
32 #define EBUG_ON(cond) do {} while (0)
36 #ifdef CONFIG_BCACHE_DEBUG
38 void bch_btree_verify(struct btree
*, struct bset
*);
39 void bch_data_verify(struct search
*);
43 static inline void bch_btree_verify(struct btree
*b
, struct bset
*i
) {}
44 static inline void bch_data_verify(struct search
*s
) {};
48 #ifdef CONFIG_DEBUG_FS
49 void bch_debug_init_cache_set(struct cache_set
*);
51 static inline void bch_debug_init_cache_set(struct cache_set
*c
) {}