Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe - more cleanup of rf_get_threadid() and de...



details:   https://anonhg.NetBSD.org/src/rev/cb74d63a8f74
branches:  trunk
changeset: 480290:cb74d63a8f74
user:      oster <oster%NetBSD.org@localhost>
date:      Sat Jan 08 23:45:05 2000 +0000

description:
- more cleanup of rf_get_threadid() and debugging printfs

diffstat:

 sys/dev/raidframe/rf_fifo.c        |  20 +++------
 sys/dev/raidframe/rf_sstf.c        |  79 ++++++++++++++++---------------------
 sys/dev/raidframe/rf_stripelocks.c |   6 +--
 3 files changed, 42 insertions(+), 63 deletions(-)

diffs (261 lines):

diff -r d66ef21057a7 -r cb74d63a8f74 sys/dev/raidframe/rf_fifo.c
--- a/sys/dev/raidframe/rf_fifo.c       Sat Jan 08 23:34:17 2000 +0000
+++ b/sys/dev/raidframe/rf_fifo.c       Sat Jan 08 23:45:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_fifo.c,v 1.3 1999/02/05 00:06:11 oster Exp $        */
+/*     $NetBSD: rf_fifo.c,v 1.4 2000/01/08 23:45:05 oster Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -43,8 +43,9 @@
 #include "rf_fifo.h"
 #include "rf_debugMem.h"
 #include "rf_general.h"
-#include "rf_threadid.h"
 #include "rf_options.h"
+#include "rf_raid.h"
+#include "rf_types.h"
 
 /* just malloc a header, zero it (via calloc), and return it */
 /*ARGSUSED*/
