Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Only include some debugging printf's if DE...



details:   https://anonhg.NetBSD.org/src/rev/d079ff6e0d2d
branches:  trunk
changeset: 520854:d079ff6e0d2d
user:      oster <oster%NetBSD.org@localhost>
date:      Sat Jan 19 01:51:51 2002 +0000

description:
Only include some debugging printf's if DEBUG is defined.

diffstat:

 sys/dev/raidframe/rf_stripelocks.c |  37 +++++++++++++++++++++++++++++--------
 1 files changed, 29 insertions(+), 8 deletions(-)

diffs (92 lines):

diff -r 1b9a04eed3f4 -r d079ff6e0d2d sys/dev/raidframe/rf_stripelocks.c
--- a/sys/dev/raidframe/rf_stripelocks.c        Sat Jan 19 00:08:17 2002 +0000
+++ b/sys/dev/raidframe/rf_stripelocks.c        Sat Jan 19 01:51:51 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_stripelocks.c,v 1.10 2001/11/13 07:11:17 lukem Exp $        */
+/*     $NetBSD: rf_stripelocks.c,v 1.11 2002/01/19 01:51:51 oster Exp $        */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -57,7 +57,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.10 2001/11/13 07:11:17 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_stripelocks.c,v 1.11 2002/01/19 01:51:51 oster Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -70,6 +70,8 @@
 #include "rf_driver.h"
 #include "rf_shutdown.h"
 
+#ifdef DEBUG 
+
 #define Dprintf1(s,a)         rf_debug_printf(s,(void *)((unsigned long)a),NULL,NULL,NULL,NULL,NULL,NULL,NULL)
 #define Dprintf2(s,a,b)       rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),NULL,NULL,NULL,NULL,NULL,NULL)
 #define Dprintf3(s,a,b,c)     rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),(void *)((unsigned long)c),NULL,NULL,NULL,NULL,NULL)
@@ -79,6 +81,19 @@
 #define Dprintf7(s,a,b,c,d,e,f,g) rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),(void *)((unsigned long)c),(void *)((unsigned long)d),(void *)((unsigned long)e),(void 
*)((unsigned long)f),(void *)((unsigned long)g),NULL)
 #define Dprintf8(s,a,b,c,d,e,f,g,h) rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),(void *)((unsigned long)c),(void *)((unsigned long)d),(void *)((unsigned long)e),(void 
*)((unsigned long)f),(void *)((unsigned long)g),(void *)((unsigned long)h))
 
+#else /* DEBUG */
+
+#define Dprintf1(s,a) {}
+#define Dprintf2(s,a,b) {}
+#define Dprintf3(s,a,b,c) {}
+#define Dprintf4(s,a,b,c,d) {}
+#define Dprintf5(s,a,b,c,d,e) {}
+#define Dprintf6(s,a,b,c,d,e,f) {}
+#define Dprintf7(s,a,b,c,d,e,f,g) {}
+#define Dprintf8(s,a,b,c,d,e,f,g,h) {}
+
+#endif /* DEBUG */
+
 #define FLUSH
 
 #define HASH_STRIPEID(_sid_)  ( (_sid_) & (rf_lockTableSize-1) )
@@ -233,15 +248,18 @@
 {
        RF_StripeLockDesc_t *lockDesc;
        RF_LockReqDesc_t *p;
-       int     tid = 0, hashval = HASH_STRIPEID(stripeID);
+#ifdef DEBUG
+       int     tid = 0
+#endif
+       int     hashval = HASH_STRIPEID(stripeID);
        int     retcode = 0;
 
        RF_ASSERT(RF_IO_IS_R_OR_W(lockReqDesc->type));
 
        if (rf_stripeLockDebug) {
-               if (stripeID == -1)
+               if (stripeID == -1) {
                        Dprintf1("[%d] Lock acquisition supressed (stripeID == -1)\n", tid);
-               else {
+               } else {
                        Dprintf8("[%d] Trying to acquire stripe lock table 0x%lx SID %ld type %c range %ld-%ld, range2 %ld-%ld hashval %d\n",
                            tid, (unsigned long) lockTable, stripeID, lockReqDesc->type, lockReqDesc->start,
                            lockReqDesc->stop, lockReqDesc->start2, lockReqDesc->stop2);
@@ -340,16 +358,19 @@
 {
        RF_StripeLockDesc_t *lockDesc, *ld_t;
        RF_LockReqDesc_t *lr, *lr_t, *callbacklist, *t;
-       int     tid = 0, hashval = HASH_STRIPEID(stripeID);
+#ifdef DEBUG
+       int     tid = 0
+#endif
+       int     hashval = HASH_STRIPEID(stripeID);
        int     release_it, consider_it;
        RF_LockReqDesc_t *candidate, *candidate_t, *predecessor;
 
        RF_ASSERT(RF_IO_IS_R_OR_W(lockReqDesc->type));
 
        if (rf_stripeLockDebug) {
-               if (stripeID == -1)
+               if (stripeID == -1) {
                        Dprintf1("[%d] Lock release supressed (stripeID == -1)\n", tid);
-               else {
+               } else {
                        Dprintf8("[%d] Releasing stripe lock on stripe ID %ld, type %c range %ld-%ld %ld-%ld table 0x%lx\n",
                            tid, stripeID, lockReqDesc->type, lockReqDesc->start, lockReqDesc->stop, lockReqDesc->start2, lockReqDesc->stop2, lockTable);
                        FLUSH;



Home | Main Index | Thread Index | Old Index