Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe RF_DEBUG_ACCESS and RF_DEBUG_QUIESCE make ...



details:   https://anonhg.NetBSD.org/src/rev/853ed51545af
branches:  trunk
changeset: 536495:853ed51545af
user:      oster <oster%NetBSD.org@localhost>
date:      Tue Sep 17 03:54:42 2002 +0000

description:
RF_DEBUG_ACCESS and RF_DEBUG_QUIESCE make things a little smaller.

diffstat:

 sys/dev/raidframe/rf_archs.h  |   6 +++++-
 sys/dev/raidframe/rf_driver.c |  17 ++++++++++++++---
 sys/dev/raidframe/rf_states.c |   7 ++++---
 3 files changed, 23 insertions(+), 7 deletions(-)

diffs (131 lines):

diff -r 233bfe110e33 -r 853ed51545af sys/dev/raidframe/rf_archs.h
--- a/sys/dev/raidframe/rf_archs.h      Tue Sep 17 03:43:34 2002 +0000
+++ b/sys/dev/raidframe/rf_archs.h      Tue Sep 17 03:54:42 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_archs.h,v 1.17 2002/09/17 03:43:34 oster Exp $      */
+/*     $NetBSD: rf_archs.h,v 1.18 2002/09/17 03:54:42 oster Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -128,6 +128,10 @@
 #define RF_DEBUG_QUEUE 0
 #endif
 
+#ifndef RF_DEBUG_QUIESCE
+#define RF_DEBUG_QUIESCE 0
+#endif
+
 #include "rf_options.h"
 
 #endif                         /* !_RF__RF_ARCHS_H_ */
diff -r 233bfe110e33 -r 853ed51545af sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c     Tue Sep 17 03:43:34 2002 +0000
+++ b/sys/dev/raidframe/rf_driver.c     Tue Sep 17 03:54:42 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_driver.c,v 1.60 2002/09/16 23:40:57 oster Exp $     */
+/*     $NetBSD: rf_driver.c,v 1.61 2002/09/17 03:54:42 oster Exp $     */
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -73,7 +73,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.60 2002/09/16 23:40:57 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.61 2002/09/17 03:54:42 oster Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -116,6 +116,10 @@
 
 #include <sys/buf.h>
 
+#ifndef RF_ACCESS_DEBUG
+#define RF_ACCESS_DEBUG 0
+#endif
+
 /* rad == RF_RaidAccessDesc_t */
 static RF_FreeList_t *rf_rad_freelist;
 #define RF_MAX_FREE_RAD 128
@@ -654,6 +658,7 @@
 
        raidAddress += rf_raidSectorOffset;
 
+#if RF_ACCESS_DEBUG
        if (rf_accessDebug) {
 
                printf("logBytes is: %d %d %d\n", raidPtr->raidid,
@@ -667,6 +672,7 @@
                    (int) rf_RaidAddressToByte(raidPtr, numBlocks),
                    (long) bufPtr);
        }
+#endif
        if (raidAddress + numBlocks > raidPtr->totalSectors) {
 
                printf("DoAccess: raid addr %lu too large to access %lu sectors.  Max legal addr is %lu\n",
@@ -754,10 +760,12 @@
        RF_Raid_t *raidPtr;
        RF_RaidReconDesc_t *reconDesc;
 {
+#if RF_DEBUG_QUIESCE
        if (rf_quiesceDebug) {
                printf("raid%d: Signalling quiescence lock\n", 
                       raidPtr->raidid);
        }
+#endif
        raidPtr->access_suspend_release = 1;
 
        if (raidPtr->waiting_for_quiescence) {
@@ -769,9 +777,10 @@
 rf_SuspendNewRequestsAndWait(raidPtr)
        RF_Raid_t *raidPtr;
 {
+#if RF_DEBUG_QUIESCE
        if (rf_quiesceDebug)
                printf("raid%d: Suspending new reqs\n", raidPtr->raidid);
-
+#endif
        RF_LOCK_MUTEX(raidPtr->access_suspend_mutex);
        raidPtr->accesses_suspended++;
        raidPtr->waiting_for_quiescence = (raidPtr->accs_in_flight == 0) ? 0 : 1;
@@ -797,8 +806,10 @@
 {
        RF_CallbackDesc_t *t, *cb;
 
+#if RF_DEBUG_QUIESCE
        if (rf_quiesceDebug)
                printf("Resuming new reqs\n");
+#endif
 
        RF_LOCK_MUTEX(raidPtr->access_suspend_mutex);
        raidPtr->accesses_suspended--;
diff -r 233bfe110e33 -r 853ed51545af sys/dev/raidframe/rf_states.c
--- a/sys/dev/raidframe/rf_states.c     Tue Sep 17 03:43:34 2002 +0000
+++ b/sys/dev/raidframe/rf_states.c     Tue Sep 17 03:54:42 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_states.c,v 1.17 2002/07/13 20:14:34 oster Exp $     */
+/*     $NetBSD: rf_states.c,v 1.18 2002/09/17 03:54:43 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.17 2002/07/13 20:14:34 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_states.c,v 1.18 2002/09/17 03:54:43 oster Exp $");
 
 #include <sys/errno.h>
 
@@ -299,9 +299,10 @@
        RF_ETIMER_EVAL(timer);
        tracerec->specific.user.suspend_ovhd_us += RF_ETIMER_VAL_US(timer);
 
+#if RF_DEBUG_QUIESCE
        if (suspended && rf_quiesceDebug)
                printf("Stalling access due to quiescence lock\n");
-
+#endif
        desc->state++;
        return suspended;
 }



Home | Main Index | Thread Index | Old Index