blob: c1cd73b2e06e4ecc541ebf3b5f840572c8bfe282 [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.
30 * @buf: a buffer of LEB size, used for various purposes
31 * @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()'
33 * @old_zroot_sqnum: old index root sqnum - used by 'dbg_check_old_index()'
34 * @failure_mode: failure mode for recovery testing
35 * @fail_delay: 0=>don't delay, 1=>delay a time, 2=>delay a number of calls
36 * @fail_timeout: time in jiffies when delay of failure mode expires
37 * @fail_cnt: current number of calls to failure mode I/O functions
38 * @fail_cnt_max: number of calls by which to delay failure mode
39 * @chk_lpt_sz: used by LPT tree size checker
40 * @chk_lpt_sz2: used by LPT tree size checker
41 * @chk_lpt_wastage: used by LPT tree size checker
42 * @chk_lpt_lebs: used by LPT tree size checker
43 * @new_nhead_offs: used by LPT tree size checker
Artem Bityutskiy84abf972009-01-23 14:54:59 +020044 * @new_ihead_lnum: used by debugging to check @c->ihead_lnum
45 * @new_ihead_offs: used by debugging to check @c->ihead_offs
Artem Bityutskiy552ff312008-10-23 11:49:28 +030046 *
Artem Bityutskiy84abf972009-01-23 14:54:59 +020047 * @saved_lst: saved lprops statistics (used by 'dbg_save_space_info()')
48 * @saved_free: saved free space (used by 'dbg_save_space_info()')
49 *
50 * dfs_dir_name: name of debugfs directory containing this file-system's files
51 * dfs_dir: direntry object of the file-system debugfs directory
52 * dfs_dump_lprops: "dump lprops" debugfs knob
53 * dfs_dump_budg: "dump budgeting information" debugfs knob
54 * dfs_dump_tnc: "dump TNC" debugfs knob
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +030055 */
56struct ubifs_debug_info {
57 void *buf;
58 struct ubifs_zbranch old_zroot;
59 int old_zroot_level;
60 unsigned long long old_zroot_sqnum;
61 int failure_mode;
62 int fail_delay;
63 unsigned long fail_timeout;
64 unsigned int fail_cnt;
65 unsigned int fail_cnt_max;
66 long long chk_lpt_sz;
67 long long chk_lpt_sz2;
68 long long chk_lpt_wastage;
69 int chk_lpt_lebs;
70 int new_nhead_offs;
71 int new_ihead_lnum;
72 int new_ihead_offs;
Artem Bityutskiy552ff312008-10-23 11:49:28 +030073
Artem Bityutskiy84abf972009-01-23 14:54:59 +020074 struct ubifs_lp_stats saved_lst;
75 long long saved_free;
76
77 char dfs_dir_name[100];
78 struct dentry *dfs_dir;
79 struct dentry *dfs_dump_lprops;
80 struct dentry *dfs_dump_budg;
81 struct dentry *dfs_dump_tnc;
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +030082};
Artem Bityutskiy1e517642008-07-14 19:08:37 +030083
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +030084#define ubifs_assert(expr) do { \
Artem Bityutskiy1e517642008-07-14 19:08:37 +030085 if (unlikely(!(expr))) { \
86 printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
87 __func__, __LINE__, current->pid); \
88 dbg_dump_stack(); \
89 } \
90} while (0)
91
92#define ubifs_assert_cmt_locked(c) do { \
93 if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
94 up_write(&(c)->commit_sem); \
95 printk(KERN_CRIT "commit lock is not locked!\n"); \
96 ubifs_assert(0); \
97 } \
98} while (0)
99
100#define dbg_dump_stack() do { \
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
118#define dbg_err(fmt, ...) do { \
119 spin_lock(&dbg_lock); \
120 ubifs_err(fmt, ##__VA_ARGS__); \
121 spin_unlock(&dbg_lock); \
122} while (0)
123
124const char *dbg_key_str0(const struct ubifs_info *c,
125 const union ubifs_key *key);
126const char *dbg_key_str1(const struct ubifs_info *c,
127 const union ubifs_key *key);
128
129/*
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300130 * DBGKEY macros require @dbg_lock to be held, which it is in the dbg message
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300131 * macros.
132 */
133#define DBGKEY(key) dbg_key_str0(c, (key))
134#define DBGKEY1(key) dbg_key_str1(c, (key))
135
136/* General messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300137#define dbg_gen(fmt, ...) dbg_do_msg(UBIFS_MSG_GEN, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300138
139/* Additional journal messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300140#define dbg_jnl(fmt, ...) dbg_do_msg(UBIFS_MSG_JNL, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300141
142/* Additional TNC messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300143#define dbg_tnc(fmt, ...) dbg_do_msg(UBIFS_MSG_TNC, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300144
145/* Additional lprops messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300146#define dbg_lp(fmt, ...) dbg_do_msg(UBIFS_MSG_LP, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300147
148/* Additional LEB find messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300149#define dbg_find(fmt, ...) dbg_do_msg(UBIFS_MSG_FIND, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300150
151/* Additional mount messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300152#define dbg_mnt(fmt, ...) dbg_do_msg(UBIFS_MSG_MNT, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300153
154/* Additional I/O messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300155#define dbg_io(fmt, ...) dbg_do_msg(UBIFS_MSG_IO, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300156
157/* Additional commit messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300158#define dbg_cmt(fmt, ...) dbg_do_msg(UBIFS_MSG_CMT, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300159
160/* Additional budgeting messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300161#define dbg_budg(fmt, ...) dbg_do_msg(UBIFS_MSG_BUDG, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300162
163/* Additional log messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300164#define dbg_log(fmt, ...) dbg_do_msg(UBIFS_MSG_LOG, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300165
166/* Additional gc messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300167#define dbg_gc(fmt, ...) dbg_do_msg(UBIFS_MSG_GC, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300168
169/* Additional scan messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300170#define dbg_scan(fmt, ...) dbg_do_msg(UBIFS_MSG_SCAN, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300171
172/* Additional recovery messages */
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300173#define dbg_rcvry(fmt, ...) dbg_do_msg(UBIFS_MSG_RCVRY, fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300174
175/*
176 * Debugging message type flags (must match msg_type_names in debug.c).
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 */
192enum {
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 *
217 * UBIFS_CHK_GEN: general checks
218 * UBIFS_CHK_TNC: check TNC
219 * UBIFS_CHK_IDX_SZ: check index size
220 * UBIFS_CHK_ORPH: check orphans
221 * UBIFS_CHK_OLD_IDX: check the old index
222 * UBIFS_CHK_LPROPS: check lprops
223 * UBIFS_CHK_FS: check the file-system
224 */
225enum {
226 UBIFS_CHK_GEN = 0x1,
227 UBIFS_CHK_TNC = 0x2,
228 UBIFS_CHK_IDX_SZ = 0x4,
229 UBIFS_CHK_ORPH = 0x8,
230 UBIFS_CHK_OLD_IDX = 0x10,
231 UBIFS_CHK_LPROPS = 0x20,
232 UBIFS_CHK_FS = 0x40,
233};
234
235/*
236 * Special testing flags (must match tst_names in debug.c).
237 *
238 * UBIFS_TST_FORCE_IN_THE_GAPS: force the use of in-the-gaps method
239 * UBIFS_TST_RCVRY: failure mode for recovery testing
240 */
241enum {
242 UBIFS_TST_FORCE_IN_THE_GAPS = 0x2,
243 UBIFS_TST_RCVRY = 0x4,
244};
245
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
262extern spinlock_t dbg_lock;
263
264extern unsigned int ubifs_msg_flags;
265extern unsigned int ubifs_chk_flags;
266extern unsigned int ubifs_tst_flags;
267
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +0300268int ubifs_debugging_init(struct ubifs_info *c);
269void ubifs_debugging_exit(struct ubifs_info *c);
270
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300271/* Dump functions */
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300272const char *dbg_ntype(int type);
273const char *dbg_cstate(int cmt_state);
274const char *dbg_get_key_dump(const struct ubifs_info *c,
275 const union ubifs_key *key);
276void dbg_dump_inode(const struct ubifs_info *c, const struct inode *inode);
277void dbg_dump_node(const struct ubifs_info *c, const void *node);
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200278void dbg_dump_lpt_node(const struct ubifs_info *c, void *node, int lnum,
279 int offs);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300280void dbg_dump_budget_req(const struct ubifs_budget_req *req);
281void dbg_dump_lstats(const struct ubifs_lp_stats *lst);
282void dbg_dump_budg(struct ubifs_info *c);
283void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp);
284void dbg_dump_lprops(struct ubifs_info *c);
Adrian Hunter73944a62008-09-12 18:13:31 +0300285void dbg_dump_lpt_info(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300286void dbg_dump_leb(const struct ubifs_info *c, int lnum);
287void dbg_dump_znode(const struct ubifs_info *c,
288 const struct ubifs_znode *znode);
289void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat);
290void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
291 struct ubifs_nnode *parent, int iip);
292void dbg_dump_tnc(struct ubifs_info *c);
293void dbg_dump_index(struct ubifs_info *c);
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200294void dbg_dump_lpt_lebs(const struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300295
296/* Checking helper functions */
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300297typedef int (*dbg_leaf_callback)(struct ubifs_info *c,
298 struct ubifs_zbranch *zbr, void *priv);
299typedef int (*dbg_znode_callback)(struct ubifs_info *c,
300 struct ubifs_znode *znode, void *priv);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300301int dbg_walk_index(struct ubifs_info *c, dbg_leaf_callback leaf_cb,
302 dbg_znode_callback znode_cb, void *priv);
303
304/* Checking functions */
Artem Bityutskiy84abf972009-01-23 14:54:59 +0200305void dbg_save_space_info(struct ubifs_info *c);
306int dbg_check_space_info(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300307int dbg_check_lprops(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300308int dbg_old_index_check_init(struct ubifs_info *c, struct ubifs_zbranch *zroot);
309int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300310int dbg_check_cats(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300311int dbg_check_ltab(struct ubifs_info *c);
Adrian Hunter73944a62008-09-12 18:13:31 +0300312int dbg_chk_lpt_free_spc(struct ubifs_info *c);
313int dbg_chk_lpt_sz(struct ubifs_info *c, int action, int len);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300314int dbg_check_synced_i_size(struct inode *inode);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300315int dbg_check_dir_size(struct ubifs_info *c, const struct inode *dir);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300316int dbg_check_tnc(struct ubifs_info *c, int extra);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300317int dbg_check_idx_size(struct ubifs_info *c, long long idx_size);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300318int dbg_check_filesystem(struct ubifs_info *c);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300319void dbg_check_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat,
320 int add_pos);
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300321int dbg_check_lprops(struct ubifs_info *c);
322int dbg_check_lpt_nodes(struct ubifs_info *c, struct ubifs_cnode *cnode,
323 int row, int col);
324
325/* Force the use of in-the-gaps method for testing */
326
327#define dbg_force_in_the_gaps_enabled \
328 (ubifs_tst_flags & UBIFS_TST_FORCE_IN_THE_GAPS)
329
330int dbg_force_in_the_gaps(void);
331
332/* Failure mode for recovery testing */
333
334#define dbg_failure_mode (ubifs_tst_flags & UBIFS_TST_RCVRY)
335
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300336#ifndef UBIFS_DBG_PRESERVE_UBI
337
338#define ubi_leb_read dbg_leb_read
339#define ubi_leb_write dbg_leb_write
340#define ubi_leb_change dbg_leb_change
341#define ubi_leb_erase dbg_leb_erase
342#define ubi_leb_unmap dbg_leb_unmap
343#define ubi_is_mapped dbg_is_mapped
344#define ubi_leb_map dbg_leb_map
345
346#endif
347
348int dbg_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset,
349 int len, int check);
350int dbg_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf,
351 int offset, int len, int dtype);
352int dbg_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf,
353 int len, int dtype);
354int dbg_leb_erase(struct ubi_volume_desc *desc, int lnum);
355int dbg_leb_unmap(struct ubi_volume_desc *desc, int lnum);
356int dbg_is_mapped(struct ubi_volume_desc *desc, int lnum);
357int dbg_leb_map(struct ubi_volume_desc *desc, int lnum, int dtype);
358
359static inline int dbg_read(struct ubi_volume_desc *desc, int lnum, char *buf,
360 int offset, int len)
361{
362 return dbg_leb_read(desc, lnum, buf, offset, len, 0);
363}
364
365static inline int dbg_write(struct ubi_volume_desc *desc, int lnum,
366 const void *buf, int offset, int len)
367{
368 return dbg_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN);
369}
370
371static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
372 const void *buf, int len)
373{
374 return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN);
375}
376
Artem Bityutskiy552ff312008-10-23 11:49:28 +0300377/* Debugfs-related stuff */
378int dbg_debugfs_init(void);
379void dbg_debugfs_exit(void);
380int dbg_debugfs_init_fs(struct ubifs_info *c);
381void dbg_debugfs_exit_fs(struct ubifs_info *c);
382
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300383#else /* !CONFIG_UBIFS_FS_DEBUG */
384
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300385/* Use "if (0)" to make compiler check arguments even if debugging is off */
386#define ubifs_assert(expr) do { \
387 if (0 && (expr)) \
388 printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
389 __func__, __LINE__, current->pid); \
390} while (0)
391
392#define dbg_err(fmt, ...) do { \
393 if (0) \
394 ubifs_err(fmt, ##__VA_ARGS__); \
395} while (0)
396
397#define dbg_msg(fmt, ...) do { \
398 if (0) \
399 printk(KERN_DEBUG "UBIFS DBG (pid %d): %s: " fmt "\n", \
400 current->pid, __func__, ##__VA_ARGS__); \
401} while (0)
402
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300403#define dbg_dump_stack()
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300404#define ubifs_assert_cmt_locked(c)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300405
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300406#define dbg_gen(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
407#define dbg_jnl(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
408#define dbg_tnc(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
409#define dbg_lp(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
410#define dbg_find(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
411#define dbg_mnt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
412#define dbg_io(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
413#define dbg_cmt(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
414#define dbg_budg(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
415#define dbg_log(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
416#define dbg_gc(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
417#define dbg_scan(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
418#define dbg_rcvry(fmt, ...) dbg_msg(fmt, ##__VA_ARGS__)
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300419
Artem Bityutskiy840dc6b2008-08-01 18:13:37 +0300420#define DBGKEY(key) ((char *)(key))
421#define DBGKEY1(key) ((char *)(key))
422
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200423#define ubifs_debugging_init(c) 0
424#define ubifs_debugging_exit(c) ({})
Artem Bityutskiy17c2f9f2008-10-17 13:31:39 +0300425
Artem Bityutskiy2ba5f7a2008-10-31 17:32:30 +0200426#define dbg_ntype(type) ""
427#define dbg_cstate(cmt_state) ""
428#define dbg_get_key_dump(c, key) ({})
429#define dbg_dump_inode(c, inode) ({})
430#define dbg_dump_node(c, node) ({})
431#define dbg_dump_lpt_node(c, node, lnum, offs) ({})
432#define dbg_dump_budget_req(req) ({})
433#define dbg_dump_lstats(lst) ({})
434#define dbg_dump_budg(c) ({})
435#define dbg_dump_lprop(c, lp) ({})
436#define dbg_dump_lprops(c) ({})
437#define dbg_dump_lpt_info(c) ({})
438#define dbg_dump_leb(c, lnum) ({})
439#define dbg_dump_znode(c, znode) ({})
440#define dbg_dump_heap(c, heap, cat) ({})
441#define dbg_dump_pnode(c, pnode, parent, iip) ({})
442#define dbg_dump_tnc(c) ({})
443#define dbg_dump_index(c) ({})
444#define dbg_dump_lpt_lebs(c) ({})
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300445
446#define dbg_walk_index(c, leaf_cb, znode_cb, priv) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300447#define dbg_old_index_check_init(c, zroot) 0
Artem Bityutskiy84abf972009-01-23 14:54:59 +0200448#define dbg_save_space_info(c) ({})
449#define dbg_check_space_info(c) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300450#define dbg_check_old_index(c, zroot) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300451#define dbg_check_cats(c) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300452#define dbg_check_ltab(c) 0
Adrian Hunter73944a62008-09-12 18:13:31 +0300453#define dbg_chk_lpt_free_spc(c) 0
454#define dbg_chk_lpt_sz(c, action, len) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300455#define dbg_check_synced_i_size(inode) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300456#define dbg_check_dir_size(c, dir) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300457#define dbg_check_tnc(c, x) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300458#define dbg_check_idx_size(c, idx_size) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300459#define dbg_check_filesystem(c) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300460#define dbg_check_heap(c, heap, cat, add_pos) ({})
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300461#define dbg_check_lprops(c) 0
462#define dbg_check_lpt_nodes(c, cnode, row, col) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300463#define dbg_force_in_the_gaps_enabled 0
464#define dbg_force_in_the_gaps() 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300465#define dbg_failure_mode 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300466
Artem Bityutskiy552ff312008-10-23 11:49:28 +0300467#define dbg_debugfs_init() 0
468#define dbg_debugfs_exit()
469#define dbg_debugfs_init_fs(c) 0
470#define dbg_debugfs_exit_fs(c) 0
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300471
Artem Bityutskiy552ff312008-10-23 11:49:28 +0300472#endif /* !CONFIG_UBIFS_FS_DEBUG */
Artem Bityutskiy1e517642008-07-14 19:08:37 +0300473#endif /* !__UBIFS_DEBUG_H__ */