diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /fs/ubifs/debug.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'fs/ubifs/debug.h')
-rw-r--r-- | fs/ubifs/debug.h | 352 |
1 files changed, 159 insertions, 193 deletions
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h index 29d960101ea6..a811ac4a26bb 100644 --- a/fs/ubifs/debug.h +++ b/fs/ubifs/debug.h | |||
@@ -23,11 +23,18 @@ | |||
23 | #ifndef __UBIFS_DEBUG_H__ | 23 | #ifndef __UBIFS_DEBUG_H__ |
24 | #define __UBIFS_DEBUG_H__ | 24 | #define __UBIFS_DEBUG_H__ |
25 | 25 | ||
26 | /* Checking helper functions */ | ||
27 | typedef int (*dbg_leaf_callback)(struct ubifs_info *c, | ||
28 | struct ubifs_zbranch *zbr, void *priv); | ||
29 | typedef int (*dbg_znode_callback)(struct ubifs_info *c, | ||
30 | struct ubifs_znode *znode, void *priv); | ||
31 | |||
26 | #ifdef CONFIG_UBIFS_FS_DEBUG | 32 | #ifdef CONFIG_UBIFS_FS_DEBUG |
27 | 33 | ||
34 | #include <linux/random.h> | ||
35 | |||
28 | /** | 36 | /** |
29 | * ubifs_debug_info - per-FS debugging information. | 37 | * ubifs_debug_info - per-FS debugging information. |
30 | * @buf: a buffer of LEB size, used for various purposes | ||
31 | * @old_zroot: old index root - used by 'dbg_check_old_index()' | 38 | * @old_zroot: old index root - used by 'dbg_check_old_index()' |
32 | * @old_zroot_level: old index root level - used by 'dbg_check_old_index()' | 39 | * @old_zroot_level: old index root level - used by 'dbg_check_old_index()' |
33 | * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()' | 40 | * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()' |
@@ -45,16 +52,17 @@ | |||
45 | * @new_ihead_offs: used by debugging to check @c->ihead_offs | 52 | * @new_ihead_offs: used by debugging to check @c->ihead_offs |
46 | * | 53 | * |
47 | * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()') | 54 | * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()') |
48 | * @saved_free: saved free space (used by 'dbg_save_space_info()') | 55 | * @saved_bi: saved budgeting information |
56 | * @saved_free: saved amount of free space | ||
57 | * @saved_idx_gc_cnt: saved value of @c->idx_gc_cnt | ||
49 | * | 58 | * |
50 | * dfs_dir_name: name of debugfs directory containing this file-system's files | 59 | * @dfs_dir_name: name of debugfs directory containing this file-system's files |
51 | * dfs_dir: direntry object of the file-system debugfs directory | 60 | * @dfs_dir: direntry object of the file-system debugfs directory |
52 | * dfs_dump_lprops: "dump lprops" debugfs knob | 61 | * @dfs_dump_lprops: "dump lprops" debugfs knob |
53 | * dfs_dump_budg: "dump budgeting information" debugfs knob | 62 | * @dfs_dump_budg: "dump budgeting information" debugfs knob |
54 | * dfs_dump_tnc: "dump TNC" debugfs knob | 63 | * @dfs_dump_tnc: "dump TNC" debugfs knob |
55 | */ | 64 | */ |
56 | struct ubifs_debug_info { | 65 | struct ubifs_debug_info { |
57 | void *buf; | ||
58 | struct ubifs_zbranch old_zroot; | 66 | struct ubifs_zbranch old_zroot; |
59 | int old_zroot_level; | 67 | int old_zroot_level; |
60 | unsigned long long old_zroot_sqnum; | 68 | unsigned long long old_zroot_sqnum; |
@@ -72,7 +80,9 @@ struct ubifs_debug_info { | |||
72 | int new_ihead_offs; | 80 | int new_ihead_offs; |
73 | 81 | ||
74 | struct ubifs_lp_stats saved_lst; | 82 | struct ubifs_lp_stats saved_lst; |
83 | struct ubifs_budg_info saved_bi; | ||
75 | long long saved_free; | 84 | long long saved_free; |
85 | int saved_idx_gc_cnt; | ||
76 | 86 | ||
77 | char dfs_dir_name[100]; | 87 | char dfs_dir_name[100]; |
78 | struct dentry *dfs_dir; | 88 | struct dentry *dfs_dir; |
@@ -97,23 +107,7 @@ struct ubifs_debug_info { | |||
97 | } \ | 107 | } \ |
98 | } while (0) | 108 | } while (0) |
99 | 109 | ||
100 | #define dbg_dump_stack() do { \ | 110 | #define dbg_dump_stack() dump_stack() |
101 | if (!dbg_failure_mode) \ | ||
102 | dump_stack(); \ | ||
103 | } while (0) | ||
104 | |||
105 | /* Generic debugging messages */ | ||
106 | #define dbg_msg(fmt, ...) do { \ | ||
107 | spin_lock(&dbg_lock); \ | ||
108 | printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", current->pid, \ | ||
109 | __func__, ##__VA_ARGS__); \ | ||
110 | spin_unlock(&dbg_lock); \ | ||
111 | } while (0) | ||
112 | |||
113 | #define dbg_do_msg(typ, fmt, ...) do { \ | ||
114 | if (ubifs_msg_flags & typ) \ | ||
115 | dbg_msg(fmt, ##__VA_ARGS__); \ | ||
116 | } while (0) | ||
117 | 111 | ||
118 | #define dbg_err(fmt, ...) do { \ | 112 | #define dbg_err(fmt, ...) do { \ |
119 | spin_lock(&dbg_lock); \ | 113 | spin_lock(&dbg_lock); \ |
@@ -133,86 +127,43 @@ const char *dbg_key_str1(const struct ubifs_info *c, | |||
133 | #define DBGKEY(key) dbg_key_str0(c, (key)) | 127 | #define DBGKEY(key) dbg_key_str0(c, (key)) |
134 | #define DBGKEY1(key) dbg_key_str1(c, (key)) | 128 | #define DBGKEY1(key) dbg_key_str1(c, (key)) |
135 | 129 | ||
136 | /* General messages */ | 130 | #define ubifs_dbg_msg(type, fmt, ...) do { \ |
137 | #define dbg_gen(fmt, ...) dbg_do_msg(UBIFS_MSG_GEN, fmt, ##__VA_ARGS__) | 131 | spin_lock(&dbg_lock); \ |
132 | pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__); \ | ||
133 | spin_unlock(&dbg_lock); \ | ||
134 | } while (0) | ||
138 | 135 | ||
136 | /* Just a debugging messages not related to any specific UBIFS subsystem */ | ||
137 | #define dbg_msg(fmt, ...) ubifs_dbg_msg("msg", fmt, ##__VA_ARGS__) | ||
138 | /* General messages */ | ||
139 | #define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__) | ||
139 | /* Additional journal messages */ | 140 | /* Additional journal messages */ |
140 | #define dbg_jnl(fmt, ...) dbg_do_msg(UBIFS_MSG_JNL, fmt, ##__VA_ARGS__) | 141 | #define dbg_jnl(fmt, ...) ubifs_dbg_msg("jnl", fmt, ##__VA_ARGS__) |
141 | |||
142 | /* Additional TNC messages */ | 142 | /* Additional TNC messages */ |
143 | #define dbg_tnc(fmt, ...) dbg_do_msg(UBIFS_MSG_TNC, fmt, ##__VA_ARGS__) | 143 | #define dbg_tnc(fmt, ...) ubifs_dbg_msg("tnc", fmt, ##__VA_ARGS__) |
144 | |||
145 | /* Additional lprops messages */ | 144 | /* Additional lprops messages */ |
146 | #define dbg_lp(fmt, ...) dbg_do_msg(UBIFS_MSG_LP, fmt, ##__VA_ARGS__) | 145 | #define dbg_lp(fmt, ...) ubifs_dbg_msg("lp", fmt, ##__VA_ARGS__) |
147 | |||
148 | /* Additional LEB find messages */ | 146 | /* Additional LEB find messages */ |
149 | #define dbg_find(fmt, ...) dbg_do_msg(UBIFS_MSG_FIND, fmt, ##__VA_ARGS__) | 147 | #define dbg_find(fmt, ...) ubifs_dbg_msg("find", fmt, ##__VA_ARGS__) |
150 | |||
151 | /* Additional mount messages */ | 148 | /* Additional mount messages */ |
152 | #define dbg_mnt(fmt, ...) dbg_do_msg(UBIFS_MSG_MNT, fmt, ##__VA_ARGS__) | 149 | #define dbg_mnt(fmt, ...) ubifs_dbg_msg("mnt", fmt, ##__VA_ARGS__) |
153 | |||
154 | /* Additional I/O messages */ | 150 | /* Additional I/O messages */ |
155 | #define dbg_io(fmt, ...) dbg_do_msg(UBIFS_MSG_IO, fmt, ##__VA_ARGS__) | 151 | #define dbg_io(fmt, ...) ubifs_dbg_msg("io", fmt, ##__VA_ARGS__) |
156 | |||
157 | /* Additional commit messages */ | 152 | /* Additional commit messages */ |
158 | #define dbg_cmt(fmt, ...) dbg_do_msg(UBIFS_MSG_CMT, fmt, ##__VA_ARGS__) | 153 | #define dbg_cmt(fmt, ...) ubifs_dbg_msg("cmt", fmt, ##__VA_ARGS__) |
159 | |||
160 | /* Additional budgeting messages */ | 154 | /* Additional budgeting messages */ |
161 | #define dbg_budg(fmt, ...) dbg_do_msg(UBIFS_MSG_BUDG, fmt, ##__VA_ARGS__) | 155 | #define dbg_budg(fmt, ...) ubifs_dbg_msg("budg", fmt, ##__VA_ARGS__) |
162 | |||
163 | /* Additional log messages */ | 156 | /* Additional log messages */ |
164 | #define dbg_log(fmt, ...) dbg_do_msg(UBIFS_MSG_LOG, fmt, ##__VA_ARGS__) | 157 | #define dbg_log(fmt, ...) ubifs_dbg_msg("log", fmt, ##__VA_ARGS__) |
165 | |||
166 | /* Additional gc messages */ | 158 | /* Additional gc messages */ |
167 | #define dbg_gc(fmt, ...) dbg_do_msg(UBIFS_MSG_GC, fmt, ##__VA_ARGS__) | 159 | #define dbg_gc(fmt, ...) ubifs_dbg_msg("gc", fmt, ##__VA_ARGS__) |
168 | |||
169 | /* Additional scan messages */ | 160 | /* Additional scan messages */ |
170 | #define dbg_scan(fmt, ...) dbg_do_msg(UBIFS_MSG_SCAN, fmt, ##__VA_ARGS__) | 161 | #define dbg_scan(fmt, ...) ubifs_dbg_msg("scan", fmt, ##__VA_ARGS__) |
171 | |||
172 | /* Additional recovery messages */ | 162 | /* Additional recovery messages */ |
173 | #define dbg_rcvry(fmt, ...) dbg_do_msg(UBIFS_MSG_RCVRY, fmt, ##__VA_ARGS__) | 163 | #define dbg_rcvry(fmt, ...) ubifs_dbg_msg("rcvry", fmt, ##__VA_ARGS__) |
174 | 164 | ||
175 | /* | 165 | /* |
176 | * Debugging message type flags (must match msg_type_names in debug.c). | 166 | * Debugging check flags. |
177 | * | ||
178 | * UBIFS_MSG_GEN: general messages | ||
179 | * UBIFS_MSG_JNL: journal messages | ||
180 | * UBIFS_MSG_MNT: mount messages | ||
181 | * UBIFS_MSG_CMT: commit messages | ||
182 | * UBIFS_MSG_FIND: LEB find messages | ||
183 | * UBIFS_MSG_BUDG: budgeting messages | ||
184 | * UBIFS_MSG_GC: garbage collection messages | ||
185 | * UBIFS_MSG_TNC: TNC messages | ||
186 | * UBIFS_MSG_LP: lprops messages | ||
187 | * UBIFS_MSG_IO: I/O messages | ||
188 | * UBIFS_MSG_LOG: log messages | ||
189 | * UBIFS_MSG_SCAN: scan messages | ||
190 | * UBIFS_MSG_RCVRY: recovery messages | ||
191 | */ | ||
192 | enum { | ||
193 | UBIFS_MSG_GEN = 0x1, | ||
194 | UBIFS_MSG_JNL = 0x2, | ||
195 | UBIFS_MSG_MNT = 0x4, | ||
196 | UBIFS_MSG_CMT = 0x8, | ||
197 | UBIFS_MSG_FIND = 0x10, | ||
198 | UBIFS_MSG_BUDG = 0x20, | ||
199 | UBIFS_MSG_GC = 0x40, | ||
200 | UBIFS_MSG_TNC = 0x80, | ||
201 | UBIFS_MSG_LP = 0x100, | ||
202 | UBIFS_MSG_IO = 0x200, | ||
203 | UBIFS_MSG_LOG = 0x400, | ||
204 | UBIFS_MSG_SCAN = 0x800, | ||
205 | UBIFS_MSG_RCVRY = 0x1000, | ||
206 | }; | ||
207 | |||
208 | /* Debugging message type flags for each default debug message level */ | ||
209 | #define UBIFS_MSG_LVL_0 0 | ||
210 | #define UBIFS_MSG_LVL_1 0x1 | ||
211 | #define UBIFS_MSG_LVL_2 0x7f | ||
212 | #define UBIFS_MSG_LVL_3 0xffff | ||
213 | |||
214 | /* | ||
215 | * Debugging check flags (must match chk_names in debug.c). | ||
216 | * | 167 | * |
217 | * UBIFS_CHK_GEN: general checks | 168 | * UBIFS_CHK_GEN: general checks |
218 | * UBIFS_CHK_TNC: check TNC | 169 | * UBIFS_CHK_TNC: check TNC |
@@ -233,32 +184,14 @@ enum { | |||
233 | }; | 184 | }; |
234 | 185 | ||
235 | /* | 186 | /* |
236 | * Special testing flags (must match tst_names in debug.c). | 187 | * Special testing flags. |
237 | * | 188 | * |
238 | * UBIFS_TST_FORCE_IN_THE_GAPS: force the use of in-the-gaps method | ||
239 | * UBIFS_TST_RCVRY: failure mode for recovery testing | 189 | * UBIFS_TST_RCVRY: failure mode for recovery testing |
240 | */ | 190 | */ |
241 | enum { | 191 | enum { |
242 | UBIFS_TST_FORCE_IN_THE_GAPS = 0x2, | ||
243 | UBIFS_TST_RCVRY = 0x4, | 192 | UBIFS_TST_RCVRY = 0x4, |
244 | }; | 193 | }; |
245 | 194 | ||
246 | #if CONFIG_UBIFS_FS_DEBUG_MSG_LVL == 1 | ||
247 | #define UBIFS_MSG_FLAGS_DEFAULT UBIFS_MSG_LVL_1 | ||
248 | #elif CONFIG_UBIFS_FS_DEBUG_MSG_LVL == 2 | ||
249 | #define UBIFS_MSG_FLAGS_DEFAULT UBIFS_MSG_LVL_2 | ||
250 | #elif CONFIG_UBIFS_FS_DEBUG_MSG_LVL == 3 | ||
251 | #define UBIFS_MSG_FLAGS_DEFAULT UBIFS_MSG_LVL_3 | ||
252 | #else | ||
253 | #define UBIFS_MSG_FLAGS_DEFAULT UBIFS_MSG_LVL_0 | ||
254 | #endif | ||
255 | |||
256 | #ifdef CONFIG_UBIFS_FS_DEBUG_CHKS | ||
257 | #define UBIFS_CHK_FLAGS_DEFAULT 0xffffffff | ||
258 | #else | ||
259 | #define UBIFS_CHK_FLAGS_DEFAULT 0 | ||
260 | #endif | ||
261 | |||
262 | extern spinlock_t dbg_lock; | 195 | extern spinlock_t dbg_lock; |
263 | 196 | ||
264 | extern unsigned int ubifs_msg_flags; | 197 | extern unsigned int ubifs_msg_flags; |
@@ -280,7 +213,7 @@ void dbg_dump_lpt_node(const struct ubifs_info *c, void *node, int lnum, | |||
280 | int offs); | 213 | int offs); |
281 | void dbg_dump_budget_req(const struct ubifs_budget_req *req); | 214 | void dbg_dump_budget_req(const struct ubifs_budget_req *req); |
282 | void dbg_dump_lstats(const struct ubifs_lp_stats *lst); | 215 | void dbg_dump_lstats(const struct ubifs_lp_stats *lst); |
283 | void dbg_dump_budg(struct ubifs_info *c); | 216 | void dbg_dump_budg(struct ubifs_info *c, const struct ubifs_budg_info *bi); |
284 | void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp); | 217 | void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp); |
285 | void dbg_dump_lprops(struct ubifs_info *c); | 218 | void dbg_dump_lprops(struct ubifs_info *c); |
286 | void dbg_dump_lpt_info(struct ubifs_info *c); | 219 | void dbg_dump_lpt_info(struct ubifs_info *c); |
@@ -294,11 +227,6 @@ void dbg_dump_tnc(struct ubifs_info *c); | |||
294 | void dbg_dump_index(struct ubifs_info *c); | 227 | void dbg_dump_index(struct ubifs_info *c); |
295 | void dbg_dump_lpt_lebs(const struct ubifs_info *c); | 228 | void dbg_dump_lpt_lebs(const struct ubifs_info *c); |
296 | 229 | ||
297 | /* Checking helper functions */ | ||
298 | typedef int (*dbg_leaf_callback)(struct ubifs_info *c, | ||
299 | struct ubifs_zbranch *zbr, void *priv); | ||
300 | typedef int (*dbg_znode_callback)(struct ubifs_info *c, | ||
301 | struct ubifs_znode *znode, void *priv); | ||
302 | int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb, | 230 | int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb, |
303 | dbg_znode_callback znode_cb, void *priv); | 231 | dbg_znode_callback znode_cb, void *priv); |
304 | 232 | ||
@@ -319,25 +247,24 @@ int dbg_check_idx_size(struct ubifs_info *c, long long idx_size); | |||
319 | int dbg_check_filesystem(struct ubifs_info *c); | 247 | int dbg_check_filesystem(struct ubifs_info *c); |
320 | void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, | 248 | void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat, |
321 | int add_pos); | 249 | int add_pos); |
322 | int dbg_check_lprops(struct ubifs_info *c); | ||
323 | int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode, | 250 | int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode, |
324 | int row, int col); | 251 | int row, int col); |
325 | int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode, | 252 | int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode, |
326 | loff_t size); | 253 | loff_t size); |
254 | int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head); | ||
255 | int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head); | ||
327 | 256 | ||
328 | /* Force the use of in-the-gaps method for testing */ | 257 | /* Force the use of in-the-gaps method for testing */ |
329 | 258 | static inline int dbg_force_in_the_gaps_enabled(void) | |
330 | #define dbg_force_in_the_gaps_enabled \ | 259 | { |
331 | (ubifs_tst_flags & UBIFS_TST_FORCE_IN_THE_GAPS) | 260 | return ubifs_chk_flags & UBIFS_CHK_GEN; |
332 | 261 | } | |
333 | int dbg_force_in_the_gaps(void); | 262 | int dbg_force_in_the_gaps(void); |
334 | 263 | ||
335 | /* Failure mode for recovery testing */ | 264 | /* Failure mode for recovery testing */ |
336 | |||
337 | #define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY) | 265 | #define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY) |
338 | 266 | ||
339 | #ifndef UBIFS_DBG_PRESERVE_UBI | 267 | #ifndef UBIFS_DBG_PRESERVE_UBI |
340 | |||
341 | #define ubi_leb_read dbg_leb_read | 268 | #define ubi_leb_read dbg_leb_read |
342 | #define ubi_leb_write dbg_leb_write | 269 | #define ubi_leb_write dbg_leb_write |
343 | #define ubi_leb_change dbg_leb_change | 270 | #define ubi_leb_change dbg_leb_change |
@@ -345,7 +272,6 @@ int dbg_force_in_the_gaps(void); | |||
345 | #define ubi_leb_unmap dbg_leb_unmap | 272 | #define ubi_leb_unmap dbg_leb_unmap |
346 | #define ubi_is_mapped dbg_is_mapped | 273 | #define ubi_is_mapped dbg_is_mapped |
347 | #define ubi_leb_map dbg_leb_map | 274 | #define ubi_leb_map dbg_leb_map |
348 | |||
349 | #endif | 275 | #endif |
350 | 276 | ||
351 | int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | 277 | int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, |
@@ -392,87 +318,127 @@ void dbg_debugfs_exit_fs(struct ubifs_info *c); | |||
392 | __func__, __LINE__, current->pid); \ | 318 | __func__, __LINE__, current->pid); \ |
393 | } while (0) | 319 | } while (0) |
394 | 320 | ||
395 | #define dbg_err(fmt, ...) do { \ | 321 | #define dbg_err(fmt, ...) do { \ |
396 | if (0) \ | 322 | if (0) \ |
397 | ubifs_err(fmt, ##__VA_ARGS__); \ | 323 | ubifs_err(fmt, ##__VA_ARGS__); \ |
398 | } while (0) | 324 | } while (0) |
399 | 325 | ||
400 | #define dbg_msg(fmt, ...) do { \ | 326 | #define ubifs_dbg_msg(fmt, ...) do { \ |
401 | if (0) \ | 327 | if (0) \ |
402 | printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", \ | 328 | pr_debug(fmt "\n", ##__VA_ARGS__); \ |
403 | current->pid, __func__, ##__VA_ARGS__); \ | ||
404 | } while (0) | 329 | } while (0) |
405 | 330 | ||
406 | #define dbg_dump_stack() | 331 | #define dbg_dump_stack() |
407 | #define ubifs_assert_cmt_locked(c) | 332 | #define ubifs_assert_cmt_locked(c) |
408 | 333 | ||
409 | #define dbg_gen(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 334 | #define dbg_msg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
410 | #define dbg_jnl(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 335 | #define dbg_gen(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
411 | #define dbg_tnc(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 336 | #define dbg_jnl(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
412 | #define dbg_lp(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 337 | #define dbg_tnc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
413 | #define dbg_find(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 338 | #define dbg_lp(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
414 | #define dbg_mnt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 339 | #define dbg_find(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
415 | #define dbg_io(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 340 | #define dbg_mnt(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
416 | #define dbg_cmt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 341 | #define dbg_io(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
417 | #define dbg_budg(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 342 | #define dbg_cmt(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
418 | #define dbg_log(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 343 | #define dbg_budg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
419 | #define dbg_gc(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 344 | #define dbg_log(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
420 | #define dbg_scan(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 345 | #define dbg_gc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
421 | #define dbg_rcvry(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__) | 346 | #define dbg_scan(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) |
347 | #define dbg_rcvry(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__) | ||
422 | 348 | ||
423 | #define DBGKEY(key) ((char *)(key)) | 349 | #define DBGKEY(key) ((char *)(key)) |
424 | #define DBGKEY1(key) ((char *)(key)) | 350 | #define DBGKEY1(key) ((char *)(key)) |
425 | 351 | ||
426 | #define ubifs_debugging_init(c) 0 | 352 | static inline int ubifs_debugging_init(struct ubifs_info *c) { return 0; } |
427 | #define ubifs_debugging_exit(c) ({}) | 353 | static inline void ubifs_debugging_exit(struct ubifs_info *c) { return; } |
428 | 354 | static inline const char *dbg_ntype(int type) { return ""; } | |
429 | #define dbg_ntype(type) "" | 355 | static inline const char *dbg_cstate(int cmt_state) { return ""; } |
430 | #define dbg_cstate(cmt_state) "" | 356 | static inline const char *dbg_jhead(int jhead) { return ""; } |
431 | #define dbg_jhead(jhead) "" | 357 | static inline const char * |
432 | #define dbg_get_key_dump(c, key) ({}) | 358 | dbg_get_key_dump(const struct ubifs_info *c, |
433 | #define dbg_dump_inode(c, inode) ({}) | 359 | const union ubifs_key *key) { return ""; } |
434 | #define dbg_dump_node(c, node) ({}) | 360 | static inline void dbg_dump_inode(const struct ubifs_info *c, |
435 | #define dbg_dump_lpt_node(c, node, lnum, offs) ({}) | 361 | const struct inode *inode) { return; } |
436 | #define dbg_dump_budget_req(req) ({}) | 362 | static inline void dbg_dump_node(const struct ubifs_info *c, |
437 | #define dbg_dump_lstats(lst) ({}) | 363 | const void *node) { return; } |
438 | #define dbg_dump_budg(c) ({}) | 364 | static inline void dbg_dump_lpt_node(const struct ubifs_info *c, |
439 | #define dbg_dump_lprop(c, lp) ({}) | 365 | void *node, int lnum, |
440 | #define dbg_dump_lprops(c) ({}) | 366 | int offs) { return; } |
441 | #define dbg_dump_lpt_info(c) ({}) | 367 | static inline void |
442 | #define dbg_dump_leb(c, lnum) ({}) | 368 | dbg_dump_budget_req(const struct ubifs_budget_req *req) { return; } |
443 | #define dbg_dump_znode(c, znode) ({}) | 369 | static inline void |
444 | #define dbg_dump_heap(c, heap, cat) ({}) | 370 | dbg_dump_lstats(const struct ubifs_lp_stats *lst) { return; } |
445 | #define dbg_dump_pnode(c, pnode, parent, iip) ({}) | 371 | static inline void |
446 | #define dbg_dump_tnc(c) ({}) | 372 | dbg_dump_budg(struct ubifs_info *c, |
447 | #define dbg_dump_index(c) ({}) | 373 | const struct ubifs_budg_info *bi) { return; } |
448 | #define dbg_dump_lpt_lebs(c) ({}) | 374 | static inline void dbg_dump_lprop(const struct ubifs_info *c, |
449 | 375 | const struct ubifs_lprops *lp) { return; } | |
450 | #define dbg_walk_index(c, leaf_cb, znode_cb, priv) 0 | 376 | static inline void dbg_dump_lprops(struct ubifs_info *c) { return; } |
451 | #define dbg_old_index_check_init(c, zroot) 0 | 377 | static inline void dbg_dump_lpt_info(struct ubifs_info *c) { return; } |
452 | #define dbg_save_space_info(c) ({}) | 378 | static inline void dbg_dump_leb(const struct ubifs_info *c, |
453 | #define dbg_check_space_info(c) 0 | 379 | int lnum) { return; } |
454 | #define dbg_check_old_index(c, zroot) 0 | 380 | static inline void |
455 | #define dbg_check_cats(c) 0 | 381 | dbg_dump_znode(const struct ubifs_info *c, |
456 | #define dbg_check_ltab(c) 0 | 382 | const struct ubifs_znode *znode) { return; } |
457 | #define dbg_chk_lpt_free_spc(c) 0 | 383 | static inline void dbg_dump_heap(struct ubifs_info *c, |
458 | #define dbg_chk_lpt_sz(c, action, len) 0 | 384 | struct ubifs_lpt_heap *heap, |
459 | #define dbg_check_synced_i_size(inode) 0 | 385 | int cat) { return; } |
460 | #define dbg_check_dir_size(c, dir) 0 | 386 | static inline void dbg_dump_pnode(struct ubifs_info *c, |
461 | #define dbg_check_tnc(c, x) 0 | 387 | struct ubifs_pnode *pnode, |
462 | #define dbg_check_idx_size(c, idx_size) 0 | 388 | struct ubifs_nnode *parent, |
463 | #define dbg_check_filesystem(c) 0 | 389 | int iip) { return; } |
464 | #define dbg_check_heap(c, heap, cat, add_pos) ({}) | 390 | static inline void dbg_dump_tnc(struct ubifs_info *c) { return; } |
465 | #define dbg_check_lprops(c) 0 | 391 | static inline void dbg_dump_index(struct ubifs_info *c) { return; } |
466 | #define dbg_check_lpt_nodes(c, cnode, row, col) 0 | 392 | static inline void dbg_dump_lpt_lebs(const struct ubifs_info *c) { return; } |
467 | #define dbg_check_inode_size(c, inode, size) 0 | 393 | |
468 | #define dbg_force_in_the_gaps_enabled 0 | 394 | static inline int dbg_walk_index(struct ubifs_info *c, |
469 | #define dbg_force_in_the_gaps() 0 | 395 | dbg_leaf_callback leaf_cb, |
470 | #define dbg_failure_mode 0 | 396 | dbg_znode_callback znode_cb, |
471 | 397 | void *priv) { return 0; } | |
472 | #define dbg_debugfs_init() 0 | 398 | static inline void dbg_save_space_info(struct ubifs_info *c) { return; } |
473 | #define dbg_debugfs_exit() | 399 | static inline int dbg_check_space_info(struct ubifs_info *c) { return 0; } |
474 | #define dbg_debugfs_init_fs(c) 0 | 400 | static inline int dbg_check_lprops(struct ubifs_info *c) { return 0; } |
475 | #define dbg_debugfs_exit_fs(c) 0 | 401 | static inline int |
402 | dbg_old_index_check_init(struct ubifs_info *c, | ||
403 | struct ubifs_zbranch *zroot) { return 0; } | ||
404 | static inline int | ||
405 | dbg_check_old_index(struct ubifs_info *c, | ||
406 | struct ubifs_zbranch *zroot) { return 0; } | ||
407 | static inline int dbg_check_cats(struct ubifs_info *c) { return 0; } | ||
408 | static inline int dbg_check_ltab(struct ubifs_info *c) { return 0; } | ||
409 | static inline int dbg_chk_lpt_free_spc(struct ubifs_info *c) { return 0; } | ||
410 | static inline int dbg_chk_lpt_sz(struct ubifs_info *c, | ||
411 | int action, int len) { return 0; } | ||
412 | static inline int dbg_check_synced_i_size(struct inode *inode) { return 0; } | ||
413 | static inline int dbg_check_dir_size(struct ubifs_info *c, | ||
414 | const struct inode *dir) { return 0; } | ||
415 | static inline int dbg_check_tnc(struct ubifs_info *c, int extra) { return 0; } | ||
416 | static inline int dbg_check_idx_size(struct ubifs_info *c, | ||
417 | long long idx_size) { return 0; } | ||
418 | static inline int dbg_check_filesystem(struct ubifs_info *c) { return 0; } | ||
419 | static inline void dbg_check_heap(struct ubifs_info *c, | ||
420 | struct ubifs_lpt_heap *heap, | ||
421 | int cat, int add_pos) { return; } | ||
422 | static inline int dbg_check_lpt_nodes(struct ubifs_info *c, | ||
423 | struct ubifs_cnode *cnode, int row, int col) { return 0; } | ||
424 | static inline int dbg_check_inode_size(struct ubifs_info *c, | ||
425 | const struct inode *inode, | ||
426 | loff_t size) { return 0; } | ||
427 | static inline int | ||
428 | dbg_check_data_nodes_order(struct ubifs_info *c, | ||
429 | struct list_head *head) { return 0; } | ||
430 | static inline int | ||
431 | dbg_check_nondata_nodes_order(struct ubifs_info *c, | ||
432 | struct list_head *head) { return 0; } | ||
433 | |||
434 | static inline int dbg_force_in_the_gaps(void) { return 0; } | ||
435 | #define dbg_force_in_the_gaps_enabled() 0 | ||
436 | #define dbg_failure_mode 0 | ||
437 | |||
438 | static inline int dbg_debugfs_init(void) { return 0; } | ||
439 | static inline void dbg_debugfs_exit(void) { return; } | ||
440 | static inline int dbg_debugfs_init_fs(struct ubifs_info *c) { return 0; } | ||
441 | static inline int dbg_debugfs_exit_fs(struct ubifs_info *c) { return 0; } | ||
476 | 442 | ||
477 | #endif /* !CONFIG_UBIFS_FS_DEBUG */ | 443 | #endif /* !CONFIG_UBIFS_FS_DEBUG */ |
478 | #endif /* !__UBIFS_DEBUG_H__ */ | 444 | #endif /* !__UBIFS_DEBUG_H__ */ |