From: Arlin Davis Date: Thu, 20 Jun 2013 18:10:54 +0000 (-0700) Subject: add DAPL_DBG_LEVEL for more debug log control X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ffc6e31e48fa7323f33b154da695a101efed9e08;p=~ardavis%2Fdapl.git add DAPL_DBG_LEVEL for more debug log control Signed-off-by: Arlin Davis --- diff --git a/dapl/common/dapl_debug.c b/dapl/common/dapl_debug.c index 7966ddf..c8393c3 100644 --- a/dapl/common/dapl_debug.c +++ b/dapl/common/dapl_debug.c @@ -31,6 +31,7 @@ #include #endif /* __KDAPL__ */ +DAPL_DBG_TYPE g_dapl_dbg_level; /* debug type override */ DAPL_DBG_TYPE g_dapl_dbg_type; /* initialized in dapl_init.c */ DAPL_DBG_DEST g_dapl_dbg_dest; /* initialized in dapl_init.c */ int g_dapl_dbg_mem; /* initialized in dapl_init.c */ @@ -51,7 +52,7 @@ void dapl_internal_dbg_log(DAPL_DBG_TYPE type, const char *fmt, ...) last_t = start_t; } - if (type & g_dapl_dbg_type) { + if ((type & g_dapl_dbg_type) || (type & g_dapl_dbg_level)) { if (DAPL_DBG_DEST_STDOUT & g_dapl_dbg_dest) { dapl_os_get_time(¤t_t); delta_t = current_t - last_t; diff --git a/dapl/include/dapl_debug.h b/dapl/include/dapl_debug.h index 0c4de0e..f1d80a5 100644 --- a/dapl/include/dapl_debug.h +++ b/dapl/include/dapl_debug.h @@ -88,16 +88,17 @@ typedef enum DAPL_DBG_DEST_SYSLOG = 0x0002, } DAPL_DBG_DEST; +extern DAPL_DBG_TYPE g_dapl_dbg_level; extern DAPL_DBG_TYPE g_dapl_dbg_type; extern DAPL_DBG_DEST g_dapl_dbg_dest; extern int g_dapl_dbg_mem; extern void dapl_internal_dbg_log(DAPL_DBG_TYPE type, const char *fmt, ...); -#define dapl_log g_dapl_dbg_type==0 ? (void) 1 : dapl_internal_dbg_log +#define dapl_log g_dapl_dbg_level==0 ? (void) 1 : dapl_internal_dbg_log #if defined(DAPL_DBG) -#define dapl_dbg_log g_dapl_dbg_type==0 ? (void) 1 : dapl_internal_dbg_log +#define dapl_dbg_log g_dapl_dbg_level==0 ? (void) 1 : dapl_internal_dbg_log #else #define dapl_dbg_log(...) #endif