13#ifndef _JFFS2_DEBUG_H_
14#define _JFFS2_DEBUG_H_
16#include <linux/printk.h>
17#include <linux/sched.h>
19#ifndef CONFIG_JFFS2_FS_DEBUG
20#define CONFIG_JFFS2_FS_DEBUG 0
23#if CONFIG_JFFS2_FS_DEBUG > 0
25#define JFFS2_DBG_PARANOIA_CHECKS
26#define JFFS2_DBG_DUMPS
32#define JFFS2_DBG_READINODE_MESSAGES
33#define JFFS2_DBG_FRAGTREE_MESSAGES
34#define JFFS2_DBG_DENTLIST_MESSAGES
35#define JFFS2_DBG_NODEREF_MESSAGES
36#define JFFS2_DBG_INOCACHE_MESSAGES
37#define JFFS2_DBG_SUMMARY_MESSAGES
38#define JFFS2_DBG_FSBUILD_MESSAGES
41#if CONFIG_JFFS2_FS_DEBUG > 1
42#define JFFS2_DBG_FRAGTREE2_MESSAGES
43#define JFFS2_DBG_READINODE2_MESSAGES
44#define JFFS2_DBG_MEMALLOC_MESSAGES
48#define JFFS2_DBG_SANITY_CHECKS
54#if CONFIG_JFFS2_FS_DEBUG > 0
61#if CONFIG_JFFS2_FS_DEBUG > 1
67#define jffs2_dbg(level, fmt, ...) \
69 if (CONFIG_JFFS2_FS_DEBUG >= level) \
70 pr_debug(fmt, ##__VA_ARGS__); \
74#define JFFS2_DBG KERN_DEBUG
75#define JFFS2_DBG_PREFIX "[JFFS2 DBG]"
76#define JFFS2_DBG_MSG_PREFIX JFFS2_DBG JFFS2_DBG_PREFIX
80#define JFFS2_ERROR(fmt, ...) \
81 pr_err("error: (%d) %s: " fmt, \
82 task_pid_nr(current), __func__, ##__VA_ARGS__)
84#define JFFS2_WARNING(fmt, ...) \
85 pr_warn("warning: (%d) %s: " fmt, \
86 task_pid_nr(current), __func__, ##__VA_ARGS__)
88#define JFFS2_NOTICE(fmt, ...) \
89 pr_notice("notice: (%d) %s: " fmt, \
90 task_pid_nr(current), __func__, ##__VA_ARGS__)
92#define JFFS2_DEBUG(fmt, ...) \
93 printk(KERN_DEBUG "[JFFS2 DBG] (%d) %s: " fmt, \
94 task_pid_nr(current), __func__, ##__VA_ARGS__)
96#define JFFS2_ERROR(fmt, ...) \
97 pr_err("error: %s: " fmt, \
98 __func__, ##__VA_ARGS__)
100#define JFFS2_WARNING(fmt, ...) \
101 pr_warn("warning: %s: " fmt, \
102 __func__, ##__VA_ARGS__)
104#define JFFS2_NOTICE(fmt, ...) \
105 pr_notice("notice: %s: " fmt, \
106 __func__, ##__VA_ARGS__)
108#define JFFS2_DEBUG(fmt, ...) \
109 printk(KERN_DEBUG "[JFFS2 DBG] %s: " fmt, \
110 __func__, ##__VA_ARGS__)
118#ifdef JFFS2_DBG_READINODE_MESSAGES
119#define dbg_readinode(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
121#define dbg_readinode(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
123#ifdef JFFS2_DBG_READINODE2_MESSAGES
124#define dbg_readinode2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
126#define dbg_readinode2(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
130#ifdef JFFS2_DBG_FRAGTREE_MESSAGES
131#define dbg_fragtree(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
133#define dbg_fragtree(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
135#ifdef JFFS2_DBG_FRAGTREE2_MESSAGES
136#define dbg_fragtree2(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
138#define dbg_fragtree2(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
142#ifdef JFFS2_DBG_DENTLIST_MESSAGES
143#define dbg_dentlist(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
145#define dbg_dentlist(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
149#ifdef JFFS2_DBG_NODEREF_MESSAGES
150#define dbg_noderef(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
152#define dbg_noderef(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
156#ifdef JFFS2_DBG_INOCACHE_MESSAGES
157#define dbg_inocache(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
159#define dbg_inocache(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
163#ifdef JFFS2_DBG_SUMMARY_MESSAGES
164#define dbg_summary(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
166#define dbg_summary(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
170#ifdef JFFS2_DBG_FSBUILD_MESSAGES
171#define dbg_fsbuild(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
173#define dbg_fsbuild(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
177#ifdef JFFS2_DBG_MEMALLOC_MESSAGES
178#define dbg_memalloc(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
180#define dbg_memalloc(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
184#ifdef JFFS2_DBG_XATTR_MESSAGES
185#define dbg_xattr(fmt, ...) JFFS2_DEBUG(fmt, ##__VA_ARGS__)
187#define dbg_xattr(fmt, ...) no_printk(fmt, ##__VA_ARGS__)
207__jffs2_dbg_acct_paranoia_check_nolock(
struct jffs2_sb_info *c,
211 uint32_t ofs,
int len);
233__jffs2_dbg_dump_buffer(
unsigned char *buf,
int len, uint32_t offs);
237#ifdef JFFS2_DBG_PARANOIA_CHECKS
238#define jffs2_dbg_fragtree_paranoia_check(f) \
239 __jffs2_dbg_fragtree_paranoia_check(f)
240#define jffs2_dbg_fragtree_paranoia_check_nolock(f) \
241 __jffs2_dbg_fragtree_paranoia_check_nolock(f)
242#define jffs2_dbg_acct_paranoia_check(c, jeb) \
243 __jffs2_dbg_acct_paranoia_check(c,jeb)
244#define jffs2_dbg_acct_paranoia_check_nolock(c, jeb) \
245 __jffs2_dbg_acct_paranoia_check_nolock(c,jeb)
246#define jffs2_dbg_prewrite_paranoia_check(c, ofs, len) \
247 __jffs2_dbg_prewrite_paranoia_check(c, ofs, len)
249#define jffs2_dbg_fragtree_paranoia_check(f)
250#define jffs2_dbg_fragtree_paranoia_check_nolock(f)
251#define jffs2_dbg_acct_paranoia_check(c, jeb)
252#define jffs2_dbg_acct_paranoia_check_nolock(c, jeb)
253#define jffs2_dbg_prewrite_paranoia_check(c, ofs, len)
256#ifdef JFFS2_DBG_DUMPS
257#define jffs2_dbg_dump_jeb(c, jeb) \
258 __jffs2_dbg_dump_jeb(c, jeb);
259#define jffs2_dbg_dump_jeb_nolock(jeb) \
260 __jffs2_dbg_dump_jeb_nolock(jeb);
261#define jffs2_dbg_dump_block_lists(c) \
262 __jffs2_dbg_dump_block_lists(c)
263#define jffs2_dbg_dump_block_lists_nolock(c) \
264 __jffs2_dbg_dump_block_lists_nolock(c)
265#define jffs2_dbg_dump_fragtree(f) \
266 __jffs2_dbg_dump_fragtree(f);
267#define jffs2_dbg_dump_fragtree_nolock(f) \
268 __jffs2_dbg_dump_fragtree_nolock(f);
269#define jffs2_dbg_dump_buffer(buf, len, offs) \
270 __jffs2_dbg_dump_buffer(*buf, len, offs);
271#define jffs2_dbg_dump_node(c, ofs) \
272 __jffs2_dbg_dump_node(c, ofs);
274#define jffs2_dbg_dump_jeb(c, jeb)
275#define jffs2_dbg_dump_jeb_nolock(jeb)
276#define jffs2_dbg_dump_block_lists(c)
277#define jffs2_dbg_dump_block_lists_nolock(c)
278#define jffs2_dbg_dump_fragtree(f)
279#define jffs2_dbg_dump_fragtree_nolock(f)
280#define jffs2_dbg_dump_buffer(buf, len, offs)
281#define jffs2_dbg_dump_node(c, ofs)
284#ifdef JFFS2_DBG_SANITY_CHECKS
285#define jffs2_dbg_acct_sanity_check(c, jeb) \
286 __jffs2_dbg_acct_sanity_check(c, jeb)
287#define jffs2_dbg_acct_sanity_check_nolock(c, jeb) \
288 __jffs2_dbg_acct_sanity_check_nolock(c, jeb)
290#define jffs2_dbg_acct_sanity_check(c, jeb)
291#define jffs2_dbg_acct_sanity_check_nolock(c, jeb)
Definition: nodelist.h:278
Definition: jffs2_fs_i.h:20
Definition: jffs2_fs_sb.h:51