diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-10-23 04:49:28 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2008-12-03 06:14:33 -0500 |
commit | 552ff3179d1e93a3e982357544c059f3e9a5516e (patch) | |
tree | fb53c9ab1b19e1c98fc0a316859413723e34d186 /fs/ubifs/debug.h | |
parent | 17c2f9f85c896b48a5d74a9155d99ec5b241a0e6 (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.h | 27 |
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 | */ |
47 | struct ubifs_debug_info { | 54 | struct 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); | |||
251 | void ubifs_debugging_exit(struct ubifs_info *c); | 264 | void ubifs_debugging_exit(struct ubifs_info *c); |
252 | 265 | ||
253 | /* Dump functions */ | 266 | /* Dump functions */ |
254 | |||
255 | const char *dbg_ntype(int type); | 267 | const char *dbg_ntype(int type); |
256 | const char *dbg_cstate(int cmt_state); | 268 | const char *dbg_cstate(int cmt_state); |
257 | const char *dbg_get_key_dump(const struct ubifs_info *c, | 269 | const char *dbg_get_key_dump(const struct ubifs_info *c, |
@@ -274,7 +286,6 @@ void dbg_dump_tnc(struct ubifs_info *c); | |||
274 | void dbg_dump_index(struct ubifs_info *c); | 286 | void dbg_dump_index(struct ubifs_info *c); |
275 | 287 | ||
276 | /* Checking helper functions */ | 288 | /* Checking helper functions */ |
277 | |||
278 | typedef int (*dbg_leaf_callback)(struct ubifs_info *c, | 289 | typedef int (*dbg_leaf_callback)(struct ubifs_info *c, |
279 | struct ubifs_zbranch *zbr, void *priv); | 290 | struct ubifs_zbranch *zbr, void *priv); |
280 | typedef int (*dbg_znode_callback)(struct ubifs_info *c, | 291 | typedef 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 */ | ||
369 | int dbg_debugfs_init(void); | ||
370 | void dbg_debugfs_exit(void); | ||
371 | int dbg_debugfs_init_fs(struct ubifs_info *c); | ||
372 | void 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__ */ |