treat CONFIG_MARS_DEBUG independent from CONFIG_DEBUG_KERNEL

This commit is contained in:
Thomas Schoebel-Theuer 2012-02-08 12:44:42 +01:00 committed by Thomas Schoebel-Theuer
parent 73454bbbcf
commit a48c41684d
8 changed files with 23 additions and 16 deletions

View File

@ -8,6 +8,13 @@ config MARS
---help---
Experimental storage System. Only compile as a module!
config MARS_DEBUG
bool "enable runtime checks in MARS"
depends on MARS
default n
---help---
OFF for production systems. ON for testing!
config MARS_BIGMODULE
tristate "compile all MARS modules into a single kernel module"
depends on MARS

View File

@ -6,7 +6,7 @@
// checking
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
#define BRICK_CHECKING true
#else
#define BRICK_CHECKING false

View File

@ -17,7 +17,7 @@
//#define BUMP_LIMITS // try to avoid this
#define ALLOW_DYNAMIC_RAISE 512
#ifndef CONFIG_DEBUG_KERNEL
#ifndef CONFIG_MARS_DEBUG
#undef BRICK_DEBUG_MEM
#endif
@ -96,7 +96,7 @@ void __brick_mem_free(void *data, int len)
void *_brick_mem_alloc(int len, int line)
{
void *res;
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
might_sleep();
#endif
@ -172,7 +172,7 @@ char *_brick_string_alloc(int len, int line)
{
char *res;
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
might_sleep();
#endif
@ -187,7 +187,7 @@ char *_brick_string_alloc(int len, int line)
#ifdef CONFIG_MARS_MEM_RETRY
for (;;) {
#endif
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
res = kzalloc(len + 1024, GFP_BRICK);
#else
res = kzalloc(len, GFP_BRICK);
@ -448,7 +448,7 @@ void *_brick_block_alloc(loff_t pos, int len, int line)
return NULL;
}
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
might_sleep();
#endif

View File

@ -277,7 +277,7 @@ void brick_say(int class, bool dump, const char *prefix, const char *file, int l
va_end(args);
_say_mark(cpu);
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
if (dump)
brick_dump_stack();
#endif
@ -372,7 +372,7 @@ void exit_say(void)
}
EXPORT_SYMBOL_GPL(exit_say);
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
void brick_dump_stack(void)
{

View File

@ -22,16 +22,16 @@ extern void brick_say(int class, bool dump, const char *prefix, const char *file
extern void init_say(void);
extern void exit_say(void);
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
#define INLINE static inline
//#define INLINE __attribute__((__noinline__))
extern void brick_dump_stack(void);
#else // CONFIG_DEBUG_KERNEL
#else // CONFIG_MARS_DEBUG
#define INLINE static inline
#define brick_dump_stack() /*empty*/
#endif // CONFIG_DEBUG_KERNEL
#endif // CONFIG_MARS_DEBUG
#endif

View File

@ -145,7 +145,7 @@ void _if_unplug(struct if_input *input)
LIST_HEAD(tmp_list);
unsigned long flags;
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
might_sleep();
#endif

View File

@ -563,7 +563,7 @@ int _write_ref_get(struct trans_logger_output *output, struct trans_logger_mref_
return -ENOMEM;
}
atomic64_add(mref->ref_len, &brick->shadow_mem_used);
#ifdef CONFIG_DEBUG_KERNEL
#ifdef CONFIG_MARS_DEBUG
memset(data, 0x11, mref->ref_len);
#endif
mref_a->shadow_data = data;
@ -2116,7 +2116,7 @@ void trans_logger_log(struct trans_logger_brick *brick)
*/
old_wait_timeout = wait_timeout;
wait_timeout = HZ / 10; // 100ms before flushing
#ifdef CONFIG_DEBUG_KERNEL // debug override for catching long blocks
#ifdef CONFIG_MARS_DEBUG // debug override for catching long blocks
//wait_timeout = 16 * HZ;
#endif
/* Calling log_flush() too often may result in

View File

@ -40,7 +40,7 @@
#include "../mars_trans_logger.h"
#include "../mars_if.h"
#include "mars_proc.h"
#ifdef CONFIG_DEBUG_KERNEL // otherwise currently unused
#ifdef CONFIG_MARS_DEBUG // otherwise currently unused
#include "../mars_dummy.h"
#include "../mars_check.h"
#include "../mars_buf.h"
@ -3669,7 +3669,7 @@ static int __init init_light(void)
DO_INIT(brick_mem);
DO_INIT(brick);
DO_INIT(mars);
#ifdef CONFIG_DEBUG_KERNEL // otherwise currently unused
#ifdef CONFIG_MARS_DEBUG // otherwise currently unused
DO_INIT(mars_dummy);
DO_INIT(mars_check);
DO_INIT(mars_buf);