summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2002-07-13 20:14:33 +0000
committeroster <oster@NetBSD.org>2002-07-13 20:14:33 +0000
commitbc8ead0c0a6ca4567ef3e3c079acf7e1e33e3b03 (patch)
treedd571f83d47abc8a0e563f82d20ab99a9befb023 /sys/dev
parent1beb201fc3f1c7f8d872656e301b49906fa8509c (diff)
Most folks won't need the DAG printing and verification routines.
Introduce a #define to toggle them on/off. Disable calls to rf_PrintDAGList(). Saves ~6K on GENERIC+DEBUG kernel on i386.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/raidframe/rf_archs.h6
-rw-r--r--sys/dev/raidframe/rf_dagutils.c8
-rw-r--r--sys/dev/raidframe/rf_engine.c6
-rw-r--r--sys/dev/raidframe/rf_parityscan.c9
-rw-r--r--sys/dev/raidframe/rf_raid1.c8
-rw-r--r--sys/dev/raidframe/rf_states.c6
6 files changed, 31 insertions, 12 deletions
diff --git a/sys/dev/raidframe/rf_archs.h b/sys/dev/raidframe/rf_archs.h
index 04f9ba0890b..f8023b8af60 100644
--- a/sys/dev/raidframe/rf_archs.h
+++ b/sys/dev/raidframe/rf_archs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_archs.h,v 1.12 2002/01/19 02:50:54 oster Exp $ */
+/* $NetBSD: rf_archs.h,v 1.13 2002/07/13 20:14:33 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -108,6 +108,10 @@
#define RF_RECON_STATS 1
#endif
+#ifndef RF_DEBUG_VALIDATE_DAG
+#define RF_DEBUG_VALIDATE_DAG 0
+#endif
+
#include "rf_options.h"
#endif /* !_RF__RF_ARCHS_H_ */
diff --git a/sys/dev/raidframe/rf_dagutils.c b/sys/dev/raidframe/rf_dagutils.c
index 55b479e1a62..5957831c00b 100644
--- a/sys/dev/raidframe/rf_dagutils.c
+++ b/sys/dev/raidframe/rf_dagutils.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_dagutils.c,v 1.12 2002/07/13 19:59:26 oster Exp $ */
+/* $NetBSD: rf_dagutils.c,v 1.13 2002/07/13 20:14:34 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -33,7 +33,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.12 2002/07/13 19:59:26 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagutils.c,v 1.13 2002/07/13 20:14:34 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -58,12 +58,14 @@ RF_RedFuncs_t rf_xorRecoveryFuncs = {
rf_RecoveryXorFunc, "Recovery Xr",
rf_RecoveryXorFunc, "Recovery Xr"};
+#if RF_DEBUG_VALIDATE_DAG
static void rf_RecurPrintDAG(RF_DagNode_t *, int, int);
static void rf_PrintDAG(RF_DagHeader_t *);
static int rf_ValidateBranch(RF_DagNode_t *, int *, int *,
RF_DagNode_t **, int);
static void rf_ValidateBranchVisitedBits(RF_DagNode_t *, int, int);
static void rf_ValidateVisitedBits(RF_DagHeader_t *);
+#endif /* RF_DEBUG_VALIDATE_DAG */
/******************************************************************************
*
@@ -275,6 +277,7 @@ rf_AllocBuffer(
(char *), allocList);
return ((void *) p);
}
+#if RF_DEBUG_VALIDATE_DAG
/******************************************************************************
*
* debug routines
@@ -734,6 +737,7 @@ validate_dag_bad:
return (retcode);
}
+#endif /* RF_DEBUG_VALIDATE_DAG */
/******************************************************************************
*
diff --git a/sys/dev/raidframe/rf_engine.c b/sys/dev/raidframe/rf_engine.c
index 489c554f275..74dce6a4e07 100644
--- a/sys/dev/raidframe/rf_engine.c
+++ b/sys/dev/raidframe/rf_engine.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_engine.c,v 1.13 2002/07/13 20:01:13 oster Exp $ */
+/* $NetBSD: rf_engine.c,v 1.14 2002/07/13 20:14:34 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -55,7 +55,7 @@
****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.13 2002/07/13 20:01:13 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.14 2002/07/13 20:14:34 oster Exp $");
#include "rf_threadstuff.h"
@@ -693,11 +693,13 @@ rf_DispatchDAG(
RF_ETIMER_START(dag->tracerec->timer);
}
#if DEBUG
+#if RF_DEBUG_VALIDATE_DAG
if (rf_engineDebug || rf_validateDAGDebug) {
if (rf_ValidateDAG(dag))
RF_PANIC();
}
#endif
+#endif
if (rf_engineDebug) {
printf("raid%d: Entering DispatchDAG\n", raidPtr->raidid);
}
diff --git a/sys/dev/raidframe/rf_parityscan.c b/sys/dev/raidframe/rf_parityscan.c
index f480eb5af31..a39e9ab50c2 100644
--- a/sys/dev/raidframe/rf_parityscan.c
+++ b/sys/dev/raidframe/rf_parityscan.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_parityscan.c,v 1.12 2001/11/13 07:11:16 lukem Exp $ */
+/* $NetBSD: rf_parityscan.c,v 1.13 2002/07/13 20:14:34 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -33,7 +33,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_parityscan.c,v 1.12 2001/11/13 07:11:16 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_parityscan.c,v 1.13 2002/07/13 20:14:34 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@@ -249,11 +249,12 @@ rf_VerifyParityBasic(raidPtr, raidAddr, parityPDA, correct_it, flags)
/* fire off the DAG */
memset((char *) &tracerec, 0, sizeof(tracerec));
rd_dag_h->tracerec = &tracerec;
-
+#if 0
if (rf_verifyParityDebug) {
printf("Parity verify read dag:\n");
rf_PrintDAGList(rd_dag_h);
}
+#endif
RF_LOCK_MUTEX(mcpair->mutex);
mcpair->flag = 0;
rf_DispatchDAG(rd_dag_h, (void (*) (void *)) rf_MCPairWakeupFunc,
@@ -294,10 +295,12 @@ rf_VerifyParityBasic(raidPtr, raidAddr, parityPDA, correct_it, flags)
wrBlock->succedents[0]->params[3].v = RF_CREATE_PARAM3(RF_IO_NORMAL_PRIORITY, 0, 0, which_ru);
memset((char *) &tracerec, 0, sizeof(tracerec));
wr_dag_h->tracerec = &tracerec;
+#if 0
if (rf_verifyParityDebug) {
printf("Parity verify write dag:\n");
rf_PrintDAGList(wr_dag_h);
}
+#endif
RF_LOCK_MUTEX(mcpair->mutex);
mcpair->flag = 0;
rf_DispatchDAG(wr_dag_h, (void (*) (void *)) rf_MCPairWakeupFunc,
diff --git a/sys/dev/raidframe/rf_raid1.c b/sys/dev/raidframe/rf_raid1.c
index cb9f434cda2..f36fbe829e4 100644
--- a/sys/dev/raidframe/rf_raid1.c
+++ b/sys/dev/raidframe/rf_raid1.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_raid1.c,v 1.8 2001/11/13 07:11:16 lukem Exp $ */
+/* $NetBSD: rf_raid1.c,v 1.9 2002/07/13 20:14:34 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -33,7 +33,7 @@
*****************************************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_raid1.c,v 1.8 2001/11/13 07:11:16 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_raid1.c,v 1.9 2002/07/13 20:14:34 oster Exp $");
#include "rf_raid.h"
#include "rf_raid1.h"
@@ -394,11 +394,13 @@ rf_VerifyParityRAID1(
memset((char *) &tracerec, 0, sizeof(tracerec));
rd_dag_h->tracerec = &tracerec;
+#if 0
if (rf_verifyParityDebug > 1) {
printf("raid%d: RAID1 parity verify read dag:\n",
raidPtr->raidid);
rf_PrintDAGList(rd_dag_h);
}
+#endif
RF_LOCK_MUTEX(mcpair->mutex);
mcpair->flag = 0;
rf_DispatchDAG(rd_dag_h, (void (*) (void *)) rf_MCPairWakeupFunc,
@@ -500,10 +502,12 @@ rf_VerifyParityRAID1(
}
memset((char *) &tracerec, 0, sizeof(tracerec));
wr_dag_h->tracerec = &tracerec;
+#if 0
if (rf_verifyParityDebug > 1) {
printf("Parity verify write dag:\n");
rf_PrintDAGList(wr_dag_h);
}
+#endif
RF_LOCK_MUTEX(mcpair->mutex);
mcpair->flag = 0;
/* fire off the write DAG */
diff --git a/sys/dev/raidframe/rf_states.c b/sys/dev/raidframe/rf_states.c
index 4fe2786f61a..d0a37e31b43 100644
--- a/sys/dev/raidframe/rf_states.c
+++ b/sys/dev/raidframe/rf_states.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_states.c,v 1.16 2001/11/13 07:11:17 lukem Exp $ */
+/* $NetBSD: rf_states.c,v 1.17 2002/07/13 20:14:34 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.16 2001/11/13 07:11:17 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.17 2002/07/13 20:14:34 oster Exp $");
#include <sys/errno.h>
@@ -440,9 +440,11 @@ rf_State_CreateDAG(RF_RaidAccessDesc_t * desc)
RF_ETIMER_START(timer);
/* SelectAlgorithm returns one or more dags */
selectStatus = rf_SelectAlgorithm(desc, desc->flags | RF_DAG_SUPPRESS_LOCKS);
+#if RF_DEBUG_VALIDATE_DAG
if (rf_printDAGsDebug)
for (i = 0; i < desc->numStripes; i++)
rf_PrintDAGList(desc->dagArray[i].dags);
+#endif /* RF_DEBUG_VALIDATE_DAG */
RF_ETIMER_STOP(timer);
RF_ETIMER_EVAL(timer);
/* update time to create all dags */