From 4a6c891705910e747bdfd0cf71dcad8bd4243870 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 11 Jan 2007 12:46:22 +0000 Subject: [PATCH] Minor tracing cleanups git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@76 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- mpt/Makefile | 2 +- mpt/mpt_scst.c | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/mpt/Makefile b/mpt/Makefile index c681128b7..e2eae0911 100644 --- a/mpt/Makefile +++ b/mpt/Makefile @@ -31,7 +31,7 @@ EXTRA_CFLAGS += -I$(SCST_INC_DIR) -I$(FUSION_INC_DIR) -Iinclude/scsi EXTRA_CFLAGS += -DEXTRACHECKS #EXTRA_CFLAGS += -DTRACING -#EXTRA_CFLAGS += -DDEBUG +EXTRA_CFLAGS += -DDEBUG #EXTRA_CFLAGS += -DDEBUG_WORK_IN_THREAD ifeq ($(KVER),) diff --git a/mpt/mpt_scst.c b/mpt/mpt_scst.c index 67f3cacec..019daf70a 100644 --- a/mpt/mpt_scst.c +++ b/mpt/mpt_scst.c @@ -49,6 +49,9 @@ static int trace_mpi = 0; #define TRACE_MPI 0x80000000 +#endif + +#ifdef DEBUG static char *mpt_state_string[] = { "0", "new", @@ -3257,7 +3260,7 @@ stm_target_mode_abort_all(MPT_STM_PRIV *priv) static int stm_target_mode_abort(MPT_STM_PRIV *priv) { -#ifdef TRACING +#ifdef DEBUG MPT_ADAPTER *ioc = priv->ioc; #endif int i; @@ -3645,7 +3648,7 @@ static int stm_scsi_configuration(MPT_STM_PRIV *priv, int sleep) { -#ifdef TRACING +#ifdef DEBUG MPT_ADAPTER *ioc = priv->ioc; #endif SCSIPortPage0_t *ScsiPort0; @@ -3718,7 +3721,7 @@ stm_scsi_configuration(MPT_STM_PRIV *priv, static void stm_set_scsi_port_page1(MPT_STM_PRIV *priv, int sleep) { -#ifdef TRACING +#ifdef DEBUG MPT_ADAPTER *ioc = priv->ioc; #endif SCSIPortPage1_t *ScsiPort1; @@ -5324,13 +5327,14 @@ static struct scst_proc_data mpt_log_proc_data = { static int mpt_proc_log_entry_build(struct scst_tgt_template *templ) { int res = 0; +#if defined(DEBUG) || defined(TRACING) struct proc_dir_entry *p, *root; TRACE_ENTRY(); - root = scst_proc_get_tgt_root(templ); + root = scst_proc_get_tgt_root(templ); if (root) { -#if defined(DEBUG) || defined(TRACING) + mpt_log_proc_data.data = (void *)templ->name; p = scst_create_proc_entry(root, MPT_PROC_LOG_ENTRY_NAME, &mpt_log_proc_data); @@ -5341,12 +5345,12 @@ static int mpt_proc_log_entry_build(struct scst_tgt_template *templ) res = -ENOMEM; goto out; } -#endif + } out: TRACE_EXIT_RES(res); - +#endif return res; }