]> xenbits.xensource.com Git - people/liuw/xen.git/commitdiff
xen: add new CONFIG_DEBUG_LOCKS option
authorJuergen Gross <jgross@suse.com>
Tue, 17 Sep 2019 14:08:03 +0000 (16:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 17 Sep 2019 14:08:03 +0000 (16:08 +0200)
Instead of enabling debugging for debug builds only add a dedicated
Kconfig option for that purpose which defaults to DEBUG.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/Kconfig.debug
xen/common/spinlock.c
xen/include/xen/spinlock.h

index e10e314e259efe4c802716206acb49e3f8072a04..1faaa3ba6a7f8a77f9caad08b02f0755f9e286eb 100644 (file)
@@ -51,6 +51,13 @@ config LOCK_PROFILE
          You can use serial console to print (and reset) using 'l' and 'L'
          respectively, or the 'xenlockprof' tool.
 
+config DEBUG_LOCKS
+       bool "Lock debugging"
+       default DEBUG
+       ---help---
+         Enable debugging features of lock handling.  Some additional
+         checks will be performed when acquiring and releasing locks.
+
 config PERF_COUNTERS
        bool "Performance Counters"
        ---help---
index 8b27b11b55990197e9b7e3471ecd13f97f8e286b..6ca1b38f844b3db523bfbaf9c02e6bb72a8bae61 100644 (file)
@@ -9,7 +9,7 @@
 #include <asm/processor.h>
 #include <asm/atomic.h>
 
-#ifndef NDEBUG
+#ifdef CONFIG_DEBUG_LOCKS
 
 static atomic_t spin_debug __read_mostly = ATOMIC_INIT(0);
 
@@ -99,7 +99,7 @@ void spin_debug_disable(void)
     atomic_dec(&spin_debug);
 }
 
-#else /* defined(NDEBUG) */
+#else /* CONFIG_DEBUG_LOCKS */
 
 #define check_lock(l) ((void)0)
 #define check_barrier(l) ((void)0)
index df37550f0244d60ffcac0927dddadebbac264e8d..79b582e05d08e8d21e7ebc830d117c3d5958ea28 100644 (file)
@@ -7,7 +7,7 @@
 
 #define SPINLOCK_CPU_BITS  12
 
-#ifndef NDEBUG
+#ifdef CONFIG_DEBUG_LOCKS
 union lock_debug {
     uint16_t val;
 #define LOCK_DEBUG_INITVAL 0xffff