brick_say: make debug messages runtime-selectable

This commit is contained in:
Thomas Schoebel-Theuer 2013-01-20 23:09:09 +01:00
parent a7e309cf4b
commit 2271f55e8c
7 changed files with 29 additions and 5 deletions

View File

@ -16,6 +16,13 @@ config MARS_DEBUG
---help---
OFF for production systems. ON for testing!
config MARS_DEBUG_DEFAULT
bool "turn on debug messages by default (may flood the logfiles)"
depends on MARS_DEBUG
default n
---help---
normally OFF
config MARS_BIGMODULE
tristate "compile all MARS modules into a single kernel module"
depends on MARS

View File

@ -43,6 +43,13 @@ char *say_class[MAX_SAY_CLASS] = {
[SAY_TOTAL] = "total",
};
int brick_say_debug =
#ifdef CONFIG_MARS_DEBUG_DEFAULT
1;
#else
0;
#endif
EXPORT_SYMBOL_GPL(brick_say_debug);
int brick_say_syslog_min = 1;
EXPORT_SYMBOL_GPL(brick_say_syslog_min);
int brick_say_syslog_max = -1;
@ -415,6 +422,9 @@ void say_to(struct say_channel *ch, int class, const char *fmt, ...)
va_list args;
unsigned long flags;
if (!class && !brick_say_debug)
return;
if (!ch) {
ch = find_channel(current);
}
@ -457,6 +467,9 @@ void brick_say_to(struct say_channel *ch, int class, bool dump, const char *pref
va_list args;
unsigned long flags;
if (!class && !brick_say_debug)
return;
if (!ch) {
ch = find_channel(current);
}

View File

@ -4,6 +4,7 @@
/////////////////////////////////////////////////////////////////////////
extern int brick_say_debug;
extern int brick_say_syslog_min;
extern int brick_say_syslog_max;
extern int delay_say_on_overflow;

View File

@ -3,10 +3,10 @@
// Trans_Logger brick
//#define BRICK_DEBUGGING
//#define MARS_DEBUGGING
#define MARS_DEBUGGING
//#define IO_DEBUGGING
//#define REPLAY_DEBUGGING
//#define STAT_DEBUGGING // here means: display full statistics
#define STAT_DEBUGGING // here means: display full statistics
//#define HASH_DEBUGGING
#include <linux/kernel.h>

View File

@ -1,9 +1,9 @@
// (c) 2011 Thomas Schoebel-Theuer / 1&1 Internet AG
//#define BRICK_DEBUGGING
//#define MARS_DEBUGGING
#define MARS_DEBUGGING
//#define IO_DEBUGGING
//#define STAT_DEBUGGING // here means: display full statistics
#define STAT_DEBUGGING // here means: display full statistics
// disable this only for debugging!
#define RUN_PEERS

View File

@ -199,6 +199,9 @@ ctl_table mars_table[] = {
.mode = 0400,
.proc_handler = &lamport_sysctl_handler,
},
#ifdef CONFIG_MARS_DEBUG
INT_ENTRY("write_debug_messages", brick_say_debug, 0600),
#endif
INT_ENTRY("logger_completion_semantics", trans_logger_completion_semantics, 0600),
INT_ENTRY("logger_do_crc", trans_logger_do_crc, 0600),
INT_ENTRY("syslog_min_class", brick_say_syslog_min, 0600),

View File

@ -1,7 +1,7 @@
// (c) 2010 Thomas Schoebel-Theuer / 1&1 Internet AG
//#define BRICK_DEBUGGING
//#define MARS_DEBUGGING
#define MARS_DEBUGGING
//#define IO_DEBUGGING
#include <linux/kernel.h>