Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 1 | /* |
| 2 | * JFFS2 -- Journalling Flash File System, Version 2. |
| 3 | * |
| 4 | * Copyright (C) 2001-2003 Red Hat, Inc. |
| 5 | * |
| 6 | * Created by David Woodhouse <dwmw2@infradead.org> |
| 7 | * |
| 8 | * For licensing information, see the file 'LICENCE' in this directory. |
| 9 | * |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 10 | * $Id: debug.h,v 1.21 2005/11/07 11:14:39 gleixner Exp $ |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 11 | * |
| 12 | */ |
| 13 | #ifndef _JFFS2_DEBUG_H_ |
| 14 | #define _JFFS2_DEBUG_H_ |
| 15 | |
David Woodhouse | e499e01 | 2007-01-13 08:19:03 +0800 | [diff] [blame] | 16 | #include <linux/sched.h> |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 17 | |
| 18 | #ifndef CONFIG_JFFS2_FS_DEBUG |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 19 | #define CONFIG_JFFS2_FS_DEBUG 0 |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 20 | #endif |
| 21 | |
Artem B. Bityutskiy | 008531f | 2005-10-24 17:22:36 +0100 | [diff] [blame] | 22 | #if CONFIG_JFFS2_FS_DEBUG > 0 |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 23 | /* Enable "paranoia" checks and dumps */ |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 24 | #define JFFS2_DBG_PARANOIA_CHECKS |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 25 | #define JFFS2_DBG_DUMPS |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 26 | |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 27 | /* |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 28 | * By defining/undefining the below macros one may select debugging messages |
| 29 | * fro specific JFFS2 subsystems. |
| 30 | */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 31 | #define JFFS2_DBG_READINODE_MESSAGES |
| 32 | #define JFFS2_DBG_FRAGTREE_MESSAGES |
| 33 | #define JFFS2_DBG_DENTLIST_MESSAGES |
| 34 | #define JFFS2_DBG_NODEREF_MESSAGES |
| 35 | #define JFFS2_DBG_INOCACHE_MESSAGES |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 36 | #define JFFS2_DBG_SUMMARY_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 37 | #define JFFS2_DBG_FSBUILD_MESSAGES |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 38 | #endif |
| 39 | |
Artem B. Bityutskiy | 008531f | 2005-10-24 17:22:36 +0100 | [diff] [blame] | 40 | #if CONFIG_JFFS2_FS_DEBUG > 1 |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 41 | #define JFFS2_DBG_FRAGTREE2_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 42 | #define JFFS2_DBG_MEMALLOC_MESSAGES |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 43 | #endif |
| 44 | |
Artem B. Bityutskiy | 45ca1b5 | 2005-08-05 12:43:47 +0100 | [diff] [blame] | 45 | /* Sanity checks are supposed to be light-weight and enabled by default */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 46 | #define JFFS2_DBG_SANITY_CHECKS |
| 47 | |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 48 | /* |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 49 | * Dx() are mainly used for debugging messages, they must go away and be |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 50 | * superseded by nicer dbg_xxx() macros... |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 51 | */ |
| 52 | #if CONFIG_JFFS2_FS_DEBUG > 0 |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 53 | #define D1(x) x |
| 54 | #else |
| 55 | #define D1(x) |
| 56 | #endif |
| 57 | |
| 58 | #if CONFIG_JFFS2_FS_DEBUG > 1 |
| 59 | #define D2(x) x |
| 60 | #else |
| 61 | #define D2(x) |
| 62 | #endif |
| 63 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 64 | /* The prefixes of JFFS2 messages */ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 65 | #define JFFS2_DBG_PREFIX "[JFFS2 DBG]" |
| 66 | #define JFFS2_ERR_PREFIX "JFFS2 error:" |
| 67 | #define JFFS2_WARN_PREFIX "JFFS2 warning:" |
| 68 | #define JFFS2_NOTICE_PREFIX "JFFS2 notice:" |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 69 | |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 70 | #define JFFS2_ERR KERN_ERR |
| 71 | #define JFFS2_WARN KERN_WARNING |
| 72 | #define JFFS2_NOT KERN_NOTICE |
| 73 | #define JFFS2_DBG KERN_DEBUG |
| 74 | |
| 75 | #define JFFS2_DBG_MSG_PREFIX JFFS2_DBG JFFS2_DBG_PREFIX |
| 76 | #define JFFS2_ERR_MSG_PREFIX JFFS2_ERR JFFS2_ERR_PREFIX |
| 77 | #define JFFS2_WARN_MSG_PREFIX JFFS2_WARN JFFS2_WARN_PREFIX |
| 78 | #define JFFS2_NOTICE_MSG_PREFIX JFFS2_NOT JFFS2_NOTICE_PREFIX |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 79 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 80 | /* JFFS2 message macros */ |
| 81 | #define JFFS2_ERROR(fmt, ...) \ |
| 82 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 83 | printk(JFFS2_ERR_MSG_PREFIX \ |
Artem B. Bityutskiy | 8d5df40 | 2005-08-17 15:13:48 +0100 | [diff] [blame] | 84 | " (%d) %s: " fmt, current->pid, \ |
Andrew Morton | 02b7068 | 2005-11-23 13:37:47 -0800 | [diff] [blame] | 85 | __FUNCTION__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 86 | } while(0) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 87 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 88 | #define JFFS2_WARNING(fmt, ...) \ |
| 89 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 90 | printk(JFFS2_WARN_MSG_PREFIX \ |
Artem B. Bityutskiy | 8d5df40 | 2005-08-17 15:13:48 +0100 | [diff] [blame] | 91 | " (%d) %s: " fmt, current->pid, \ |
Andrew Morton | 02b7068 | 2005-11-23 13:37:47 -0800 | [diff] [blame] | 92 | __FUNCTION__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 93 | } while(0) |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 94 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 95 | #define JFFS2_NOTICE(fmt, ...) \ |
| 96 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 97 | printk(JFFS2_NOTICE_MSG_PREFIX \ |
Artem B. Bityutskiy | 8d5df40 | 2005-08-17 15:13:48 +0100 | [diff] [blame] | 98 | " (%d) %s: " fmt, current->pid, \ |
Andrew Morton | 02b7068 | 2005-11-23 13:37:47 -0800 | [diff] [blame] | 99 | __FUNCTION__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 100 | } while(0) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 101 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 102 | #define JFFS2_DEBUG(fmt, ...) \ |
| 103 | do { \ |
Artem B. Bityutskiy | 81e39cf | 2005-09-14 17:57:35 +0100 | [diff] [blame] | 104 | printk(JFFS2_DBG_MSG_PREFIX \ |
Artem B. Bityutskiy | 8d5df40 | 2005-08-17 15:13:48 +0100 | [diff] [blame] | 105 | " (%d) %s: " fmt, current->pid, \ |
Andrew Morton | 02b7068 | 2005-11-23 13:37:47 -0800 | [diff] [blame] | 106 | __FUNCTION__ , ##__VA_ARGS__); \ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 107 | } while(0) |
| 108 | |
Thomas Gleixner | 182ec4e | 2005-11-07 11:16:07 +0000 | [diff] [blame] | 109 | /* |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 110 | * We split our debugging messages on several parts, depending on the JFFS2 |
| 111 | * subsystem the message belongs to. |
| 112 | */ |
| 113 | /* Read inode debugging messages */ |
| 114 | #ifdef JFFS2_DBG_READINODE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 115 | #define dbg_readinode(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 116 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 117 | #define dbg_readinode(fmt, ...) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 118 | #endif |
| 119 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 120 | /* Fragtree build debugging messages */ |
| 121 | #ifdef JFFS2_DBG_FRAGTREE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 122 | #define dbg_fragtree(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 123 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 124 | #define dbg_fragtree(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 125 | #endif |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 126 | #ifdef JFFS2_DBG_FRAGTREE2_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 127 | #define dbg_fragtree2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 128 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 129 | #define dbg_fragtree2(fmt, ...) |
Artem B. Bityutskiy | e0e3006 | 2005-07-31 10:08:41 +0100 | [diff] [blame] | 130 | #endif |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 131 | |
| 132 | /* Directory entry list manilulation debugging messages */ |
| 133 | #ifdef JFFS2_DBG_DENTLIST_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 134 | #define dbg_dentlist(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 135 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 136 | #define dbg_dentlist(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 137 | #endif |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 138 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 139 | /* Print the messages about manipulating node_refs */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 140 | #ifdef JFFS2_DBG_NODEREF_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 141 | #define dbg_noderef(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 142 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 143 | #define dbg_noderef(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 144 | #endif |
| 145 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 146 | /* Manipulations with the list of inodes (JFFS2 inocache) */ |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 147 | #ifdef JFFS2_DBG_INOCACHE_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 148 | #define dbg_inocache(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 149 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 150 | #define dbg_inocache(fmt, ...) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 151 | #endif |
| 152 | |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 153 | /* Summary debugging messages */ |
| 154 | #ifdef JFFS2_DBG_SUMMARY_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 155 | #define dbg_summary(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 156 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 157 | #define dbg_summary(fmt, ...) |
| 158 | #endif |
| 159 | |
| 160 | /* File system build messages */ |
| 161 | #ifdef JFFS2_DBG_FSBUILD_MESSAGES |
| 162 | #define dbg_fsbuild(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
| 163 | #else |
| 164 | #define dbg_fsbuild(fmt, ...) |
Ferenc Havasi | e631ddb | 2005-09-07 09:35:26 +0100 | [diff] [blame] | 165 | #endif |
| 166 | |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 167 | /* Watch the object allocations */ |
| 168 | #ifdef JFFS2_DBG_MEMALLOC_MESSAGES |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 169 | #define dbg_memalloc(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 170 | #else |
Artem B. Bityutskiy | 733802d | 2005-09-22 12:25:00 +0100 | [diff] [blame] | 171 | #define dbg_memalloc(fmt, ...) |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 172 | #endif |
| 173 | |
KaiGai Kohei | aa98d7c | 2006-05-13 15:09:47 +0900 | [diff] [blame] | 174 | /* Watch the XATTR subsystem */ |
| 175 | #ifdef JFFS2_DBG_XATTR_MESSAGES |
| 176 | #define dbg_xattr(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__) |
| 177 | #else |
| 178 | #define dbg_xattr(fmt, ...) |
| 179 | #endif |
Artem B. Bityutskiy | f538c96 | 2005-07-27 15:16:57 +0100 | [diff] [blame] | 180 | |
Artem B. Bityutskiy | 45ca1b5 | 2005-08-05 12:43:47 +0100 | [diff] [blame] | 181 | /* "Sanity" checks */ |
| 182 | void |
| 183 | __jffs2_dbg_acct_sanity_check_nolock(struct jffs2_sb_info *c, |
| 184 | struct jffs2_eraseblock *jeb); |
| 185 | void |
| 186 | __jffs2_dbg_acct_sanity_check(struct jffs2_sb_info *c, |
| 187 | struct jffs2_eraseblock *jeb); |
| 188 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 189 | /* "Paranoia" checks */ |
| 190 | void |
| 191 | __jffs2_dbg_fragtree_paranoia_check(struct jffs2_inode_info *f); |
| 192 | void |
| 193 | __jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f); |
| 194 | void |
| 195 | __jffs2_dbg_acct_paranoia_check(struct jffs2_sb_info *c, |
| 196 | struct jffs2_eraseblock *jeb); |
| 197 | void |
| 198 | __jffs2_dbg_acct_paranoia_check_nolock(struct jffs2_sb_info *c, |
| 199 | struct jffs2_eraseblock *jeb); |
| 200 | void |
| 201 | __jffs2_dbg_prewrite_paranoia_check(struct jffs2_sb_info *c, |
| 202 | uint32_t ofs, int len); |
| 203 | |
| 204 | /* "Dump" functions */ |
| 205 | void |
| 206 | __jffs2_dbg_dump_jeb(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb); |
| 207 | void |
| 208 | __jffs2_dbg_dump_jeb_nolock(struct jffs2_eraseblock *jeb); |
| 209 | void |
| 210 | __jffs2_dbg_dump_block_lists(struct jffs2_sb_info *c); |
| 211 | void |
| 212 | __jffs2_dbg_dump_block_lists_nolock(struct jffs2_sb_info *c); |
| 213 | void |
| 214 | __jffs2_dbg_dump_node_refs(struct jffs2_sb_info *c, |
| 215 | struct jffs2_eraseblock *jeb); |
| 216 | void |
| 217 | __jffs2_dbg_dump_node_refs_nolock(struct jffs2_sb_info *c, |
| 218 | struct jffs2_eraseblock *jeb); |
| 219 | void |
| 220 | __jffs2_dbg_dump_fragtree(struct jffs2_inode_info *f); |
| 221 | void |
| 222 | __jffs2_dbg_dump_fragtree_nolock(struct jffs2_inode_info *f); |
| 223 | void |
| 224 | __jffs2_dbg_dump_buffer(unsigned char *buf, int len, uint32_t offs); |
| 225 | void |
| 226 | __jffs2_dbg_dump_node(struct jffs2_sb_info *c, uint32_t ofs); |
| 227 | |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 228 | #ifdef JFFS2_DBG_PARANOIA_CHECKS |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 229 | #define jffs2_dbg_fragtree_paranoia_check(f) \ |
| 230 | __jffs2_dbg_fragtree_paranoia_check(f) |
| 231 | #define jffs2_dbg_fragtree_paranoia_check_nolock(f) \ |
| 232 | __jffs2_dbg_fragtree_paranoia_check_nolock(f) |
| 233 | #define jffs2_dbg_acct_paranoia_check(c, jeb) \ |
| 234 | __jffs2_dbg_acct_paranoia_check(c,jeb) |
| 235 | #define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) \ |
| 236 | __jffs2_dbg_acct_paranoia_check_nolock(c,jeb) |
| 237 | #define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) \ |
| 238 | __jffs2_dbg_prewrite_paranoia_check(c, ofs, len) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 239 | #else |
| 240 | #define jffs2_dbg_fragtree_paranoia_check(f) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 241 | #define jffs2_dbg_fragtree_paranoia_check_nolock(f) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 242 | #define jffs2_dbg_acct_paranoia_check(c, jeb) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 243 | #define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 244 | #define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) |
| 245 | #endif /* !JFFS2_PARANOIA_CHECKS */ |
| 246 | |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 247 | #ifdef JFFS2_DBG_DUMPS |
| 248 | #define jffs2_dbg_dump_jeb(c, jeb) \ |
| 249 | __jffs2_dbg_dump_jeb(c, jeb); |
| 250 | #define jffs2_dbg_dump_jeb_nolock(jeb) \ |
| 251 | __jffs2_dbg_dump_jeb_nolock(jeb); |
| 252 | #define jffs2_dbg_dump_block_lists(c) \ |
| 253 | __jffs2_dbg_dump_block_lists(c) |
| 254 | #define jffs2_dbg_dump_block_lists_nolock(c) \ |
| 255 | __jffs2_dbg_dump_block_lists_nolock(c) |
| 256 | #define jffs2_dbg_dump_fragtree(f) \ |
| 257 | __jffs2_dbg_dump_fragtree(f); |
| 258 | #define jffs2_dbg_dump_fragtree_nolock(f) \ |
| 259 | __jffs2_dbg_dump_fragtree_nolock(f); |
| 260 | #define jffs2_dbg_dump_buffer(buf, len, offs) \ |
| 261 | __jffs2_dbg_dump_buffer(*buf, len, offs); |
| 262 | #define jffs2_dbg_dump_node(c, ofs) \ |
| 263 | __jffs2_dbg_dump_node(c, ofs); |
| 264 | #else |
| 265 | #define jffs2_dbg_dump_jeb(c, jeb) |
| 266 | #define jffs2_dbg_dump_jeb_nolock(jeb) |
| 267 | #define jffs2_dbg_dump_block_lists(c) |
| 268 | #define jffs2_dbg_dump_block_lists_nolock(c) |
| 269 | #define jffs2_dbg_dump_fragtree(f) |
| 270 | #define jffs2_dbg_dump_fragtree_nolock(f) |
| 271 | #define jffs2_dbg_dump_buffer(buf, len, offs) |
| 272 | #define jffs2_dbg_dump_node(c, ofs) |
| 273 | #endif /* !JFFS2_DBG_DUMPS */ |
| 274 | |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 275 | #ifdef JFFS2_DBG_SANITY_CHECKS |
Artem B. Bityutskiy | 45ca1b5 | 2005-08-05 12:43:47 +0100 | [diff] [blame] | 276 | #define jffs2_dbg_acct_sanity_check(c, jeb) \ |
| 277 | __jffs2_dbg_acct_sanity_check(c, jeb) |
| 278 | #define jffs2_dbg_acct_sanity_check_nolock(c, jeb) \ |
| 279 | __jffs2_dbg_acct_sanity_check_nolock(c, jeb) |
Artem B. Bityutskiy | e0c8e42 | 2005-07-24 16:14:17 +0100 | [diff] [blame] | 280 | #else |
| 281 | #define jffs2_dbg_acct_sanity_check(c, jeb) |
| 282 | #define jffs2_dbg_acct_sanity_check_nolock(c, jeb) |
Artem B. Bityutskiy | 730554d | 2005-07-17 07:56:26 +0100 | [diff] [blame] | 283 | #endif /* !JFFS2_DBG_SANITY_CHECKS */ |
| 284 | |
| 285 | #endif /* _JFFS2_DEBUG_H_ */ |