Just use CONFIG_SLUB to detect SLUB use

Add ASSERTF to the NDEBUG build
Fix minor issue with various debug build flags



git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@126 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
behlendo 2008-06-04 21:09:25 +00:00
parent a02118a89d
commit 475cdc788e
4 changed files with 35 additions and 36 deletions

View File

@ -87,13 +87,14 @@ AC_DEFUN([SPL_AC_DEBUG], [
esac ] esac ]
) )
if test "$spl_ac_debug" = yes; then if test "$spl_ac_debug" = yes; then
AC_MSG_RESULT([yes])
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG" KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG"
else else
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG" AC_MSG_RESULT([no])
AC_DEFINE([NDEBUG], [1], AC_DEFINE([NDEBUG], [1],
[Define to 1 to disable debug tracing]) [Define to 1 to disable debug tracing])
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG"
fi fi
AC_MSG_RESULT([${spl_ac_debug=no}])
]) ])
AC_DEFUN([SPL_AC_DEBUG_KMEM], [ AC_DEFUN([SPL_AC_DEBUG_KMEM], [
@ -102,18 +103,20 @@ AC_DEFUN([SPL_AC_DEBUG_KMEM], [
AS_HELP_STRING([--enable-debug-kmem], AS_HELP_STRING([--enable-debug-kmem],
[Enable kmem debug support (default off)]), [Enable kmem debug support (default off)]),
[ case "$enableval" in [ case "$enableval" in
yes) spl_ac_debug=yes ;; yes) spl_ac_debug_kmem=yes ;;
no) spl_ac_debug=no ;; no) spl_ac_debug_kmem=no ;;
*) AC_MSG_RESULT([Error!]) *) AC_MSG_RESULT([Error!])
AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-kmem]) ;; AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-kmem]) ;;
esac ] esac ]
) )
if test "$spl_ac_debug" = yes; then if test "$spl_ac_debug_kmem" = yes; then
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM" AC_MSG_RESULT([yes])
AC_DEFINE([DEBUG_KMEM], [1], AC_DEFINE([DEBUG_KMEM], [1],
[Define to 1 to enable kmem debugging]) [Define to 1 to enable kmem debugging])
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM"
else
AC_MSG_RESULT([no])
fi fi
AC_MSG_RESULT([${spl_ac_debug=no}])
]) ])
AC_DEFUN([SPL_AC_DEBUG_MUTEX], [ AC_DEFUN([SPL_AC_DEBUG_MUTEX], [
@ -122,18 +125,20 @@ AC_DEFUN([SPL_AC_DEBUG_MUTEX], [
AS_HELP_STRING([--enable-debug-mutex], AS_HELP_STRING([--enable-debug-mutex],
[Enable mutex debug support (default off)]), [Enable mutex debug support (default off)]),
[ case "$enableval" in [ case "$enableval" in
yes) spl_ac_debug=yes ;; yes) spl_ac_debug_mutex=yes ;;
no) spl_ac_debug=no ;; no) spl_ac_debug_mutex=no ;;
*) AC_MSG_RESULT([Error!]) *) AC_MSG_RESULT([Error!])
AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-mutex]) ;; AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-mutex]) ;;
esac ] esac ]
) )
if test "$spl_ac_debug" = yes; then if test "$spl_ac_debug_mutex" = yes; then
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_MUTEX" AC_MSG_RESULT([yes])
AC_DEFINE([DEBUG_MUTEX], [1], AC_DEFINE([DEBUG_MUTEX], [1],
[Define to 1 to enable mutex debugging]) [Define to 1 to enable mutex debugging])
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_MUTEX"
else
AC_MSG_RESULT([no])
fi fi
AC_MSG_RESULT([${spl_ac_debug=no}])
]) ])
AC_DEFUN([SPL_AC_DEBUG_KSTAT], [ AC_DEFUN([SPL_AC_DEBUG_KSTAT], [
@ -142,18 +147,20 @@ AC_DEFUN([SPL_AC_DEBUG_KSTAT], [
AS_HELP_STRING([--enable-debug-kstat], AS_HELP_STRING([--enable-debug-kstat],
[Enable kstat debug support (default off)]), [Enable kstat debug support (default off)]),
[ case "$enableval" in [ case "$enableval" in
yes) spl_ac_debug=yes ;; yes) spl_ac_debug_kstat=yes ;;
no) spl_ac_debug=no ;; no) spl_ac_debug_kstat=no ;;
*) AC_MSG_RESULT([Error!]) *) AC_MSG_RESULT([Error!])
AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-kstat]) ;; AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-kstat]) ;;
esac ] esac ]
) )
if test "$spl_ac_debug" = yes; then if test "$spl_ac_debug_kstat" = yes; then
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KSTAT" AC_MSG_RESULT([yes])
AC_DEFINE([DEBUG_KSTAT], [1], AC_DEFINE([DEBUG_KSTAT], [1],
[Define to 1 to enable kstat debugging]) [Define to 1 to enable kstat debugging])
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KSTAT"
else
AC_MSG_RESULT([no])
fi fi
AC_MSG_RESULT([${spl_ac_debug=no}])
]) ])
AC_DEFUN([SPL_AC_DEBUG_CALLB], [ AC_DEFUN([SPL_AC_DEBUG_CALLB], [
@ -162,18 +169,20 @@ AC_DEFUN([SPL_AC_DEBUG_CALLB], [
AS_HELP_STRING([--enable-debug-callb], AS_HELP_STRING([--enable-debug-callb],
[Enable callb debug support (default off)]), [Enable callb debug support (default off)]),
[ case "$enableval" in [ case "$enableval" in
yes) spl_ac_debug=yes ;; yes) spl_ac_debug_callb=yes ;;
no) spl_ac_debug=no ;; no) spl_ac_debug_callb=no ;;
*) AC_MSG_RESULT([Error!]) *) AC_MSG_RESULT([Error!])
AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-callb]) ;; AC_MSG_ERROR([Bad value "$enableval" for --enable-debug-callb]) ;;
esac ] esac ]
) )
if test "$spl_ac_debug" = yes; then if test "$spl_ac_debug_callb" = yes; then
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_CALLB" AC_MSG_RESULT([yes])
AC_DEFINE([DEBUG_CALLB], [1], AC_DEFINE([DEBUG_CALLB], [1],
[Define to 1 to enable callb debugging]) [Define to 1 to enable callb debugging])
KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_CALLB"
else
AC_MSG_RESULT([no])
fi fi
AC_MSG_RESULT([${spl_ac_debug=no}])
]) ])
dnl # dnl #
@ -280,17 +289,6 @@ AC_DEFUN([SPL_CHECK_SYMBOL_EXPORT],
fi fi
]) ])
dnl #
dnl # 2.6.x API change
dnl # Slab can now be implemented in terms of the Slub which provides
dnl # slightly different semantics in terms of merged caches.
dnl #
AC_DEFUN([SPL_AC_SLUB], [
SPL_LINUX_CONFIG([SLUB],
[AC_DEFINE(HAVE_SLUB, 1, [slub support configured])],
[])
])
dnl # dnl #
dnl # 2.6.x API change dnl # 2.6.x API change
dnl # check if uintptr_t typedef is defined dnl # check if uintptr_t typedef is defined

