Whamcloud - gitweb
Implements following configure keys:
authoryury <yury>
Fri, 30 Mar 2007 13:03:50 +0000 (13:03 +0000)
committeryury <yury>
Fri, 30 Mar 2007 13:03:50 +0000 (13:03 +0000)
--disable-libcfs-cdebug - disable libcfs CDEBUG, CWARN - enabled by default
--enable-libcfs-trace - enable libcfs ENTRY/EXIT - disabled by default
--disable-libcfs-assert - disable libcfs LASSERT, LASSERTF - enabled by default

Cmd3 found that disabling all of this contributes to performance at the range of 10-15%. This is inspected many times. Lustre source code is checked by hands for possible side effects from disabling LASSERT, etc. If you have any problems with this - please let me know.

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

index cc951b1..795d1c9 100644 (file)
@@ -42,6 +42,50 @@ fi
 ])
 
 #
 ])
 
 #
+# LC_CONFIG_CDEBUG
+#
+# whether to enable various libcfs debugs (CDEBUG, ENTRY/EXIT, LASSERT, etc.)
+#
+AC_DEFUN([LC_CONFIG_CDEBUG],
+[
+AC_MSG_CHECKING([whether to disable CDEBUG, CWARN, etc.])
+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
+   AC_DEFINE(CDEBUG_ENABLED, 1, [enable 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_MSG_RESULT([$enable_libcfs_trace])
+if test x$enable_libcfs_trace != xno; then
+   AC_DEFINE(CDEBUG_ENTRY_EXIT, 1, [enable libcfs ENTRY/EXIT])
+else
+   AC_DEFINE(CDEBUG_ENTRY_EXIT, 0, [disable libcfs ENTRY/EXIT])
+fi
+
+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
+   AC_DEFINE(LIBCFS_DEBUG, 0, [disable libcfs LASSERT, LASSERTF])
+else
+   AC_DEFINE(LIBCFS_DEBUG, 1, [enable libcfs LASSERT, LASSERTF])
+fi
+])
+#
 # LN_CONFIG_AFFINITY
 #
 # check if cpu affinity is available/wanted
 # LN_CONFIG_AFFINITY
 #
 # check if cpu affinity is available/wanted
@@ -1050,6 +1094,7 @@ LB_LINUX_TRY_COMPILE([
 #
 AC_DEFUN([LN_PROG_LINUX],
 [
 #
 AC_DEFUN([LN_PROG_LINUX],
 [
+LC_CONFIG_CDEBUG
 LN_FUNC_CPU_ONLINE
 LN_TYPE_GFP_T
 LN_TYPE_CPUMASK_T
 LN_FUNC_CPU_ONLINE
 LN_TYPE_GFP_T
 LN_TYPE_CPUMASK_T
index 19ee200..7f4426a 100644 (file)
@@ -4,7 +4,9 @@
 #ifndef __LIBCFS_KP30_H__
 #define __LIBCFS_KP30_H__
 
 #ifndef __LIBCFS_KP30_H__
 #define __LIBCFS_KP30_H__
 
-#define LIBCFS_DEBUG
+/* Controlled via configure key */
+/* #define LIBCFS_DEBUG */
+
 #include <libcfs/libcfs.h>
 #include <lnet/types.h>
 
 #include <libcfs/libcfs.h>
 #include <lnet/types.h>
 
index a4127bf..3ca1773 100644 (file)
@@ -24,7 +24,8 @@
 #include <stdio.h>
 #endif
 
 #include <stdio.h>
 #endif
 
-#define LIBCFS_DEBUG
+/* Controlled via configure key */
+/* #define LIBCFS_DEBUG */
 
 #ifndef offsetof
 # define offsetof(typ,memb)     ((unsigned long)((char *)&(((typ *)0)->memb)))
 
 #ifndef offsetof
 # define offsetof(typ,memb)     ((unsigned long)((char *)&(((typ *)0)->memb)))
@@ -163,7 +164,8 @@ typedef struct {
         cfs_duration_t  cdls_delay;
 } cfs_debug_limit_state_t;
 
         cfs_duration_t  cdls_delay;
 } cfs_debug_limit_state_t;
 
-#define CDEBUG_ENABLED (1)
+/* Controlled via configure key */
+/* #define CDEBUG_ENABLED (1) */
 
 #ifdef __KERNEL__
 
 
 #ifdef __KERNEL__
 
@@ -245,7 +247,9 @@ do {                                                                    \
 #define GOTO(label, rc) do { ((void)(rc)); goto label; } while (0)
 #endif
 
 #define GOTO(label, rc) do { ((void)(rc)); goto label; } while (0)
 #endif
 
-#define CDEBUG_ENTRY_EXIT (1)
+/* Controlled via configure key */
+/* #define CDEBUG_ENTRY_EXIT (1) */
+
 #if CDEBUG_ENTRY_EXIT
 
 /*
 #if CDEBUG_ENTRY_EXIT
 
 /*