Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f70b7e52 authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

UBIFS: remove Kconfig debugging option



Have the debugging stuff always compiled-in instead. It simplifies maintanance
a lot.

Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent 1baafd28
Loading
Loading
Loading
Loading
+0 −17
Original line number Diff line number Diff line
@@ -35,20 +35,3 @@ config UBIFS_FS_ZLIB
	default y
	help
	  Zlib compresses better than LZO but it is slower. Say 'Y' if unsure.

# Debugging-related stuff
config UBIFS_FS_DEBUG
	bool "Enable debugging support"
	depends on UBIFS_FS
	select DEBUG_FS
	select KALLSYMS
	help
	  This option enables UBIFS debugging support. It makes sure various
	  assertions, self-checks, debugging messages and test modes are compiled
	  in (this all is compiled out otherwise). Assertions are light-weight
	  and this option also enables them. Self-checks, debugging messages and
	  test modes are switched off by default. Thus, it is safe and actually
	  recommended to have debugging support enabled, and it should not slow
	  down UBIFS. You can then further enable / disable individual  debugging
	  features using UBIFS module parameters and the corresponding sysfs
	  interfaces.
+1 −3
Original line number Diff line number Diff line
@@ -3,6 +3,4 @@ obj-$(CONFIG_UBIFS_FS) += ubifs.o
ubifs-y += shrinker.o journal.o file.o dir.o super.o sb.o io.o
ubifs-y += tnc.o master.o scan.o replay.o log.o commit.o gc.o orphan.o
ubifs-y += budget.o find.o tnc_commit.o compress.o lpt.o lprops.o
ubifs-y += recovery.o ioctl.o lpt_commit.o tnc_misc.o xattr.o

ubifs-$(CONFIG_UBIFS_FS_DEBUG) += debug.o
ubifs-y += recovery.o ioctl.o lpt_commit.o tnc_misc.o xattr.o debug.o
+3 −3
Original line number Diff line number Diff line
@@ -496,7 +496,9 @@ int ubifs_gc_should_commit(struct ubifs_info *c)
	return ret;
}

#ifdef CONFIG_UBIFS_FS_DEBUG
/*
 * Everything below is related to debugging.
 */

/**
 * struct idx_node - hold index nodes during index tree traversal.
@@ -734,5 +736,3 @@ int dbg_check_old_index(struct ubifs_info *c, struct ubifs_zbranch *zroot)
		err = -EINVAL;
	return err;
}

#endif /* CONFIG_UBIFS_FS_DEBUG */
+0 −4
Original line number Diff line number Diff line
@@ -34,8 +34,6 @@
#include <linux/random.h>
#include "ubifs.h"

#ifdef CONFIG_UBIFS_FS_DEBUG

static DEFINE_SPINLOCK(dbg_lock);

static const char *get_key_fmt(int fmt)
@@ -3189,5 +3187,3 @@ void ubifs_debugging_exit(struct ubifs_info *c)
{
	kfree(c->dbg);
}

#endif /* CONFIG_UBIFS_FS_DEBUG */
+0 −153
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@ typedef int (*dbg_leaf_callback)(struct ubifs_info *c,
typedef int (*dbg_znode_callback)(struct ubifs_info *c,
				  struct ubifs_znode *znode, void *priv);

#ifdef CONFIG_UBIFS_FS_DEBUG

/*
 * The UBIFS debugfs directory name pattern and maximum name length (3 for "ubi"
 * + 1 for "_" and plus 2x2 for 2 UBI numbers and 1 for the trailing zero byte.
@@ -317,155 +315,4 @@ void dbg_debugfs_exit(void);
int dbg_debugfs_init_fs(struct ubifs_info *c);
void dbg_debugfs_exit_fs(struct ubifs_info *c);

#else /* !CONFIG_UBIFS_FS_DEBUG */

/* Use "if (0)" to make compiler check arguments even if debugging is off */
#define ubifs_assert(expr)  do {                                               \
	if (0)                                                                 \
		printk(KERN_CRIT "UBIFS assert failed in %s at %u (pid %d)\n", \
		       __func__, __LINE__, current->pid);                      \
} while (0)

