Go to the documentation of this file.
23 #ifndef __UBIFS_DEBUG_H__
24 #define __UBIFS_DEBUG_H__
36 #define UBIFS_DFS_DIR_NAME "ubi%d_%d"
37 #define UBIFS_DFS_DIR_LEN (3 + 1 + 2*2 + 1)
151 #define ubifs_assert(expr) do { \
152 if (unlikely(!(expr))) { \
153 pr_crit("UBIFS assert failed in %s at %u (pid %d)\n", \
154 __func__, __LINE__, current->pid); \
159 #define ubifs_assert_cmt_locked(c) do { \
160 if (unlikely(down_write_trylock(&(c)->commit_sem))) { \
161 up_write(&(c)->commit_sem); \
162 pr_crit("commit lock is not locked!\n"); \
167 #define ubifs_dbg_msg(type, fmt, ...) \
168 pr_debug("UBIFS DBG " type " (pid %d): " fmt "\n", current->pid, \
171 #define DBG_KEY_BUF_LEN 48
172 #define ubifs_dbg_msg_key(type, key, fmt, ...) do { \
173 char __tmp_key_buf[DBG_KEY_BUF_LEN]; \
174 pr_debug("UBIFS DBG " type " (pid %d): " fmt "%s\n", current->pid, \
176 dbg_snprintf_key(c, key, __tmp_key_buf, DBG_KEY_BUF_LEN)); \
180 #define dbg_gen(fmt, ...) ubifs_dbg_msg("gen", fmt, ##__VA_ARGS__)
182 #define dbg_jnl(fmt, ...) ubifs_dbg_msg("jnl", fmt, ##__VA_ARGS__)
183 #define dbg_jnlk(key, fmt, ...) \
184 ubifs_dbg_msg_key("jnl", key, fmt, ##__VA_ARGS__)
186 #define dbg_tnc(fmt, ...) ubifs_dbg_msg("tnc", fmt, ##__VA_ARGS__)
187 #define dbg_tnck(key, fmt, ...) \
188 ubifs_dbg_msg_key("tnc", key, fmt, ##__VA_ARGS__)
190 #define dbg_lp(fmt, ...) ubifs_dbg_msg("lp", fmt, ##__VA_ARGS__)
192 #define dbg_find(fmt, ...) ubifs_dbg_msg("find", fmt, ##__VA_ARGS__)
194 #define dbg_mnt(fmt, ...) ubifs_dbg_msg("mnt", fmt, ##__VA_ARGS__)
195 #define dbg_mntk(key, fmt, ...) \
196 ubifs_dbg_msg_key("mnt", key, fmt, ##__VA_ARGS__)
198 #define dbg_io(fmt, ...) ubifs_dbg_msg("io", fmt, ##__VA_ARGS__)
200 #define dbg_cmt(fmt, ...) ubifs_dbg_msg("cmt", fmt, ##__VA_ARGS__)
202 #define dbg_budg(fmt, ...) ubifs_dbg_msg("budg", fmt, ##__VA_ARGS__)
204 #define dbg_log(fmt, ...) ubifs_dbg_msg("log", fmt, ##__VA_ARGS__)
206 #define dbg_gc(fmt, ...) ubifs_dbg_msg("gc", fmt, ##__VA_ARGS__)
208 #define dbg_scan(fmt, ...) ubifs_dbg_msg("scan", fmt, ##__VA_ARGS__)
210 #define dbg_rcvry(fmt, ...) ubifs_dbg_msg("rcvry", fmt, ##__VA_ARGS__)
214 static inline int dbg_is_chk_gen(
const struct ubifs_info *c)
218 static inline int dbg_is_chk_index(
const struct ubifs_info *c)
222 static inline int dbg_is_chk_orph(
const struct ubifs_info *c)
226 static inline int dbg_is_chk_lprops(
const struct ubifs_info *c)
230 static inline int dbg_is_chk_fs(
const struct ubifs_info *c)
234 static inline int dbg_is_tst_rcvry(
const struct ubifs_info *c)
238 static inline int dbg_is_power_cut(
const struct ubifs_info *c)
240 return !!c->
dbg->pc_happened;