aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-10-23 04:49:28 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-12-03 06:14:33 -0500
commit552ff3179d1e93a3e982357544c059f3e9a5516e (patch)
treefb53c9ab1b19e1c98fc0a316859413723e34d186 /fs/ubifs/debug.h
parent17c2f9f85c896b48a5d74a9155d99ec5b241a0e6 (diff)
UBIFS: add debugfs support
We need to have a possibility to see various UBIFS variables and ask UBIFS to dump various information. Debugfs is what we need. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/debug.h')
-rw-r--r--fs/ubifs/debug.h27
1 files changed, 24 insertions, 3 deletions
diff --git a/fs/ubifs/debug.h b/fs/ubifs/debug.h
index d6ea1362d56a..a6b70f8aac9c 100644
--- a/fs/ubifs/debug.h
+++ b/fs/ubifs/debug.h
@@ -43,6 +43,13 @@
43 * @new_nhead_offs: used by LPT tree size checker 43 * @new_nhead_offs: used by LPT tree size checker
44 * @new_ihead_lnum: used by debugging to check ihead_lnum 44 * @new_ihead_lnum: used by debugging to check ihead_lnum
45 * @new_ihead_offs: used by debugging to check ihead_offs 45 * @new_ihead_offs: used by debugging to check ihead_offs
46 *
47 * debugfs_dir_name: name of debugfs directory containing this file-system's
48 * files
49 * debugfs_dir: direntry object of the file-system debugfs directory
50 * dump_lprops: "dump lprops" debugfs knob
51 * dump_budg: "dump budgeting information" debugfs knob
52 * dump_tnc: "dump TNC" debugfs knob
46 */ 53 */
47struct ubifs_debug_info { 54struct ubifs_debug_info {
48 void *buf; 55 void *buf;
@@ -61,6 +68,12 @@ struct ubifs_debug_info {
61 int new_nhead_offs; 68 int new_nhead_offs;
62 int new_ihead_lnum; 69 int new_ihead_lnum;
63 int new_ihead_offs; 70 int new_ihead_offs;
71
72 char debugfs_dir_name[100];
73 struct dentry *debugfs_dir;
74 struct dentry *dump_lprops;
75 struct dentry *dump_budg;
76 struct dentry *dump_tnc;
64}; 77};
65 78
66#define ubifs_assert(expr) do { \ 79#define ubifs_assert(expr) do { \
@@ -251,7 +264,6 @@ int ubifs_debugging_init(struct ubifs_info *c);
251void ubifs_debugging_exit(struct ubifs_info *c); 264void ubifs_debugging_exit(struct ubifs_info *c);
252 265
253/* Dump functions */ 266/* Dump functions */
254
255const char *dbg_ntype(int type); 267const char *dbg_ntype(int type);
256const char *dbg_cstate(int cmt_state); 268const char *dbg_cstate(int cmt_state);
257const char *dbg_get_key_dump(const struct ubifs_info *c, 269const char *dbg_get_key_dump(const struct ubifs_info *c,
@@ -274,7 +286,6 @@ void dbg_dump_tnc(struct ubifs_info *c);
274void dbg_dump_index(struct ubifs_info *c); 286void dbg_dump_index(struct ubifs_info *c);
275 287
276/* Checking helper functions */ 288/* Checking helper functions */
277
278typedef int (*dbg_leaf_callback)(struct ubifs_info *c, 289typedef int (*dbg_leaf_callback)(struct ubifs_info *c,
279 struct ubifs_zbranch *zbr, void *priv); 290 struct ubifs_zbranch *zbr, void *priv);
280typedef int (*dbg_znode_callback)(struct ubifs_info *c, 291typedef int (*dbg_znode_callback)(struct ubifs_info *c,
@@ -354,6 +365,12 @@ static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
354 return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN); 365 return dbg_leb_change(desc, lnum, buf, len, UBI_UNKNOWN);
355} 366}
356 367
368/* Debugfs-related stuff */
369int dbg_debugfs_init(void);
370void dbg_debugfs_exit(void);
371int dbg_debugfs_init_fs(struct ubifs_info *c);
372void dbg_debugfs_exit_fs(struct ubifs_info *c);
373
357#else /* !CONFIG_UBIFS_FS_DEBUG */ 374#else /* !CONFIG_UBIFS_FS_DEBUG */
358 375
359/* Use "if (0)" to make compiler check arguments even if debugging is off */ 376/* Use "if (0)" to make compiler check arguments even if debugging is off */
@@ -434,6 +451,10 @@ static inline int dbg_change(struct ubi_volume_desc *desc, int lnum,
434#define dbg_force_in_the_gaps() 0 451#define dbg_force_in_the_gaps() 0
435#define dbg_failure_mode 0 452#define dbg_failure_mode 0
436 453
437#endif /* !CONFIG_UBIFS_FS_DEBUG */ 454#define dbg_debugfs_init() 0
455#define dbg_debugfs_exit()
456#define dbg_debugfs_init_fs(c) 0
457#define dbg_debugfs_exit_fs(c) 0
438 458
459#endif /* !CONFIG_UBIFS_FS_DEBUG */
439#endif /* !__UBIFS_DEBUG_H__ */ 460#endif /* !__UBIFS_DEBUG_H__ */