diff options
| author | oster <oster@NetBSD.org> | 2000-01-08 23:45:05 +0000 |
|---|---|---|
| committer | oster <oster@NetBSD.org> | 2000-01-08 23:45:05 +0000 |
| commit | 418d4b847156d2ced16a683fedd7e5e426189ea3 (patch) | |
| tree | 4d1e198f19469be2998fc5849ca5f0c9a1393932 /sys/dev/raidframe | |
| parent | 4bed540017113de3f1e91f908b9efe7a0a9ec9bf (diff) | |
- more cleanup of rf_get_threadid() and debugging printfs
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_fifo.c | 20 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_sstf.c | 79 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_stripelocks.c | 6 |
3 files changed, 42 insertions, 63 deletions
diff --git a/sys/dev/raidframe/rf_fifo.c b/sys/dev/raidframe/rf_fifo.c index 06b37e2f47a..76b7887223e 100644 --- a/sys/dev/raidframe/rf_fifo.c +++ b/sys/dev/raidframe/rf_fifo.c @@ -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 @@ rf_FifoEnqueue(q_in, elem, priority) } 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 @@ rf_FifoDequeue(q_in) 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 @@ rf_FifoPromote(q_in, parityStripeID, which_ru) /* 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 --git a/sys/dev/raidframe/rf_sstf.c b/sys/dev/raidframe/rf_sstf.c index a72e69864d7..7c66cd3682c 100644 --- a/sys/dev/raidframe/rf_sstf.c +++ b/sys/dev/raidframe/rf_sstf.c @@ -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 @@ rf_SstfEnqueue(qptr, req, priority) 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 @@ do_dequeue(queue, req) 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 @@ rf_SstfDequeue(qptr) 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 @@ rf_SstfDequeue(qptr) 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 @@ rf_ScanDequeue(qptr) 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_CscanDequeue(qptr) 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 @@ rf_SstfPromote(qptr, parityStripeID, which_ru) 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 @@ rf_SstfPromote(qptr, parityStripeID, which_ru) } } 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 --git a/sys/dev/raidframe/rf_stripelocks.c b/sys/dev/raidframe/rf_stripelocks.c index 8a35f25c6a3..6a2ddd8b6ff 100644 --- a/sys/dev/raidframe/rf_stripelocks.c +++ b/sys/dev/raidframe/rf_stripelocks.c @@ -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_AcquireStripeLock( 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_ReleaseStripeLock( 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 @@ AddToWaitersQueue( 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; } |
