blob: 919f0de29d8f378cee69bb3c035d53eea6ddb312 [file] [log] [blame]
Artem Bityutskiy1e517642008-07-14 19:08:37 +03001/*
2 * This file is part of UBIFS.
3 *
4 * Copyright (C) 2006-2008 Nokia Corporation.
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published by
8 * the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * more details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Software Foundation, Inc., 51
17 * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 *
19 * Authors: Artem Bityutskiy (Битюцкий Артём)
20 * Adrian Hunter
21 */
22
23#ifndef __UBIFS_DEBUG_H__
24#define __UBIFS_DEBUG_H__
25
26#ifdef CONFIG_UBIFS_FS_DEBUG
27
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +030028/**
29 * ubifs_debug_info - per-FS debugging information.
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +030030 * @old_zroot: old index root - used by 'dbg_check_old_index()'
31 * @old_zroot_level: old index root level - used by 'dbg_check_old_index()'
32 * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()'
33 * @failure_mode: failure mode for recovery testing
34 * @fail_delay: 0=>don't delay, 1=>delay a time, 2=>delay a number of calls
35 * @fail_timeout: time in jiffies when delay of failure mode expires
36 * @fail_cnt: current number of calls to failure mode I/O functions
37 * @fail_cnt_max: number of calls by which to delay failure mode
38 * @chk_lpt_sz: used by LPT tree size checker
39 * @chk_lpt_sz2: used by LPT tree size checker
40 * @chk_lpt_wastage: used by LPT tree size checker
41 * @chk_lpt_lebs: used by LPT tree size checker
42 * @new_nhead_offs: used by LPT tree size checker
Artem Bityutskiy84abf972009-01-23 14:54:59 +020043 * @new_ihead_lnum: used by debugging to check @c->ihead_lnum
44 * @new_ihead_offs: used by debugging to check @c->ihead_offs
Artem Bityutskiy552ff312008-10-23 11:49:28 +030045 *
Artem Bityutskiy84abf972009-01-23 14:54:59 +020046 * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()')
47 * @saved_free: saved free space (used by 'dbg_save_space_info()')
48 *
49 * dfs_dir_name: name of debugfs directory containing this file-system's files
50 * dfs_dir: direntry object of the file-system debugfs directory
51 * dfs_dump_lprops: "dump lprops" debugfs knob
52 * dfs_dump_budg: "dump budgeting information" debugfs knob
53 * dfs_dump_tnc: "dump TNC" debugfs knob
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +030054 */
55struct ubifs_debug_info {
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +030056 struct ubifs_zbranch old_zroot;
57 int old_zroot_level;
58 unsigned long long old_zroot_sqnum;
59 int failure_mode;
60 int fail_delay;
61 unsigned long fail_timeout;
62 unsigned int fail_cnt;
63 unsigned int fail_cnt_max;
64 long long chk_lpt_sz;
65 long long chk_lpt_sz2;
66 long long chk_lpt_wastage;
67 int chk_lpt_lebs;
68 int new_nhead_offs;
69 int new_ihead_lnum;
70 int new_ihead_offs;
Artem Bityutskiy552ff312008-10-23 11:49:28 +030071
Artem Bityutskiy84abf972009-01-23 14:54:59 +020072 struct ubifs_lp_stats saved_lst;
73 long long saved_free;
74
75 char dfs_dir_name[100];
76 struct dentry *dfs_dir;
77 struct dentry *dfs_dump_lprops;
78 struct dentry *dfs_dump_budg;
79 struct dentry *dfs_dump_tnc;
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +030080};
Artem Bityutskiy1e517642008-07-14 19:08:37 +030081
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +030082#define ubifs_assert(expr) do { \
Artem Bityutskiy1e517642008-07-14 19:08:37 +030083 if (unlikely(!(expr))) { \
84 printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
85 __func__, __LINE__, current->pid); \
86 dbg_dump_stack(); \
87 } \
88} while (0)
89
90#define ubifs_assert_cmt_locked(c) do { \
91 if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
92 up_write(&(c)->commit_sem); \
93 printk(KERN_CRIT "commit lock is not locked!\n"); \
94 ubifs_assert(0); \
95 } \
96} while (0)
97
98#define dbg_dump_stack() do { \
99 if (!dbg_failure_mode) \
100 dump_stack(); \
101} while (0)
102
103/* Generic debugging messages */
104#define dbg_msg(fmt, ...) do { \
105 spin_lock(&dbg_lock); \
106 printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", current->pid, \
107 __func__, ##__VA_ARGS__); \
108 spin_unlock(&dbg_lock); \
109} while (0)
110
111#define dbg_do_msg(typ, fmt, ...) do { \
112 if (ubifs_msg_flags & typ) \
113 dbg_msg(fmt, ##__VA_ARGS__); \
114} while (0)
115
116#define dbg_err(fmt, ...) do { \
117 spin_lock(&dbg_lock); \
118 ubifs_err(fmt, ##__VA_ARGS__); \
119 spin_unlock(&dbg_lock); \
120} while (0)
121
122const char *dbg_key_str0(const struct ubifs_info *c,
123 const union ubifs_key *key);
124const char *dbg_key_str1(const struct ubifs_info *c,
125 const union ubifs_key *key);
126
127/*
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300128 * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300129 * macros.
130 */
131#define DBGKEY(key) dbg_key_str0(c, (key))
132#define DBGKEY1(key) dbg_key_str1(c, (key))
133
134/* General messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300135#define dbg_gen(fmt, ...) dbg_do_msg(UBIFS_MSG_GEN, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300136
137/* Additional journal messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300138#define dbg_jnl(fmt, ...) dbg_do_msg(UBIFS_MSG_JNL, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300139
140/* Additional TNC messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300141#define dbg_tnc(fmt, ...) dbg_do_msg(UBIFS_MSG_TNC, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300142
143/* Additional lprops messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300144#define dbg_lp(fmt, ...) dbg_do_msg(UBIFS_MSG_LP, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300145
146/* Additional LEB find messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300147#define dbg_find(fmt, ...) dbg_do_msg(UBIFS_MSG_FIND, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300148
149/* Additional mount messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300150#define dbg_mnt(fmt, ...) dbg_do_msg(UBIFS_MSG_MNT, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300151
152/* Additional I/O messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300153#define dbg_io(fmt, ...) dbg_do_msg(UBIFS_MSG_IO, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300154
155/* Additional commit messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300156#define dbg_cmt(fmt, ...) dbg_do_msg(UBIFS_MSG_CMT, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300157
158/* Additional budgeting messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300159#define dbg_budg(fmt, ...) dbg_do_msg(UBIFS_MSG_BUDG, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300160
161/* Additional log messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300162#define dbg_log(fmt, ...) dbg_do_msg(UBIFS_MSG_LOG, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300163
164/* Additional gc messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300165#define dbg_gc(fmt, ...) dbg_do_msg(UBIFS_MSG_GC, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300166
167/* Additional scan messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300168#define dbg_scan(fmt, ...) dbg_do_msg(UBIFS_MSG_SCAN, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300169
170/* Additional recovery messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300171#define dbg_rcvry(fmt, ...) dbg_do_msg(UBIFS_MSG_RCVRY, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300172
173/*
Artem Bityutskiy5d630e42011-03-14 17:55:40 +0200174 * Debugging message type flags.
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300175 *
176 * UBIFS_MSG_GEN: general messages
177 * UBIFS_MSG_JNL: journal messages
178 * UBIFS_MSG_MNT: mount messages
179 * UBIFS_MSG_CMT: commit messages
180 * UBIFS_MSG_FIND: LEB find messages
181 * UBIFS_MSG_BUDG: budgeting messages
182 * UBIFS_MSG_GC: garbage collection messages
183 * UBIFS_MSG_TNC: TNC messages
184 * UBIFS_MSG_LP: lprops messages
185 * UBIFS_MSG_IO: I/O messages
186 * UBIFS_MSG_LOG: log messages
187 * UBIFS_MSG_SCAN: scan messages
188 * UBIFS_MSG_RCVRY: recovery messages
189 */
190enum {
191 UBIFS_MSG_GEN = 0x1,
192 UBIFS_MSG_JNL = 0x2,
193 UBIFS_MSG_MNT = 0x4,
194 UBIFS_MSG_CMT = 0x8,
195 UBIFS_MSG_FIND = 0x10,
196 UBIFS_MSG_BUDG = 0x20,
197 UBIFS_MSG_GC = 0x40,
198 UBIFS_MSG_TNC = 0x80,
199 UBIFS_MSG_LP = 0x100,
200 UBIFS_MSG_IO = 0x200,
201 UBIFS_MSG_LOG = 0x400,
202 UBIFS_MSG_SCAN = 0x800,
203 UBIFS_MSG_RCVRY = 0x1000,
204};
205
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300206/*
Artem Bityutskiy5d630e42011-03-14 17:55:40 +0200207 * Debugging check flags.
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300208 *
209 * UBIFS_CHK_GEN: general checks
210 * UBIFS_CHK_TNC: check TNC
211 * UBIFS_CHK_IDX_SZ: check index size
212 * UBIFS_CHK_ORPH: check orphans
213 * UBIFS_CHK_OLD_IDX: check the old index
214 * UBIFS_CHK_LPROPS: check lprops
215 * UBIFS_CHK_FS: check the file-system
216 */
217enum {
218 UBIFS_CHK_GEN = 0x1,
219 UBIFS_CHK_TNC = 0x2,
220 UBIFS_CHK_IDX_SZ = 0x4,
221 UBIFS_CHK_ORPH = 0x8,
222 UBIFS_CHK_OLD_IDX = 0x10,
223 UBIFS_CHK_LPROPS = 0x20,
224 UBIFS_CHK_FS = 0x40,
225};
226
227/*
Artem Bityutskiy5d630e42011-03-14 17:55:40 +0200228 * Special testing flags.
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300229 *
230 * UBIFS_TST_FORCE_IN_THE_GAPS: force the use of in-the-gaps method
231 * UBIFS_TST_RCVRY: failure mode for recovery testing
232 */
233enum {
234 UBIFS_TST_FORCE_IN_THE_GAPS = 0x2,
235 UBIFS_TST_RCVRY = 0x4,
236};
237
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300238extern spinlock_t dbg_lock;
239
240extern unsigned int ubifs_msg_flags;
241extern unsigned int ubifs_chk_flags;
242extern unsigned int ubifs_tst_flags;
243
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +0300244int ubifs_debugging_init(struct ubifs_info *c);
245void ubifs_debugging_exit(struct ubifs_info *c);
246
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300247/* Dump functions */
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300248const char *dbg_ntype(int type);
249const char *dbg_cstate(int cmt_state);
Artem Bityutskiy77a7ae52009-09-15 15:03:51 +0300250const char *dbg_jhead(int jhead);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300251const char *dbg_get_key_dump(const struct ubifs_info *c,
252 const union ubifs_key *key);
253void dbg_dump_inode(const struct ubifs_info *c, const struct inode *inode);
254void dbg_dump_node(const struct ubifs_info *c, const void *node);
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200255void dbg_dump_lpt_node(const struct ubifs_info *c, void *node, int lnum,
256 int offs);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300257void dbg_dump_budget_req(const struct ubifs_budget_req *req);
258void dbg_dump_lstats(const struct ubifs_lp_stats *lst);
259void dbg_dump_budg(struct ubifs_info *c);
260void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp);
261void dbg_dump_lprops(struct ubifs_info *c);
Adrian Hunter73944a62008-09-12 18:13:31 +0300262void dbg_dump_lpt_info(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300263void dbg_dump_leb(const struct ubifs_info *c, int lnum);
264void dbg_dump_znode(const struct ubifs_info *c,
265 const struct ubifs_znode *znode);
266void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat);
267void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
268 struct ubifs_nnode *parent, int iip);
269void dbg_dump_tnc(struct ubifs_info *c);
270void dbg_dump_index(struct ubifs_info *c);
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200271void dbg_dump_lpt_lebs(const struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300272
273/* Checking helper functions */
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300274typedef int (*dbg_leaf_callback)(struct ubifs_info *c,
275 struct ubifs_zbranch *zbr, void *priv);
276typedef int (*dbg_znode_callback)(struct ubifs_info *c,
277 struct ubifs_znode *znode, void *priv);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300278int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb,
279 dbg_znode_callback znode_cb, void *priv);
280
281/* Checking functions */
Artem Bityutskiy84abf972009-01-23 14:54:59 +0200282void dbg_save_space_info(struct ubifs_info *c);
283int dbg_check_space_info(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300284int dbg_check_lprops(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300285int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot);
286int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300287int dbg_check_cats(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300288int dbg_check_ltab(struct ubifs_info *c);
Adrian Hunter73944a62008-09-12 18:13:31 +0300289int dbg_chk_lpt_free_spc(struct ubifs_info *c);
290int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300291int dbg_check_synced_i_size(struct inode *inode);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300292int dbg_check_dir_size(struct ubifs_info *c, const struct inode *dir);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300293int dbg_check_tnc(struct ubifs_info *c, int extra);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300294int dbg_check_idx_size(struct ubifs_info *c, long long idx_size);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300295int dbg_check_filesystem(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300296void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
297 int add_pos);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300298int dbg_check_lprops(struct ubifs_info *c);
299int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode,
300 int row, int col);
Artem Bityutskiye3c3efc2009-08-27 16:34:19 +0300301int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode,
302 loff_t size);
Artem Bityutskiy3bb66b42010-08-07 10:06:11 +0300303int dbg_check_data_nodes_order(struct ubifs_info *c, struct list_head *head);
304int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300305
306/* Force the use of in-the-gaps method for testing */
307
308#define dbg_force_in_the_gaps_enabled \
309 (ubifs_tst_flags & UBIFS_TST_FORCE_IN_THE_GAPS)
310
311int dbg_force_in_the_gaps(void);
312
313/* Failure mode for recovery testing */
314
315#define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY)
316
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300317#ifndef UBIFS_DBG_PRESERVE_UBI
318
319#define ubi_leb_read dbg_leb_read
320#define ubi_leb_write dbg_leb_write
321#define ubi_leb_change dbg_leb_change
322#define ubi_leb_erase dbg_leb_erase
323#define ubi_leb_unmap dbg_leb_unmap
324#define ubi_is_mapped dbg_is_mapped
325#define ubi_leb_map dbg_leb_map
326
327#endif
328
329int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
330 int len, int check);
331int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
332 int offset, int len, int dtype);
333int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
334 int len, int dtype);
335int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum);
336int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum);
337int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum);
338int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype);
339
340static inline int dbg_read(struct ubi_volume_desc *desc, int lnum, char *buf,
341 int offset, int len)
342{
343 return dbg_leb_read(desc, lnum, buf, offset, len, 0);
344}
345
346static inline int dbg_write(struct ubi_volume_desc *desc, int lnum,
347 const void *buf, int offset, int len)
348{
349 return dbg_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN);
350}
351
352static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
353 const void *buf, int len)
354{
355 return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN);
356}
357
Artem Bityutskiy552ff312008-10-23 11:49:28 +0300358/* Debugfs-related stuff */
359int dbg_debugfs_init(void);
360void dbg_debugfs_exit(void);
361int dbg_debugfs_init_fs(struct ubifs_info *c);
362void dbg_debugfs_exit_fs(struct ubifs_info *c);
363
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300364#else /* !CONFIG_UBIFS_FS_DEBUG */
365
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300366/* Use "if (0)" to make compiler check arguments even if debugging is off */
367#define ubifs_assert(expr) do { \
368 if (0 && (expr)) \
369 printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
370 __func__, __LINE__, current->pid); \
371} while (0)
372
373#define dbg_err(fmt, ...) do { \
374 if (0) \
375 ubifs_err(fmt, ##__VA_ARGS__); \
376} while (0)
377
378#define dbg_msg(fmt, ...) do { \
379 if (0) \
380 printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", \
381 current->pid, __func__, ##__VA_ARGS__); \
382} while (0)
383
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300384#define dbg_dump_stack()
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300385#define ubifs_assert_cmt_locked(c)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300386
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300387#define dbg_gen(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
388#define dbg_jnl(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
389#define dbg_tnc(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
390#define dbg_lp(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
391#define dbg_find(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
392#define dbg_mnt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
393#define dbg_io(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
394#define dbg_cmt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
395#define dbg_budg(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
396#define dbg_log(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
397#define dbg_gc(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
398#define dbg_scan(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
399#define dbg_rcvry(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300400
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300401#define DBGKEY(key) ((char *)(key))
402#define DBGKEY1(key) ((char *)(key))
403
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200404#define ubifs_debugging_init(c) 0
405#define ubifs_debugging_exit(c) ({})
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +0300406
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200407#define dbg_ntype(type) ""
408#define dbg_cstate(cmt_state) ""
Artem Bityutskiy77a7ae52009-09-15 15:03:51 +0300409#define dbg_jhead(jhead) ""
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200410#define dbg_get_key_dump(c, key) ({})
411#define dbg_dump_inode(c, inode) ({})
412#define dbg_dump_node(c, node) ({})
413#define dbg_dump_lpt_node(c, node, lnum, offs) ({})
414#define dbg_dump_budget_req(req) ({})
415#define dbg_dump_lstats(lst) ({})
416#define dbg_dump_budg(c) ({})
417#define dbg_dump_lprop(c, lp) ({})
418#define dbg_dump_lprops(c) ({})
419#define dbg_dump_lpt_info(c) ({})
420#define dbg_dump_leb(c, lnum) ({})
421#define dbg_dump_znode(c, znode) ({})
422#define dbg_dump_heap(c, heap, cat) ({})
423#define dbg_dump_pnode(c, pnode, parent, iip) ({})
424#define dbg_dump_tnc(c) ({})
425#define dbg_dump_index(c) ({})
426#define dbg_dump_lpt_lebs(c) ({})
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300427
428#define dbg_walk_index(c, leaf_cb, znode_cb, priv) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300429#define dbg_old_index_check_init(c, zroot) 0
Artem Bityutskiy84abf972009-01-23 14:54:59 +0200430#define dbg_save_space_info(c) ({})
431#define dbg_check_space_info(c) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300432#define dbg_check_old_index(c, zroot) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300433#define dbg_check_cats(c) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300434#define dbg_check_ltab(c) 0
Adrian Hunter73944a62008-09-12 18:13:31 +0300435#define dbg_chk_lpt_free_spc(c) 0
436#define dbg_chk_lpt_sz(c, action, len) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300437#define dbg_check_synced_i_size(inode) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300438#define dbg_check_dir_size(c, dir) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300439#define dbg_check_tnc(c, x) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300440#define dbg_check_idx_size(c, idx_size) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300441#define dbg_check_filesystem(c) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300442#define dbg_check_heap(c, heap, cat, add_pos) ({})
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300443#define dbg_check_lprops(c) 0
444#define dbg_check_lpt_nodes(c, cnode, row, col) 0
Artem Bityutskiye3c3efc2009-08-27 16:34:19 +0300445#define dbg_check_inode_size(c, inode, size) 0
Artem Bityutskiy3bb66b42010-08-07 10:06:11 +0300446#define dbg_check_data_nodes_order(c, head) 0
447#define dbg_check_nondata_nodes_order(c, head) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300448#define dbg_force_in_the_gaps_enabled 0
449#define dbg_force_in_the_gaps() 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300450#define dbg_failure_mode 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300451
Artem Bityutskiy552ff312008-10-23 11:49:28 +0300452#define dbg_debugfs_init() 0
453#define dbg_debugfs_exit()
454#define dbg_debugfs_init_fs(c) 0
455#define dbg_debugfs_exit_fs(c) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300456
Artem Bityutskiy552ff312008-10-23 11:49:28 +0300457#endif /* !CONFIG_UBIFS_FS_DEBUG */
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300458#endif /* !__UBIFS_DEBUG_H__ */