@@ -85,9 +86,8 @@
        } else {
                RF_ASSERT(elem->next == NULL);
                if (rf_fifoDebug) {
-                       int     tid;
-                       rf_get_threadid(tid);
-                       printf("[%d] fifo: ENQ lopri\n", tid);
+                       printf("raid%d: fifo: ENQ lopri\n", 
+                              elem->raidPtr->raidid);
                }
                if (!q->lq_tail) {
                        RF_ASSERT(q->lq_count == 0 && q->lq_head == NULL);
@@ -137,9 +137,8 @@
                        nd->next = NULL;
                        q->lq_count--;
                        if (rf_fifoDebug) {
-                               int     tid;
-                               rf_get_threadid(tid);
-                               printf("[%d] fifo: DEQ lopri %lx\n", tid, (long) nd);
+                               printf("raid%d: fifo: DEQ lopri %lx\n", 
+                                      nd->raidPtr->raidid, (long) nd);
                        }
                } else {
                        RF_ASSERT(q->hq_count == 0 && q->lq_count == 0 && q->hq_tail == NULL && q->lq_tail == NULL);
@@ -318,10 +317,5 @@
        /* sanity check.  delete this if you ever put more than one entry in
         * the low-pri queue */
        RF_ASSERT(retval == 0 || retval == 1);
-       if (rf_fifoDebug) {
-               int     tid;
-               rf_get_threadid(tid);
-               printf("[%d] fifo: promote %d\n", tid, retval);
-       }
        return (retval);
 }
diff -r d66ef21057a7 -r cb74d63a8f74 sys/dev/raidframe/rf_sstf.c
--- a/sys/dev/raidframe/rf_sstf.c       Sat Jan 08 23:34:17 2000 +0000
+++ b/sys/dev/raidframe/rf_sstf.c       Sat Jan 08 23:45:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_sstf.c,v 1.3 1999/02/05 00:06:17 oster Exp $        */
+/*     $NetBSD: rf_sstf.c,v 1.4 2000/01/08 23:45:05 oster Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -39,8 +39,9 @@
 #include "rf_sstf.h"
 #include "rf_debugMem.h"
 #include "rf_general.h"
-#include "rf_threadid.h"
 #include "rf_options.h"
+#include "rf_raid.h"
+#include "rf_types.h"
 
 #define DIR_LEFT   1
 #define DIR_RIGHT  2
@@ -294,12 +295,12 @@
        if (priority == RF_IO_LOW_PRIORITY) {
                if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
                        RF_DiskQueue_t *dq;
-                       int     tid;
-                       rf_get_threadid(tid);
                        dq = (RF_DiskQueue_t *) req->queue;
-                       printf("[%d] ENQ lopri %d,%d queues are %d,%d,%d\n",
-                           tid, dq->row, dq->col, sstfq->left.qlen, sstfq->right.qlen,
-                           sstfq->lopri.qlen);
+                       printf("raid%d: ENQ lopri %d,%d queues are %d,%d,%d\n",
+                              req->raidPtr->raidid,
+                              dq->row, dq->col, 
+                              sstfq->left.qlen, sstfq->right.qlen,
+                              sstfq->lopri.qlen);
                }
                do_sstf_ord_q(&sstfq->lopri.queue, &sstfq->lopri.qtail, req);
                sstfq->lopri.qlen++;
@@ -322,9 +323,7 @@
        RF_DiskQueueData_t *req2;
 
        if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
-               int     tid;
-               rf_get_threadid(tid);
-               printf("[%d] do_dequeue\n", tid);
+               printf("raid%d: do_dequeue\n", req->raidPtr->raidid);
        }
        if (req == queue->queue) {
                DO_HEAD_DEQ(req2, queue);
@@ -355,13 +354,11 @@
 
        if (rf_sstfDebug) {
                RF_DiskQueue_t *dq;
-               int     tid;
-               rf_get_threadid(tid);
                dq = (RF_DiskQueue_t *) req->queue;
                RF_ASSERT(QSUM(sstfq) == dq->queueLength);
-               printf("[%d] sstf: Dequeue %d,%d queues are %d,%d,%d\n", tid,
-                   dq->row, dq->col, sstfq->left.qlen, sstfq->right.qlen,
-                   sstfq->lopri.qlen);
+               printf("raid%d: sstf: Dequeue %d,%d queues are %d,%d,%d\n",
+                      req->raidPtr->raidid, dq->row, dq->col, 
+                      sstfq->left.qlen, sstfq->right.qlen, sstfq->lopri.qlen);
        }
        if (sstfq->left.queue == NULL) {
                RF_ASSERT(sstfq->left.qlen == 0);
@@ -372,16 +369,14 @@
                                return (NULL);
                        }
                        if (rf_sstfDebug) {
-                               int     tid;
-                               rf_get_threadid(tid);
-                               printf("[%d] sstf: check for close lopri", tid);
+                               printf("raid%d: sstf: check for close lopri",
+                                      req->raidPtr->raidid);
                        }
                        req = closest_to_arm(&sstfq->lopri, sstfq->last_sector,
                            &sstfq->dir, sstfq->allow_reverse);
                        if (rf_sstfDebug) {
-                               int     tid;
-                               rf_get_threadid(tid);
-                               printf("[%d] sstf: closest_to_arm said %lx", tid, (long) req);
+                               printf("raid%d: sstf: closest_to_arm said %lx",
+                                      req->raidPtr->raidid, (long) req);
                        }
                        if (req == NULL)
                                return (NULL);
@@ -418,13 +413,11 @@
 
        if (rf_scanDebug) {
                RF_DiskQueue_t *dq;
-               int     tid;
-               rf_get_threadid(tid);
                dq = (RF_DiskQueue_t *) req->queue;
                RF_ASSERT(QSUM(scanq) == dq->queueLength);
-               printf("[%d] scan: Dequeue %d,%d queues are %d,%d,%d\n", tid,
-                   dq->row, dq->col, scanq->left.qlen, scanq->right.qlen,
-                   scanq->lopri.qlen);
+               printf("raid%d: scan: Dequeue %d,%d queues are %d,%d,%d\n", 
+                      req->raidPtr->raidid, dq->row, dq->col, 
+                      scanq->left.qlen, scanq->right.qlen, scanq->lopri.qlen);
        }
        if (scanq->left.queue == NULL) {
                RF_ASSERT(scanq->left.qlen == 0);
@@ -475,13 +468,12 @@
        RF_ASSERT(cscanq->dir == DIR_RIGHT);
        if (rf_cscanDebug) {
                RF_DiskQueue_t *dq;
-               int     tid;
-               rf_get_threadid(tid);
                dq = (RF_DiskQueue_t *) req->queue;
                RF_ASSERT(QSUM(cscanq) == dq->queueLength);
-               printf("[%d] scan: Dequeue %d,%d queues are %d,%d,%d\n", tid,
-                   dq->row, dq->col, cscanq->left.qlen, cscanq->right.qlen,
-                   cscanq->lopri.qlen);
+               printf("raid%d: scan: Dequeue %d,%d queues are %d,%d,%d\n", 
+                      req->raidPtr->raidid, dq->row, dq->col,
+                      cscanq->left.qlen, cscanq->right.qlen,
+                      cscanq->lopri.qlen);
        }
        if (cscanq->right.queue) {
                DO_HEAD_DEQ(req, &cscanq->right);
@@ -642,20 +634,18 @@
 
        n = 0;
        if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
-               int     tid;
-               rf_get_threadid(tid);
-               printf("[%d] promote %ld %d  queues are %d,%d,%d\n",
-                   tid, (long) parityStripeID, (int) which_ru,
-                   sstfq->left.qlen,
-                   sstfq->right.qlen,
-                   sstfq->lopri.qlen);
+               printf("raid%d: promote %ld %d  queues are %d,%d,%d\n",
+                      r->raidPtr->raidid, (long) parityStripeID, 
+                      (int) which_ru,
+                      sstfq->left.qlen,
+                      sstfq->right.qlen,
+                      sstfq->lopri.qlen);
        }
        for (r = sstfq->lopri.queue; r; r = next) {
                next = r->next;
                if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
-                       int     tid;
-                       rf_get_threadid(tid);
-                       printf("[%d] check promote %lx\n", tid, (long) r);
+                       printf("raid%d: check promote %lx\n",
+                              r->raidPtr->raidid, (long) r);
                }
                if ((r->parityStripeID == parityStripeID)
                    && (r->which_ru == which_ru)) {
@@ -665,10 +655,9 @@
                }
        }
        if (rf_sstfDebug || rf_scanDebug || rf_cscanDebug) {
-               int     tid;
-               rf_get_threadid(tid);
-               printf("[%d] promoted %d matching I/Os queues are %d,%d,%d\n",
-                   tid, n, sstfq->left.qlen, sstfq->right.qlen, sstfq->lopri.qlen);
+               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);
        }
        return (n);
 }
diff -r d66ef21057a7 -r cb74d63a8f74 sys/dev/raidframe/rf_stripelocks.c
--- a/sys/dev/raidframe/rf_stripelocks.c        Sat Jan 08 23:34:17 2000 +0000
+++ b/sys/dev/raidframe/rf_stripelocks.c        Sat Jan 08 23:45:05 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_stripelocks.c,v 1.4 2000/01/07 03:04:41 oster Exp $ */
+/*     $NetBSD: rf_stripelocks.c,v 1.5 2000/01/08 23:45:05 oster Exp $ */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -60,7 +60,6 @@
 #include "rf_raid.h"
 #include "rf_stripelocks.h"
 #include "rf_alloclist.h"
-#include "rf_threadid.h"
 #include "rf_general.h"
 #include "rf_freelist.h"
 #include "rf_debugprint.h"
@@ -236,7 +235,6 @@
        RF_ASSERT(RF_IO_IS_R_OR_W(lockReqDesc->type));
 
        if (rf_stripeLockDebug) {
-               rf_get_threadid(tid);
                if (stripeID == -1)
                        Dprintf1("[%d] Lock acquisition supressed (stripeID == -1)\n", tid);
                else {
@@ -346,7 +344,6 @@
        RF_ASSERT(RF_IO_IS_R_OR_W(type));
 
        if (rf_stripeLockDebug) {
-               rf_get_threadid(tid);
                if (stripeID == -1)
                        Dprintf1("[%d] Lock release supressed (stripeID == -1)\n", tid);
                else {
@@ -573,7 +570,6 @@
        int     tid;
 
        if (rf_stripeLockDebug) {
-               rf_get_threadid(tid);
                Dprintf3("[%d] Waiting on lock for stripe %ld table 0x%lx\n", tid, lockDesc->stripeID, (unsigned long) lockTable);
                FLUSH;
        }



Home | Main Index | Thread Index | Old Index