From a2a84db5891099b4fe388095397b6cecd4036bad Mon Sep 17 00:00:00 2001 From: yury Date: Fri, 30 Mar 2007 13:03:50 +0000 Subject: [PATCH] Implements following configure keys: --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 | 45 ++++++++++++++++++++++++++++++++++++++++++++ lnet/include/libcfs/kp30.h | 4 +++- lnet/include/libcfs/libcfs.h | 10 +++++++--- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index cc951b1..795d1c9 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -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 @@ -1050,6 +1094,7 @@ LB_LINUX_TRY_COMPILE([ # AC_DEFUN([LN_PROG_LINUX], [ +LC_CONFIG_CDEBUG LN_FUNC_CPU_ONLINE LN_TYPE_GFP_T LN_TYPE_CPUMASK_T diff --git a/lnet/include/libcfs/kp30.h b/lnet/include/libcfs/kp30.h index 19ee200..7f4426a 100644 --- a/lnet/include/libcfs/kp30.h +++ b/lnet/include/libcfs/kp30.h @@ -4,7 +4,9 @@ #ifndef __LIBCFS_KP30_H__ #define __LIBCFS_KP30_H__ -#define LIBCFS_DEBUG +/* Controlled via configure key */ +/* #define LIBCFS_DEBUG */ + #include #include diff --git a/lnet/include/libcfs/libcfs.h b/lnet/include/libcfs/libcfs.h index a4127bf..3ca1773 100644 --- a/lnet/include/libcfs/libcfs.h +++ b/lnet/include/libcfs/libcfs.h @@ -24,7 +24,8 @@ #include #endif -#define LIBCFS_DEBUG +/* Controlled via configure key */ +/* #define LIBCFS_DEBUG */ #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; -#define CDEBUG_ENABLED (1) +/* Controlled via configure key */ +/* #define CDEBUG_ENABLED (1) */ #ifdef __KERNEL__ @@ -245,7 +247,9 @@ do { \ #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 /* -- 1.8.3.1