Cast the RF_DEBUG_RECON net a little wider.

This commit is contained in:
oster 2002-09-17 03:30:33 +00:00
parent 1b1653573f
commit aad979b7eb
3 changed files with 26 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_copyback.c,v 1.19 2001/11/15 09:48:13 lukem Exp $ */
/* $NetBSD: rf_copyback.c,v 1.20 2002/09/17 03:30:33 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -38,7 +38,7 @@
****************************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.19 2001/11/15 09:48:13 lukem Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.20 2002/09/17 03:30:33 oster Exp $");
#include <dev/raidframe/raidframevar.h>
@ -251,18 +251,26 @@ rf_ContinueCopyback(desc)
RF_Raid_t *raidPtr = desc->raidPtr;
RF_RaidAddr_t addr;
RF_RowCol_t testRow, testCol;
int old_pctg, new_pctg, done;
#if RF_DEBUG_RECON
int old_pctg, new_pctg;
struct timeval t, diff;
#endif
int done;
#if RF_DEBUG_RECON
old_pctg = (-1);
#endif
while (1) {
stripeAddr = desc->stripeAddr;
desc->raidPtr->copyback_stripes_done = stripeAddr
/ desc->sectPerStripe;
#if RF_DEBUG_RECON
if (rf_prReconSched) {
old_pctg = 100 * desc->stripeAddr / raidPtr->totalSectors;
}
#endif
desc->stripeAddr += desc->sectPerStripe;
#if RF_DEBUG_RECON
if (rf_prReconSched) {
new_pctg = 100 * desc->stripeAddr / raidPtr->totalSectors;
if (new_pctg != old_pctg) {
@ -271,6 +279,7 @@ rf_ContinueCopyback(desc)
printf("%d %d.%06d\n", new_pctg, (int) diff.tv_sec, (int) diff.tv_usec);
}
}
#endif
if (stripeAddr >= raidPtr->totalSectors) {
rf_CopybackComplete(desc, 0);
return;

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconmap.c,v 1.10 2002/09/17 03:11:41 oster Exp $ */
/* $NetBSD: rf_reconmap.c,v 1.11 2002/09/17 03:30:33 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -34,7 +34,7 @@
*************************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_reconmap.c,v 1.10 2002/09/17 03:11:41 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconmap.c,v 1.11 2002/09/17 03:30:33 oster Exp $");
#include "rf_raid.h"
#include <sys/time.h>
@ -381,6 +381,7 @@ rf_PrintReconMap(raidPtr, mapPtr, frow, fcol)
}
#endif
#if RF_DEBUG_RECON
void
rf_PrintReconSchedule(mapPtr, starttime)
RF_ReconMap_t *mapPtr;
@ -398,3 +399,5 @@ rf_PrintReconSchedule(mapPtr, starttime)
old_pctg = new_pctg;
}
}
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: rf_reconstruct.c,v 1.40 2002/09/17 03:21:41 oster Exp $ */
/* $NetBSD: rf_reconstruct.c,v 1.41 2002/09/17 03:30:33 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@ -33,7 +33,7 @@
************************************************************/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.40 2002/09/17 03:21:41 oster Exp $");
__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.41 2002/09/17 03:30:33 oster Exp $");
#include <sys/time.h>
#include <sys/buf.h>
@ -66,7 +66,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.40 2002/09/17 03:21:41 oster Ex
/* setting these to -1 causes them to be set to their default values if not set by debug options */
#ifdef DEBUG
#if RF_DEBUG_RECON
#define Dprintf(s) if (rf_reconDebug) rf_debug_printf(s,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
#define Dprintf1(s,a) if (rf_reconDebug) rf_debug_printf(s,(void *)((unsigned long)a),NULL,NULL,NULL,NULL,NULL,NULL,NULL)
#define Dprintf2(s,a,b) if (rf_reconDebug) rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),NULL,NULL,NULL,NULL,NULL,NULL)
@ -79,7 +79,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.40 2002/09/17 03:21:41 oster Ex
#define DDprintf1(s,a) if (rf_reconDebug) rf_debug_printf(s,(void *)((unsigned long)a),NULL,NULL,NULL,NULL,NULL,NULL,NULL)
#define DDprintf2(s,a,b) if (rf_reconDebug) rf_debug_printf(s,(void *)((unsigned long)a),(void *)((unsigned long)b),NULL,NULL,NULL,NULL,NULL,NULL)
#else /* DEBUG */
#else /* RF_DEBUG_RECON */
#define Dprintf(s) {}
#define Dprintf1(s,a) {}
@ -93,7 +93,7 @@ __KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.40 2002/09/17 03:21:41 oster Ex
#define DDprintf1(s,a) {}
#define DDprintf2(s,a,b) {}
#endif /* DEBUG */
#endif /* RF_DEBUG_RECON */
static RF_FreeList_t *rf_recond_freelist;
@ -745,9 +745,11 @@ rf_ContinueReconstructFailedDisk(reconDesc)
raidPtr->reconControl[row]->percentComplete =
(raidPtr->reconControl[row]->numRUsComplete * 100 / raidPtr->reconControl[row]->numRUsTotal);
#if RF_DEBUG_RECON
if (rf_prReconSched) {
rf_PrintReconSchedule(raidPtr->reconControl[row]->reconMap, &(raidPtr->reconControl[row]->starttime));
}
#endif
}
@ -770,9 +772,11 @@ rf_ContinueReconstructFailedDisk(reconDesc)
(void) ProcessReconEvent(raidPtr, row, event); /* ignore return code */
raidPtr->reconControl[row]->percentComplete = 100 - (rf_UnitsLeftToReconstruct(mapPtr) * 100 / mapPtr->totalRUs);
#if RF_DEBUG_RECON
if (rf_prReconSched) {
rf_PrintReconSchedule(raidPtr->reconControl[row]->reconMap, &(raidPtr->reconControl[row]->starttime));
}
#endif
}
reconDesc->state = 5;