Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/raidframe Most folks won't need the DAG printing and...



details:   https://anonhg.NetBSD.org/src/rev/cd615047bad7
branches:  trunk
changeset: 534030:cd615047bad7
user:      oster <oster%NetBSD.org@localhost>
date:      Sat Jul 13 20:14:33 2002 +0000

description:
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:

 sys/dev/raidframe/rf_archs.h      |  6 +++++-
 sys/dev/raidframe/rf_dagutils.c   |  8 ++++++--
 sys/dev/raidframe/rf_engine.c     |  6 ++++--
 sys/dev/raidframe/rf_parityscan.c |  9 ++++++---
 sys/dev/raidframe/rf_raid1.c      |  8 ++++++--
 sys/dev/raidframe/rf_states.c     |  6 ++++--
 6 files changed, 31 insertions(+), 12 deletions(-)

diffs (221 lines):

diff -r 204cf62756dd -r cd615047bad7 sys/dev/raidframe/rf_archs.h
--- a/sys/dev/raidframe/rf_archs.h      Sat Jul 13 20:01:13 2002 +0000
+++ b/sys/dev/raidframe/rf_archs.h      Sat Jul 13 20:14:33 2002 +0000
@@ -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 -r 204cf62756dd -r cd615047bad7 sys/dev/raidframe/rf_dagutils.c
--- a/sys/dev/raidframe/rf_dagutils.c   Sat Jul 13 20:01:13 2002 +0000
+++ b/sys/dev/raidframe/rf_dagutils.c   Sat Jul 13 20:14:33 2002 +0000
@@ -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_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 @@
            (char *), allocList);
        return ((void *) p);
 }
+#if RF_DEBUG_VALIDATE_DAG
 /******************************************************************************
  *
  * debug routines
@@ -734,6 +737,7 @@
        return (retcode);
 }
 
+#endif /* RF_DEBUG_VALIDATE_DAG */
 
 /******************************************************************************
  *
diff -r 204cf62756dd -r cd615047bad7 sys/dev/raidframe/rf_engine.c
--- a/sys/dev/raidframe/rf_engine.c     Sat Jul 13 20:01:13 2002 +0000
+++ b/sys/dev/raidframe/rf_engine.c     Sat Jul 13 20:14:33 2002 +0000
@@ -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_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 -r 204cf62756dd -r cd615047bad7 sys/dev/raidframe/rf_parityscan.c
--- a/sys/dev/raidframe/rf_parityscan.c Sat Jul 13 20:01:13 2002 +0000
+++ b/sys/dev/raidframe/rf_parityscan.c Sat Jul 13 20:14:33 2002 +0000
@@ -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 @@
        /* 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 @@
                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 -r 204cf62756dd -r cd615047bad7 sys/dev/raidframe/rf_raid1.c
--- a/sys/dev/raidframe/rf_raid1.c      Sat Jul 13 20:01:13 2002 +0000
+++ b/sys/dev/raidframe/rf_raid1.c      Sat Jul 13 20:14:33 2002 +0000
@@ -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 @@
        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 @@
                }
                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 -r 204cf62756dd -r cd615047bad7 sys/dev/raidframe/rf_states.c
--- a/sys/dev/raidframe/rf_states.c     Sat Jul 13 20:01:13 2002 +0000
+++ b/sys/dev/raidframe/rf_states.c     Sat Jul 13 20:14:33 2002 +0000
@@ -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_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 */



Home | Main Index | Thread Index | Old Index