debug.h (b29e2679d0da91c60d3ac190d9c3bd65ac2f68c5) debug.h (7c46d0ae29ba880963db283706950de7aa86c0a0)
1/*
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.

--- 135 unchanged lines hidden (view full) ---

144 unsigned int chk_fs:1;
145 unsigned int tst_rcvry:1;
146};
147
148#define ubifs_assert(expr) do { \
149 if (unlikely(!(expr))) { \
150 printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
151 __func__, __LINE__, current->pid); \
1/*
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.

--- 135 unchanged lines hidden (view full) ---

144 unsigned int chk_fs:1;
145 unsigned int tst_rcvry:1;
146};
147
148#define ubifs_assert(expr) do { \
149 if (unlikely(!(expr))) { \
150 printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
151 __func__, __LINE__, current->pid); \
152 dbg_dump_stack(); \
152 dump_stack(); \
153 } \
154} while (0)
155
156#define ubifs_assert_cmt_locked(c) do { \
157 if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
158 up_write(&(c)->commit_sem); \
159 printk(KERN_CRIT "commit lock is not locked!\n"); \
160 ubifs_assert(0); \
161 } \
162} while (0)
163
153 } \
154} while (0)
155
156#define ubifs_assert_cmt_locked(c) do { \
157 if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
158 up_write(&(c)->commit_sem); \
159 printk(KERN_CRIT "commit lock is not locked!\n"); \
160 ubifs_assert(0); \
161 } \
162} while (0)
163
164#define dbg_dump_stack() dump_stack()
165
166#define dbg_err(fmt, ...) do { \
167 ubifs_err(fmt, ##__VA_ARGS__); \
168} while (0)
169
170#define ubifs_dbg_msg(type, fmt, ...) \
171 pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
172
173#define DBG_KEY_BUF_LEN 32

--- 162 unchanged lines hidden (view full) ---

336#define DBGKEY(key) ((char *)(key))
337#define DBGKEY1(key) ((char *)(key))
338
339#define ubifs_dbg_msg(fmt, ...) do { \
340 if (0) \
341 printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
342} while (0)
343
164#define dbg_err(fmt, ...) do { \
165 ubifs_err(fmt, ##__VA_ARGS__); \
166} while (0)
167
168#define ubifs_dbg_msg(type, fmt, ...) \
169 pr_debug("UBIFS DBG " type ": " fmt "\n", ##__VA_ARGS__)
170
171#define DBG_KEY_BUF_LEN 32

--- 162 unchanged lines hidden (view full) ---

334#define DBGKEY(key) ((char *)(key))
335#define DBGKEY1(key) ((char *)(key))
336
337#define ubifs_dbg_msg(fmt, ...) do { \
338 if (0) \
339 printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
340} while (0)
341
344#define dbg_dump_stack()
345#define ubifs_assert_cmt_locked(c)
346
347#define dbg_msg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
348#define dbg_gen(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
349#define dbg_jnl(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
350#define dbg_jnlk(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
351#define dbg_tnc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
352#define dbg_tnck(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)

--- 128 unchanged lines hidden ---
342#define ubifs_assert_cmt_locked(c)
343
344#define dbg_msg(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
345#define dbg_gen(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
346#define dbg_jnl(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
347#define dbg_jnlk(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
348#define dbg_tnc(fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
349#define dbg_tnck(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)

--- 128 unchanged lines hidden ---