[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] xen: make CONFIG_DEBUG_LOCKS usable without CONFIG_DEBUG
In expert mode it is possible to enable CONFIG_DEBUG_LOCKS without having enabled CONFIG_DEBUG. The coding is depending on CONFIG_DEBUG as it is using ASSERT(), however. Fix that by introducing assert() doing the same as ASSERT(), but being available in non-debug builds, too, and use that in spinlock debug code. Signed-off-by: Juergen Gross <jgross@xxxxxxxx> --- xen/common/spinlock.c | 2 +- xen/include/xen/lib.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 286f916bca..8f54580d24 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -86,7 +86,7 @@ static void got_lock(union lock_debug *debug) static void rel_lock(union lock_debug *debug) { if ( atomic_read(&spin_debug) > 0 ) - ASSERT(debug->cpu == smp_processor_id()); + assert(debug->cpu == smp_processor_id()); debug->cpu = SPINLOCK_NO_CPU; } diff --git a/xen/include/xen/lib.h b/xen/include/xen/lib.h index 8fbe84032d..000ea677d0 100644 --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -32,9 +32,11 @@ #define gcov_string "" #endif -#ifndef NDEBUG -#define ASSERT(p) \ +#define assert(p) \ do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0) + +#ifndef NDEBUG +#define ASSERT(p) assert(p) #define ASSERT_UNREACHABLE() assert_failed("unreachable") #define debug_build() 1 #else -- 2.16.4 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |