Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Introduce and use RF_DEBUG_QUEUE (for debu...



details:   https://anonhg.NetBSD.org/src/rev/233bfe110e33
branches:  trunk
changeset: 536494:233bfe110e33
user:      oster <oster%NetBSD.org@localhost>
date:      Tue Sep 17 03:43:34 2002 +0000

description:
Introduce and use RF_DEBUG_QUEUE (for debugging the various queueing
types available in RAIDframe).

diffstat:

 sys/dev/raidframe/rf_archs.h |   6 +++++-
 sys/dev/raidframe/rf_fifo.c  |   8 ++++++--
 sys/dev/raidframe/rf_sstf.c  |  22 ++++++++++++++++++++--
 3 files changed, 31 insertions(+), 5 deletions(-)

diffs (205 lines):

diff -r 4221342dde7c -r 233bfe110e33 sys/dev/raidframe/rf_archs.h
--- a/sys/dev/raidframe/rf_archs.h      Tue Sep 17 03:30:33 2002 +0000
+++ b/sys/dev/raidframe/rf_archs.h      Tue Sep 17 03:43:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_archs.h,v 1.16 2002/09/17 03:21:41 oster Exp $      */
+/*     $NetBSD: rf_archs.h,v 1.17 2002/09/17 03:43:34 oster Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -124,6 +124,10 @@
 #define RF_DEBUG_VERIFYPARITY 0
 #endif
 
+#ifndef RF_DEBUG_QUEUE
+#define RF_DEBUG_QUEUE 0
+#endif
+
 #include "rf_options.h"
 
 #endif                         /* !_RF__RF_ARCHS_H_ */
diff -r 4221342dde7c -r 233bfe110e33 sys/dev/raidframe/rf_fifo.c
--- a/sys/dev/raidframe/rf_fifo.c       Tue Sep 17 03:30:33 2002 +0000
+++ b/sys/dev/raidframe/rf_fifo.c       Tue Sep 17 03:43:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_fifo.c,v 1.7 2001/11/13 07:11:14 lukem Exp $        */
+/*     $NetBSD: rf_fifo.c,v 1.8 2002/09/17 03:43:34 oster Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -36,7 +36,7 @@
  ***************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.7 2001/11/13 07:11:14 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_fifo.c,v 1.8 2002/09/17 03:43:34 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -88,10 +88,12 @@
                q->hq_count++;
        } else {
                RF_ASSERT(elem->next == NULL);
+#if RF_DEBUG_QUEUE
                if (rf_fifoDebug) {
                        printf("raid%d: fifo: ENQ lopri\n", 
                               elem->raidPtr->raidid);
                }
+#endif
                if (!q->lq_tail) {
                        RF_ASSERT(q->lq_count == 0 && q->lq_head == NULL);
                        q->lq_head = q->lq_tail = elem;
@@ -139,10 +141,12 @@
                                q->lq_tail = NULL;
                        nd->next = NULL;
                        q->lq_count--;
+#if RF_DEBUG_QUEUE
                        if (rf_fifoDebug) {
                                printf("raid%d: fifo: DEQ lopri %lx\n", 
                                       nd->raidPtr->raidid, (long) nd);
                        }
+#endif
                } else {
                        RF_ASSERT(q->hq_count == 0 && q->lq_count == 0 && q->hq_tail == NULL && q->lq_tail == NULL);
                        nd = NULL;
diff -r 4221342dde7c -r 233bfe110e33 sys/dev/raidframe/rf_sstf.c
--- a/sys/dev/raidframe/rf_sstf.c       Tue Sep 17 03:30:33 2002 +0000
+++ b/sys/dev/raidframe/rf_sstf.c       Tue Sep 17 03:43:34 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_sstf.c,v 1.8 2001/11/13 07:11:17 lukem Exp $        */
+/*     $NetBSD: rf_sstf.c,v 1.9 2002/09/17 03:43: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_sstf.c,v 1.8 2001/11/13 07:11:17 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_sstf.c,v 1.9 2002/09/17 03:43:34 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -297,6 +297,7 @@
        sstfq = (RF_Sstf_t *) qptr;
 
        if (priority == RF_IO_LOW_PRIORITY) {
+#if RF_DEBUG_QUEUE
                if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
                        RF_DiskQueue_t *dq;
                        dq = (RF_DiskQueue_t *) req->queue;
@@ -306,6 +307,7 @@
                               sstfq->left.qlen, sstfq->right.qlen,
                               sstfq->lopri.qlen);
                }
+#endif
                do_sstf_ord_q(&sstfq->lopri.queue, &sstfq->lopri.qtail, req);
                sstfq->lopri.qlen++;
        } else {
@@ -326,9 +328,11 @@
 {
        RF_DiskQueueData_t *req2;
 
+#if RF_DEBUG_QUEUE
        if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
                printf("raid%d: do_dequeue\n", req->raidPtr->raidid);
        }
+#endif
        if (req == queue->queue) {
                DO_HEAD_DEQ(req2, queue);
                RF_ASSERT(req2 == req);
@@ -356,6 +360,7 @@
 
        sstfq = (RF_Sstf_t *) qptr;
 
+#if RF_DEBUG_QUEUE
        if (rf_sstfDebug) {
                RF_DiskQueue_t *dq;
                dq = (RF_DiskQueue_t *) req->queue;
@@ -364,6 +369,7 @@
                       req->raidPtr->raidid, dq->row, dq->col, 
                       sstfq->left.qlen, sstfq->right.qlen, sstfq->lopri.qlen);
        }
+#endif
        if (sstfq->left.queue == NULL) {
                RF_ASSERT(sstfq->left.qlen == 0);
                if (sstfq->right.queue == NULL) {
@@ -372,16 +378,20 @@
                                RF_ASSERT(sstfq->lopri.qlen == 0);
                                return (NULL);
                        }
+#if RF_DEBUG_QUEUE
                        if (rf_sstfDebug) {
                                printf("raid%d: sstf: check for close lopri",
                                       req->raidPtr->raidid);
                        }
+#endif
                        req = closest_to_arm(&sstfq->lopri, sstfq->last_sector,
                            &sstfq->dir, sstfq->allow_reverse);
+#if RF_DEBUG_QUEUE
                        if (rf_sstfDebug) {
                                printf("raid%d: sstf: closest_to_arm said %lx",
                                       req->raidPtr->raidid, (long) req);
                        }
+#endif
                        if (req == NULL)
                                return (NULL);
                        do_dequeue(&sstfq->lopri, req);
@@ -415,6 +425,7 @@
 
        scanq = (RF_Sstf_t *) qptr;
 
+#if RF_DEBUG_QUEUE
        if (rf_scanDebug) {
                RF_DiskQueue_t *dq;
                dq = (RF_DiskQueue_t *) req->queue;
@@ -423,6 +434,7 @@
                       req->raidPtr->raidid, dq->row, dq->col, 
                       scanq->left.qlen, scanq->right.qlen, scanq->lopri.qlen);
        }
+#endif
        if (scanq->left.queue == NULL) {
                RF_ASSERT(scanq->left.qlen == 0);
                if (scanq->right.queue == NULL) {
@@ -470,6 +482,7 @@
        cscanq = (RF_Sstf_t *) qptr;
 
        RF_ASSERT(cscanq->dir == DIR_RIGHT);
+#if RF_DEBUG_QUEUE
        if (rf_cscanDebug) {
                RF_DiskQueue_t *dq;
                dq = (RF_DiskQueue_t *) req->queue;
@@ -479,6 +492,7 @@
                       cscanq->left.qlen, cscanq->right.qlen,
                       cscanq->lopri.qlen);
        }
+#endif
        if (cscanq->right.queue) {
                DO_HEAD_DEQ(req, &cscanq->right);
        } else {
@@ -639,10 +653,12 @@
        n = 0;
        for (r = sstfq->lopri.queue; r; r = next) {
                next = r->next;
+#if RF_DEBUG_QUEUE
                if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
                        printf("raid%d: check promote %lx\n",
                               r->raidPtr->raidid, (long) r);
                }
+#endif
                if ((r->parityStripeID == parityStripeID)
                    && (r->which_ru == which_ru)) {
                        do_dequeue(&sstfq->lopri, r);
@@ -650,10 +666,12 @@
                        n++;
                }
        }
+#if RF_DEBUG_QUEUE
        if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
                printf("raid%d: promoted %d matching I/Os queues are %d,%d,%d\n",
                       r->raidPtr->raidid, n, sstfq->left.qlen, 
                       sstfq->right.qlen, sstfq->lopri.qlen);
        }
+#endif
        return (n);
 }



Home | Main Index | Thread Index | Old Index