Add --enable-debug-log configure option

Until now the notion of an internal debug logging infrastructure
was conflated with enabling ASSERT()s.  This patch clarifies things
by cleanly breaking the two subsystem apart.  The result of this
is the following behavior.

--enable-debug      - Enable/disable code wrapped in ASSERT()s.
--disable-debug       ASSERT()s are used to check invariants and
                      are never required for correct operation.
                      They are disabled by default because they
                      may impact performance.

--enable-debug-log  - Enable/disable the debug log infrastructure.
--disable-debug-log   This infrastructure allows the spl code and
                      its consumer to log messages to an in-kernel
                      log.  The granularity of the logging can be
                      controlled by a debug mask.  By default the
                      mask disables most debug messages resulting
                      in a negligible performance impact.  Because
                      of this the debug log is enabled by default.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf
2012-01-20 16:39:12 -08:00
parent 3c6ed5410b
commit 4b2220f0b9
10 changed files with 152 additions and 40 deletions
+2 -5
View File
@@ -44,6 +44,8 @@
#ifndef _SPL_DEBUG_H
#define _SPL_DEBUG_H
#include <spl-debug.h>
#ifdef NDEBUG /* Debugging Disabled */
/* Define SPL_DEBUG_STR to make clear which ASSERT definitions are used */
@@ -137,9 +139,4 @@ do { \
#define VERIFY(x) ASSERT(x)
#endif /* NDEBUG */
extern void spl_debug_bug(char *file, const char *fn, const int line, int fl);
extern int spl_debug_msg(void *arg, int subsys, int mask, const char *file,
const char *fn, const int line, const char *format, ...);
#endif /* SPL_DEBUG_H */