Whamcloud - gitweb
- enable all traces and debugs by default to not hurt anyone who not aware of this...
authoryury <yury>
Fri, 30 Mar 2007 14:07:27 +0000 (14:07 +0000)
committeryury <yury>
Fri, 30 Mar 2007 14:07:27 +0000 (14:07 +0000)
- added compile warning for case CDEBUG is disabled;
- fixes in configure keys, using AC_ARG_ENABLE(feature) implies that bash variable names is $enable_feature.

lnet/autoconf/lustre-lnet.m4
lnet/include/libcfs/libcfs.h

index c569683..701d1c4 100644 (file)
@@ -48,25 +48,25 @@ fi
 #
 AC_DEFUN([LC_CONFIG_CDEBUG],
 [
-AC_MSG_CHECKING([whether to disable CDEBUG, CWARN, etc.])
+AC_MSG_CHECKING([whether to disable CDEBUG, CWARN])
 AC_ARG_ENABLE([libcfs_cdebug],
        AC_HELP_STRING([--disable-libcfs-cdebug],
                        [disable libcfs CDEBUG, CWARN]),
-       [],[disable_libcfs_cdebug='no'])
-AC_MSG_RESULT([$disable_libcfs_cdebug])
-if test x$disable_libcfs_cdebug != xno; then
-   AC_DEFINE(CDEBUG_ENABLED, 0, [disable libcfs CDEBUG, CWARN])
-else
+       [],[enable_libcfs_cdebug='yes'])
+AC_MSG_RESULT([$enable_libcfs_cdebug])
+if test x$enable_libcfs_cdebug = xyes; then
    AC_DEFINE(CDEBUG_ENABLED, 1, [enable libcfs CDEBUG, CWARN])
+else
+   AC_DEFINE(CDEBUG_ENABLED, 0, [disable libcfs CDEBUG, CWARN])
 fi
 
 AC_MSG_CHECKING([whether to enable ENTRY/EXIT])
 AC_ARG_ENABLE([libcfs_trace],
-       AC_HELP_STRING([--enable-libcfs-trace],
-                       [enable libcfs ENTRY/EXIT]),
-       [],[enable_libcfs_trace='no'])
+       AC_HELP_STRING([--disable-libcfs-trace],
+                       [disable libcfs ENTRY/EXIT]),
+       [],[enable_libcfs_trace='yes'])
 AC_MSG_RESULT([$enable_libcfs_trace])
-if test x$enable_libcfs_trace != xno; then
+if test x$enable_libcfs_trace = xyes; then
    AC_DEFINE(CDEBUG_ENTRY_EXIT, 1, [enable libcfs ENTRY/EXIT])
 else
    AC_DEFINE(CDEBUG_ENTRY_EXIT, 0, [disable libcfs ENTRY/EXIT])
@@ -76,9 +76,9 @@ AC_MSG_CHECKING([whether to disable LASSERT, LASSERTF])
 AC_ARG_ENABLE([libcfs_assert],
        AC_HELP_STRING([--disable-libcfs-assert],
                        [disable libcfs LASSERT, LASSERTF]),
-       [],[disable_libcfs_assert='no'])
-AC_MSG_RESULT([$disable_libcfs_assert])
-if test x$disable_libcfs_assert = xno; then
+       [],[enable_libcfs_assert='yes'])
+AC_MSG_RESULT([$enable_libcfs_assert])
+if test x$enable_libcfs_assert = xyes; then
    AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])
 fi
 ])
index 3ca1773..fb4959c 100644 (file)
@@ -194,6 +194,7 @@ do {                                            \
 #else /* CDEBUG_ENABLED */
 #define CDEBUG(mask, format, a...) (void)(0)
 #define CDEBUG_LIMIT(mask, format, a...) (void)(0)
+#warning "CDEBUG IS DISABLED. THIS SHOULD NEVER BE DONE FOR PRODUCTION!"
 #endif
 
 #elif defined(__arch_lib__) && !defined(LUSTRE_UTILS)