Skip to content

Commit

Permalink
Display DEBUG keyword during module load when --enable-debug is used.
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo M. Correia <ricardo.correia@oracle.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
  • Loading branch information
Ricardo M. Correia authored and behlendorf committed Jul 20, 2010
1 parent 2c762de commit 81672c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions include/sys/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@

#ifdef NDEBUG /* Debugging Disabled */

/* Define SPL_DEBUG_STR to make clear which ASSERT definitions are used */
#define SPL_DEBUG_STR ""

#define PANIC(fmt, a...) \
do { \
printk(KERN_EMERG fmt, ## a); \
Expand Down Expand Up @@ -81,6 +84,9 @@ do { \

#else /* Debugging Enabled */

/* Define SPL_DEBUG_STR to make clear which ASSERT definitions are used */
#define SPL_DEBUG_STR " (DEBUG mode)"

#define PANIC(fmt, a...) \
do { \
spl_debug_msg(NULL, 0, 0, \
Expand Down
10 changes: 6 additions & 4 deletions module/spl/spl-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ __init spl_init(void)
if ((rc = spl_kmem_init_kallsyms_lookup()))
SGOTO(out8, rc);

printk("SPL: Loaded Solaris Porting Layer v%s\n", SPL_META_VERSION);
printk(KERN_NOTICE "SPL: Loaded Solaris Porting Layer v%s%s\n",
SPL_META_VERSION, SPL_DEBUG_STR);
SRETURN(rc);
out8:
kstat_fini();
Expand All @@ -497,8 +498,8 @@ __init spl_init(void)
out1:
debug_fini();

printk("SPL: Failed to Load Solaris Porting Layer v%s, "
"rc = %d\n", SPL_META_VERSION, rc);
printk(KERN_NOTICE "SPL: Failed to Load Solaris Porting Layer v%s%s"
", rc = %d\n", SPL_META_VERSION, SPL_DEBUG_STR, rc);
return rc;
}

Expand All @@ -507,7 +508,8 @@ spl_fini(void)
{
SENTRY;

printk("SPL: Unloaded Solaris Porting Layer v%s\n", SPL_META_VERSION);
printk(KERN_NOTICE "SPL: Unloaded Solaris Porting Layer v%s%s\n",
SPL_META_VERSION, SPL_DEBUG_STR);
kstat_fini();
proc_fini();
vn_fini();
Expand Down

0 comments on commit 81672c0

Please sign in to comment.