mtd/fs/jffs3 debug.h,1.6,1.7 malloc.c,3.3,3.4

Artem Bityuckiy dedekind at infradead.org
Fri Dec 17 13:05:00 EST 2004


Update of /home/cvs/mtd/fs/jffs3
In directory phoenix.infradead.org:/tmp/cvs-serv16455

Modified Files:
	debug.h malloc.c 
Log Message:
Add structures allocation output macros.


Index: debug.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/debug.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- debug.h	17 Dec 2004 15:04:39 -0000	1.6
+++ debug.h	17 Dec 2004 18:04:57 -0000	1.7
@@ -24,26 +24,29 @@
 #define JFFS3_DBG_SANITY_CHECKS	1
 
 /* JFFS3 subsystems */
-#define JFFS3_DBG_OTHER	1	/* Not classified */
-#define JFFS3_DBG_SCAN	2	/* Flash scan */
-#define JFFS3_DBG_GC	3	/* Garbage Collector */
-#define JFFS3_DBG_WBUF	4	/* Write buffer */
-#define JFFS3_DBG_ERASE	5	/* Block erase */
+#define JFFS3_DBG_OTHER		1	/* Not classified */
+#define JFFS3_DBG_SCAN		2	/* Flash scan */
+#define JFFS3_DBG_GC		3	/* Garbage Collector */
+#define JFFS3_DBG_WBUF		4	/* Write buffer */
+#define JFFS3_DBG_ERASE		5	/* Block erase */
+#define JFFS3_DBG_SALLOC	6	/* Main data structures allocation */
 
 #if CONFIG_JFFS3_FS_DEBUG > 0
 #define JFFS3_DBG_PARANOIA_CHECKS	1
-/* By default print the debugging messages from any JFFS3 subsystem */
+/* By default print the debugging messages from almosr all JFFS3 subsystems */
 #define JFFS3_DBG_SUBSYS_OTHER_PRINT	1
 #define JFFS3_DBG_SUBSYS_SCAN_PRINT	1
 #define JFFS3_DBG_SUBSYS_GC_PRINT	1
 #define JFFS3_DBG_SUBSYS_WBUF_PRINT	1
 #define JFFS3_DBG_SUBSYS_ERASE_PRINT	1
+#define JFFS3_DBG_SUBSYS_SALLOC_PRINT	0
 #else
 #define JFFS3_DBG_SUBSYS_OTHER_PRINT	0
 #define JFFS3_DBG_SUBSYS_SCAN_PRINT	0
 #define JFFS3_DBG_SUBSYS_GC_PRINT	0
 #define JFFS3_DBG_SUBSYS_WBUF_PRINT	0
 #define JFFS3_DBG_SUBSYS_ERASE_PRINT	0
+#define JFFS3_DBG_SUBSYS_SALLOC_PRINT	0
 #endif
 
 /*
@@ -56,6 +59,10 @@
 	char *subsysname = NULL;						\
 	if ((debug_level) >= CONFIG_JFFS3_FS_DEBUG) {				\
 		switch (subsystem) {						\
+			case JFFS3_DBG_SALLOC:					\
+				if (JFFS3_DBG_SUBSYS_SALLOC_PRINT)		\
+					subsysname = "salloc";			\
+				break;						\
 			case JFFS3_DBG_ERASE:					\
 				if (JFFS3_DBG_SUBSYS_ERASE_PRINT)		\
 					subsysname = "erase";			\
@@ -104,6 +111,9 @@
 #define DBG_ERASE(debug_level, args...)						\
 	JFFS3DBG_SUBSYSTEM(JFFS3_DBG_ERASE, debug_level, args)
 
+#define DBG_SALLOC(debug_level, args...)					\
+	JFFS3DBG_SUBSYSTEM(JFFS3_DBG_ERASE, debug_level, args)
+
 #define ERROR_MSG(args...)							\
 	do {									\
 		printk(KERN_ERR "[JFFS3] Error in %s(): ", __FUNCTION__);	\

Index: malloc.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs3/malloc.c,v
retrieving revision 3.3
retrieving revision 3.4
diff -u -r3.3 -r3.4
--- malloc.c	13 Dec 2004 11:35:41 -0000	3.3
+++ malloc.c	17 Dec 2004 18:04:57 -0000	3.4
@@ -18,14 +18,7 @@
 #include "jffs3.h"
 #include "nodelist.h"
 
-#if 0
-#define JFFS3_SLAB_POISON SLAB_POISON
-#else
 #define JFFS3_SLAB_POISON 0
-#endif
-
-// replace this by #define D3 (x) x for cache debugging
-#define D3(x)
 
 /* These are initialised to NULL in the kernel startup code.
    If you're porting to other operating systems, beware */