#define dbg_err(fmt, ...)   do {                   \
	if (0)                                     \
		ubifs_err(fmt, ##__VA_ARGS__);     \
} while (0)

#define ubifs_dbg_msg(fmt, ...) do {                        \
	if (0)                                              \
		printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \
} while (0)

#define ubifs_assert_cmt_locked(c)

#define dbg_msg(fmt, ...)       ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_gen(fmt, ...)       ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_jnl(fmt, ...)       ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_jnlk(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_tnc(fmt, ...)       ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_tnck(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_lp(fmt, ...)        ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_find(fmt, ...)      ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_mnt(fmt, ...)       ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_mntk(key, fmt, ...) ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_io(fmt, ...)        ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_cmt(fmt, ...)       ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_budg(fmt, ...)      ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_log(fmt, ...)       ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_gc(fmt, ...)        ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_scan(fmt, ...)      ubifs_dbg_msg(fmt, ##__VA_ARGS__)
#define dbg_rcvry(fmt, ...)     ubifs_dbg_msg(fmt, ##__VA_ARGS__)

static inline int ubifs_debugging_init(struct ubifs_info *c)      { return 0; }
static inline void ubifs_debugging_exit(struct ubifs_info *c)     { return; }
static inline const char *dbg_ntype(int type)                     { return ""; }
static inline const char *dbg_cstate(int cmt_state)               { return ""; }
static inline const char *dbg_jhead(int jhead)                    { return ""; }
static inline const char *
dbg_get_key_dump(const struct ubifs_info *c,
		 const union ubifs_key *key)                      { return ""; }
static inline const char *
dbg_snprintf_key(const struct ubifs_info *c,
		 const union ubifs_key *key, char *buffer,
		 int len)                                         { return ""; }
static inline void ubifs_dump_inode(struct ubifs_info *c,
				    const struct inode *inode)    { return; }
static inline void ubifs_dump_node(const struct ubifs_info *c,
				   const void *node)              { return; }
static inline void
ubifs_dump_budget_req(const struct ubifs_budget_req *req)         { return; }
static inline void
ubifs_dump_lstats(const struct ubifs_lp_stats *lst)               { return; }
static inline void
ubifs_dump_budg(struct ubifs_info *c,
	      const struct ubifs_budg_info *bi)                   { return; }
static inline void ubifs_dump_lprop(const struct ubifs_info *c,
				    const struct ubifs_lprops *lp){ return; }
static inline void ubifs_dump_lprops(struct ubifs_info *c)        { return; }
static inline void ubifs_dump_lpt_info(struct ubifs_info *c)      { return; }
static inline void ubifs_dump_leb(const struct ubifs_info *c,
				  int lnum)                       { return; }
static inline void
ubifs_dump_sleb(const struct ubifs_info *c,
		const struct ubifs_scan_leb *sleb, int offs)      { return; }
static inline void
ubifs_dump_znode(const struct ubifs_info *c,
		 const struct ubifs_znode *znode)                 { return; }
static inline void ubifs_dump_heap(struct ubifs_info *c,
				   struct ubifs_lpt_heap *heap,
				   int cat)                       { return; }
static inline void ubifs_dump_pnode(struct ubifs_info *c,
				    struct ubifs_pnode *pnode,
				    struct ubifs_nnode *parent,
				    int iip)                      { return; }
static inline void ubifs_dump_tnc(struct ubifs_info *c)           { return; }
static inline void ubifs_dump_index(struct ubifs_info *c)         { return; }
static inline void ubifs_dump_lpt_lebs(const struct ubifs_info *c){ return; }