View File

@ -43,7 +43,6 @@ SPL_AC_DEBUG_KMEM
SPL_AC_DEBUG_MUTEX SPL_AC_DEBUG_MUTEX
SPL_AC_DEBUG_KSTAT SPL_AC_DEBUG_KSTAT
SPL_AC_DEBUG_CALLB SPL_AC_DEBUG_CALLB
SPL_AC_SLUB
SPL_AC_TYPE_UINTPTR_T SPL_AC_TYPE_UINTPTR_T
SPL_AC_TYPE_KMEM_CACHE_T SPL_AC_TYPE_KMEM_CACHE_T
SPL_AC_KMEM_CACHE_DESTROY_INT SPL_AC_KMEM_CACHE_DESTROY_INT

View File

@ -192,6 +192,7 @@ struct page_collection {
#ifdef NDEBUG #ifdef NDEBUG
#define CDEBUG_STACK() (0) #define CDEBUG_STACK() (0)
#define __CDEBUG_LIMIT(x, y, z, a...) ((void)0)
#define CDEBUG(mask, format, a...) ((void)0) #define CDEBUG(mask, format, a...) ((void)0)
#define CWARN(fmt, a...) ((void)0) #define CWARN(fmt, a...) ((void)0)
#define CERROR(fmt, a...) ((void)0) #define CERROR(fmt, a...) ((void)0)
@ -206,6 +207,7 @@ struct page_collection {
#define __ASSERT(x) ((void)0) #define __ASSERT(x) ((void)0)
#define __ASSERT_TAGE_INVARIANT(x) ((void)0) #define __ASSERT_TAGE_INVARIANT(x) ((void)0)
#define ASSERT(x) ((void)0) #define ASSERT(x) ((void)0)
#define ASSERTF(x, y, z...) ((void)0)
#define VERIFY(x) ((void)(x)) #define VERIFY(x) ((void)(x))
#define VERIFY3_IMPL(x, y, z, t, f, c) if (x == z) ((void)0) #define VERIFY3_IMPL(x, y, z, t, f, c) if (x == z) ((void)0)

View File

@ -376,7 +376,7 @@ __kmem_cache_create(char *name, size_t size, size_t align,
* SLAB_TRACE * SLAB_TRACE
* SLAB_DESTROY_BY_RCU * SLAB_DESTROY_BY_RCU
*/ */
#ifdef HAVE_SLUB #ifdef CONFIG_SLUB
flags |= SLAB_STORE_USER; flags |= SLAB_STORE_USER;
#endif #endif