@@ -116,91 +109,91 @@
 struct jffs3_full_dnode *jffs3_alloc_full_dnode(void)
 {
 	struct jffs3_full_dnode *ret = kmem_cache_alloc(full_dnode_slab, GFP_KERNEL);
-	D3 (printk (KERN_DEBUG "alloc_full_dnode at %p\n", ret));
+	DBG_SALLOC(1, "alloc_full_dnode at %p\n", ret);
 	return ret;
 }
 
 void jffs3_free_full_dnode(struct jffs3_full_dnode *x)
 {
-	D3 (printk (KERN_DEBUG "free full_dnode at %p\n", x));
+	DBG_SALLOC(1, "free full_dnode at %p\n", x);
 	kmem_cache_free(full_dnode_slab, x);
 }
 
 struct jffs3_raw_dirent *jffs3_alloc_raw_dirent(void)
 {
 	struct jffs3_raw_dirent *ret = kmem_cache_alloc(raw_dirent_slab, GFP_KERNEL);
-	D3 (printk (KERN_DEBUG "alloc_raw_dirent\n", ret));
+	DBG_SALLOC(1, "alloc_raw_dirent %p\n", ret);
 	return ret;
 }
 
 void jffs3_free_raw_dirent(struct jffs3_raw_dirent *x)
 {
-	D3 (printk (KERN_DEBUG "free_raw_dirent at %p\n", x));
+	DBG_SALLOC(1, "free_raw_dirent at %p\n", x);
 	kmem_cache_free(raw_dirent_slab, x);
 }
 
 struct jffs3_raw_inode *jffs3_alloc_raw_inode(void)
 {
 	struct jffs3_raw_inode *ret = kmem_cache_alloc(raw_inode_slab, GFP_KERNEL);
-	D3 (printk (KERN_DEBUG "alloc_raw_inode at %p\n", ret));
+	DBG_SALLOC(1, "alloc_raw_inode at %p\n", ret);
 	return ret;
 }
 
 void jffs3_free_raw_inode(struct jffs3_raw_inode *x)
 {
-	D3 (printk (KERN_DEBUG "free_raw_inode at %p\n", x));
+	DBG_SALLOC(1, "free_raw_inode at %p\n", x);
 	kmem_cache_free(raw_inode_slab, x);
 }
 
 struct jffs3_tmp_dnode_info *jffs3_alloc_tmp_dnode_info(void)
 {
 	struct jffs3_tmp_dnode_info *ret = kmem_cache_alloc(tmp_dnode_info_slab, GFP_KERNEL);
-	D3 (printk (KERN_DEBUG "alloc_tmp_dnode_info at %p\n", ret));
+	DBG_SALLOC(1, "alloc_tmp_dnode_info at %p\n", ret);
 	return ret;
 }
 
 void jffs3_free_tmp_dnode_info(struct jffs3_tmp_dnode_info *x)
 {
-	D3 (printk (KERN_DEBUG "free_tmp_dnode_info at %p\n", x));
+	DBG_SALLOC(1, "free_tmp_dnode_info at %p\n", x);
 	kmem_cache_free(tmp_dnode_info_slab, x);
 }
 
 struct jffs3_raw_node_ref *jffs3_alloc_raw_node_ref(void)
 {
 	struct jffs3_raw_node_ref *ret = kmem_cache_alloc(raw_node_ref_slab, GFP_KERNEL);
-	D3 (printk (KERN_DEBUG "alloc_raw_node_ref at %p\n", ret));
+	DBG_SALLOC(1, "alloc_raw_node_ref at %p\n", ret);
 	return ret;
 }
 
 void jffs3_free_raw_node_ref(struct jffs3_raw_node_ref *x)
 {
-	D3 (printk (KERN_DEBUG "free_raw_node_ref at %p\n", x));
+	DBG_SALLOC(1, "free_raw_node_ref at %p\n", x);
 	kmem_cache_free(raw_node_ref_slab, x);
 }
 
 struct jffs3_node_frag *jffs3_alloc_node_frag(void)
 {
 	struct jffs3_node_frag *ret = kmem_cache_alloc(node_frag_slab, GFP_KERNEL);
-	D3 (printk (KERN_DEBUG "alloc_node_frag at %p\n", ret));
+	DBG_SALLOC(1, "alloc_node_frag at %p\n", ret);
 	return ret;
 }
 
 void jffs3_free_node_frag(struct jffs3_node_frag *x)
 {
-	D3 (printk (KERN_DEBUG "free_node_frag at %p\n", x));
+	DBG_SALLOC(1, "free_node_frag at %p\n", x);
 	kmem_cache_free(node_frag_slab, x);
 }
 
 struct jffs3_inode_cache *jffs3_alloc_inode_cache(void)
 {
 	struct jffs3_inode_cache *ret = kmem_cache_alloc(inode_cache_slab, GFP_KERNEL);
-	D3 (printk(KERN_DEBUG "Allocated inocache at %p\n", ret));
+	DBG_SALLOC(1, "Allocated inocache at %p\n", ret);
 	return ret;
 }
 
 void jffs3_free_inode_cache(struct jffs3_inode_cache *x)
 {
-	D3 (printk(KERN_DEBUG "Freeing inocache at %p\n", x));
+	DBG_SALLOC(1, "Freeing inocache at %p\n", x);
 	kmem_cache_free(inode_cache_slab, x);
 }
 





More information about the linux-mtd-cvs mailing list