static inline int dbg_walk_index(struct ubifs_info *c,
				 dbg_leaf_callback leaf_cb,
				 dbg_znode_callback znode_cb,
				 void *priv)                      { return 0; }
static inline void dbg_save_space_info(struct ubifs_info *c)      { return; }
static inline int dbg_check_space_info(struct ubifs_info *c)      { return 0; }
static inline int dbg_check_lprops(struct ubifs_info *c)          { return 0; }
static inline int
dbg_old_index_check_init(struct ubifs_info *c,
			 struct ubifs_zbranch *zroot)             { return 0; }
static inline int
dbg_check_old_index(struct ubifs_info *c,
		    struct ubifs_zbranch *zroot)                  { return 0; }
static inline int dbg_check_cats(struct ubifs_info *c)            { return 0; }
static inline int dbg_check_ltab(struct ubifs_info *c)            { return 0; }
static inline int dbg_chk_lpt_free_spc(struct ubifs_info *c)      { return 0; }
static inline int dbg_chk_lpt_sz(struct ubifs_info *c,
				 int action, int len)             { return 0; }
static inline int
dbg_check_synced_i_size(const struct ubifs_info *c,
			struct inode *inode)                      { return 0; }
static inline int dbg_check_dir(struct ubifs_info *c,
				const struct inode *dir)          { return 0; }
static inline int dbg_check_tnc(struct ubifs_info *c, int extra)  { return 0; }
static inline int dbg_check_idx_size(struct ubifs_info *c,
				     long long idx_size)          { return 0; }
static inline int dbg_check_filesystem(struct ubifs_info *c)      { return 0; }
static inline void dbg_check_heap(struct ubifs_info *c,
				  struct ubifs_lpt_heap *heap,
				  int cat, int add_pos)           { return; }
static inline int dbg_check_lpt_nodes(struct ubifs_info *c,
	struct ubifs_cnode *cnode, int row, int col)              { return 0; }
static inline int dbg_check_inode_size(struct ubifs_info *c,
				       const struct inode *inode,
				       loff_t size)               { return 0; }
static inline int
dbg_check_data_nodes_order(struct ubifs_info *c,
			   struct list_head *head)                { return 0; }
static inline int
dbg_check_nondata_nodes_order(struct ubifs_info *c,
			      struct list_head *head)             { return 0; }

static inline int dbg_leb_write(struct ubifs_info *c, int lnum,
				const void *buf, int offset,
				int len, int dtype)               { return 0; }
static inline int dbg_leb_change(struct ubifs_info *c, int lnum,
				 const void *buf, int len,
				 int dtype)                       { return 0; }
static inline int dbg_leb_unmap(struct ubifs_info *c, int lnum)   { return 0; }
static inline int dbg_leb_map(struct ubifs_info *c, int lnum,
			      int dtype)                          { return 0; }

static inline int dbg_is_chk_gen(const struct ubifs_info *c)      { return 0; }
static inline int dbg_is_chk_index(const struct ubifs_info *c)    { return 0; }
static inline int dbg_is_chk_orph(const struct ubifs_info *c)     { return 0; }
static inline int dbg_is_chk_lprops(const struct ubifs_info *c)   { return 0; }
static inline int dbg_is_chk_fs(const struct ubifs_info *c)       { return 0; }
static inline int dbg_is_tst_rcvry(const struct ubifs_info *c)    { return 0; }
static inline int dbg_is_power_cut(const struct ubifs_info *c)    { return 0; }

static inline int dbg_debugfs_init(void)                          { return 0; }
static inline void dbg_debugfs_exit(void)                         { return; }
static inline int dbg_debugfs_init_fs(struct ubifs_info *c)       { return 0; }
static inline int dbg_debugfs_exit_fs(struct ubifs_info *c)       { return 0; }

#endif /* !CONFIG_UBIFS_FS_DEBUG */
#endif /* !__UBIFS_DEBUG_H__ */
Loading