@@ -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---
@@ -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);
@@ -97,7 +97,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)
@@ -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