Prefix all SPL debug macros with 'S'

To avoid conflicts with symbols defined by dependent packages
all debugging symbols have been prefixed with a 'S' for SPL.
Any dependent package needing to integrate with the SPL debug
should include the spl-debug.h header and use the 'S' prefixed
macros.  They must also build with DEBUG defined.
This commit is contained in:
Brian Behlendorf
2010-07-20 11:55:37 -07:00
parent 55abb0929e
commit b17edc10a9
14 changed files with 532 additions and 491 deletions
+5 -5
View File
@@ -28,11 +28,11 @@
#include <sys/cmn_err.h>
#include <spl-debug.h>
#ifdef DEBUG_SUBSYSTEM
#undef DEBUG_SUBSYSTEM
#ifdef SS_DEBUG_SUBSYS
#undef SS_DEBUG_SUBSYS
#endif
#define DEBUG_SUBSYSTEM S_GENERIC
#define SS_DEBUG_SUBSYS SS_GENERIC
#ifndef NDEBUG
static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" };
@@ -61,10 +61,10 @@ vcmn_err(int ce, const char *fmt, va_list ap)
vsnprintf(msg, MAXMSGLEN - 1, fmt, ap);
if (fmt[0] == '!')
CDEBUG(D_INFO, "%s%s%s",
SDEBUG(SD_INFO, "%s%s%s",
ce_prefix[ce], msg, ce_suffix[ce]);
else
CERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]);
SERROR("%s%s%s", ce_prefix[ce], msg, ce_suffix[ce]);
}
} /* vcmn_err() */
EXPORT_SYMBOL(vcmn_err);