Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe Use RF_ACC_TRACE to #if out more chunks of...
details: https://anonhg.NetBSD.org/src/rev/3ac050f14e73
branches: trunk
changeset: 558900:3ac050f14e73
user: oster <oster%NetBSD.org@localhost>
date: Mon Mar 01 23:30:57 2004 +0000
description:
Use RF_ACC_TRACE to #if out more chunks of code related only
to access tracing. (not turned on yet)
diffstat:
sys/dev/raidframe/rf_acctrace.c | 10 +----
sys/dev/raidframe/rf_dag.h | 5 +-
sys/dev/raidframe/rf_dagfuncs.c | 59 ++++++++++++++++++++++++++++++++++---
sys/dev/raidframe/rf_driver.c | 11 +++++-
sys/dev/raidframe/rf_engine.c | 6 ++-
sys/dev/raidframe/rf_netbsdkintf.c | 11 +++---
sys/dev/raidframe/rf_parityscan.c | 10 +++++-
sys/dev/raidframe/rf_raid.h | 4 +-
sys/dev/raidframe/rf_raid1.c | 11 +++++-
sys/dev/raidframe/rf_reconbuffer.c | 8 +++-
sys/dev/raidframe/rf_reconstruct.c | 31 ++++++++++++++++---
11 files changed, 128 insertions(+), 38 deletions(-)
diffs (truncated from 703 to 300 lines):
diff -r 17d42b31eb7d -r 3ac050f14e73 sys/dev/raidframe/rf_acctrace.c
--- a/sys/dev/raidframe/rf_acctrace.c Mon Mar 01 23:30:01 2004 +0000
+++ b/sys/dev/raidframe/rf_acctrace.c Mon Mar 01 23:30:57 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_acctrace.c,v 1.18 2004/02/29 23:10:58 oster Exp $ */
+/* $NetBSD: rf_acctrace.c,v 1.19 2004/03/01 23:30:57 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -34,7 +34,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.18 2004/02/29 23:10:58 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_acctrace.c,v 1.19 2004/03/01 23:30:57 oster Exp $");
#include <sys/stat.h>
#include <sys/types.h>
@@ -51,16 +51,13 @@
#if RF_ACC_TRACE > 0
static long numTracesSoFar;
-#endif
RF_DECLARE_MUTEX(rf_tracing_mutex)
int
rf_ConfigureAccessTrace(RF_ShutdownList_t **listp)
{
-#if RF_ACC_TRACE > 0
numTracesSoFar = 0;
-#endif
rf_mutex_init(&rf_tracing_mutex);
return (0);
}
@@ -71,7 +68,6 @@
void
rf_LogTraceRec(RF_Raid_t *raid, RF_AccTraceEntry_t *rec)
{
-#if RF_ACC_TRACE > 0
RF_AccTotals_t *acc = &raid->acc_totals;
if (((rf_maxNumTraces >= 0) && (numTracesSoFar >= rf_maxNumTraces)))
@@ -115,6 +111,6 @@
acc->phys_io_us = rec->phys_io_us;
acc->user_reccount++;
}
+}
#endif /* RF_ACC_TRACE > 0 */
-}
diff -r 17d42b31eb7d -r 3ac050f14e73 sys/dev/raidframe/rf_dag.h
--- a/sys/dev/raidframe/rf_dag.h Mon Mar 01 23:30:01 2004 +0000
+++ b/sys/dev/raidframe/rf_dag.h Mon Mar 01 23:30:57 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_dag.h,v 1.8 2004/02/27 02:55:17 oster Exp $ */
+/* $NetBSD: rf_dag.h,v 1.9 2004/03/01 23:30:58 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -166,8 +166,9 @@
* to be freed */
int nodeNum; /* used by PrintDAG for debug only */
int numNodesCompleted;
+#if RF_ACC_TRACE > 0
RF_AccTraceEntry_t *tracerec; /* perf mon only */
-
+#endif
void (*cbFunc) (void *); /* function to call when the dag
* completes */
void *cbArg; /* argument for cbFunc */
diff -r 17d42b31eb7d -r 3ac050f14e73 sys/dev/raidframe/rf_dagfuncs.c
--- a/sys/dev/raidframe/rf_dagfuncs.c Mon Mar 01 23:30:01 2004 +0000
+++ b/sys/dev/raidframe/rf_dagfuncs.c Mon Mar 01 23:30:57 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_dagfuncs.c,v 1.18 2004/01/10 17:04:44 oster Exp $ */
+/* $NetBSD: rf_dagfuncs.c,v 1.19 2004/03/01 23:30:58 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.18 2004/01/10 17:04:44 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagfuncs.c,v 1.19 2004/03/01 23:30:58 oster Exp $");
#include <sys/param.h>
#include <sys/ioctl.h>
@@ -174,11 +174,15 @@
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
caddr_t buf = (caddr_t) node->params[1].p;
RF_ParityLogData_t *logData;
+#if RF_ACC_TRACE > 0
RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
RF_Etimer_t timer;
+#endif
if (node->dagHdr->status == rf_enable) {
+#if RF_ACC_TRACE > 0
RF_ETIMER_START(timer);
+#endif
logData = rf_CreateParityLogData(RF_UPDATE, pda, buf,
(RF_Raid_t *) (node->dagHdr->raidPtr),
node->wakeFunc, (void *) node,
@@ -186,9 +190,11 @@
if (logData)
rf_ParityLogAppend(logData, RF_FALSE, NULL, RF_FALSE);
else {
+#if RF_ACC_TRACE > 0
RF_ETIMER_STOP(timer);
RF_ETIMER_EVAL(timer);
tracerec->plog_us += RF_ETIMER_VAL_US(timer);
+#endif
(node->wakeFunc) (node, ENOMEM);
}
}
@@ -205,20 +211,26 @@
RF_PhysDiskAddr_t *pda = (RF_PhysDiskAddr_t *) node->params[0].p;
caddr_t buf = (caddr_t) node->params[1].p;
RF_ParityLogData_t *logData;
+#if RF_ACC_TRACE > 0
RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
RF_Etimer_t timer;
+#endif
if (node->dagHdr->status == rf_enable) {
+#if RF_ACC_TRACE > 0
RF_ETIMER_START(timer);
+#endif
logData = rf_CreateParityLogData(RF_OVERWRITE, pda, buf,
(RF_Raid_t *) (node->dagHdr->raidPtr),
node->wakeFunc, (void *) node, node->dagHdr->tracerec, timer);
if (logData)
rf_ParityLogAppend(logData, RF_FALSE, NULL, RF_FALSE);
else {
+#if RF_ACC_TRACE > 0
RF_ETIMER_STOP(timer);
RF_ETIMER_EVAL(timer);
tracerec->plog_us += RF_ETIMER_VAL_US(timer);
+#endif
(node->wakeFunc) (node, ENOMEM);
}
}
@@ -278,7 +290,12 @@
req = rf_CreateDiskQueueData(iotype, pda->startSector, pda->numSector,
buf, parityStripeID, which_ru,
(int (*) (void *, int)) node->wakeFunc,
- node, NULL, node->dagHdr->tracerec,
+ node, NULL,
+#if RF_ACC_TRACE > 0
+ node->dagHdr->tracerec,
+#else
+ NULL,
+#endif
(void *) (node->dagHdr->raidPtr), 0, b_proc);
if (!req) {
(node->wakeFunc) (node, ENOMEM);
@@ -314,7 +331,11 @@
buf, parityStripeID, which_ru,
(int (*) (void *, int)) node->wakeFunc,
(void *) node, NULL,
+#if RF_ACC_TRACE > 0
node->dagHdr->tracerec,
+#else
+ NULL,
+#endif
(void *) (node->dagHdr->raidPtr),
0, b_proc);
@@ -343,7 +364,12 @@
0L, 0, NULL, 0L, 0,
(int (*) (void *, int)) node->wakeFunc,
(void *) node,
- NULL, node->dagHdr->tracerec,
+ NULL,
+#if RF_ACC_TRACE > 0
+ node->dagHdr->tracerec,
+#else
+ NULL,
+#endif
(void *) (node->dagHdr->raidPtr),
RF_UNLOCK_DISK_QUEUE, NULL);
if (!req)
@@ -369,7 +395,12 @@
0L, 0, NULL, 0L, 0,
(int (*) (void *, int)) node->wakeFunc,
(void *) node,
- NULL, node->dagHdr->tracerec,
+ NULL,
+#if RF_ACC_TRACE > 0
+ node->dagHdr->tracerec,
+#else
+ NULL,
+#endif
(void *) (node->dagHdr->raidPtr),
RF_UNLOCK_DISK_QUEUE, NULL);
if (!req)
@@ -451,22 +482,28 @@
rf_RegularXorFunc(RF_DagNode_t *node)
{
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
+#if RF_ACC_TRACE > 0
RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
RF_Etimer_t timer;
+#endif
int i, retcode;
retcode = 0;
if (node->dagHdr->status == rf_enable) {
/* don't do the XOR if the input is the same as the output */
+#if RF_ACC_TRACE > 0
RF_ETIMER_START(timer);
+#endif
for (i = 0; i < node->numParams - 1; i += 2)
if (node->params[i + 1].p != node->results[0]) {
retcode = rf_XorIntoBuffer(raidPtr, (RF_PhysDiskAddr_t *) node->params[i].p,
(char *) node->params[i + 1].p, (char *) node->results[0]);
}
+#if RF_ACC_TRACE > 0
RF_ETIMER_STOP(timer);
RF_ETIMER_EVAL(timer);
tracerec->xor_us += RF_ETIMER_VAL_US(timer);
+#endif
}
return (rf_GenericWakeupFunc(node, retcode)); /* call wake func
* explicitly since no
@@ -478,20 +515,26 @@
{
RF_Raid_t *raidPtr = (RF_Raid_t *) node->params[node->numParams - 1].p;
int i, retcode = 0;
+#if RF_ACC_TRACE > 0
RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
RF_Etimer_t timer;
+#endif
if (node->dagHdr->status == rf_enable) {
+#if RF_ACC_TRACE > 0
RF_ETIMER_START(timer);
+#endif
/* don't do the XOR if the input is the same as the output */
for (i = 0; i < node->numParams - 1; i += 2)
if (node->params[i + 1].p != node->results[0]) {
retcode = rf_bxor((char *) node->params[i + 1].p, (char *) node->results[0],
rf_RaidAddressToByte(raidPtr, ((RF_PhysDiskAddr_t *) node->params[i].p)->numSector));
}
+#if RF_ACC_TRACE > 0
RF_ETIMER_STOP(timer);
RF_ETIMER_EVAL(timer);
tracerec->xor_us += RF_ETIMER_VAL_US(timer);
+#endif
}
return (rf_GenericWakeupFunc(node, retcode)); /* call wake func
* explicitly since no
@@ -514,11 +557,15 @@
RF_PhysDiskAddr_t *pda;
int suoffset, failedSUOffset = rf_StripeUnitOffset(layoutPtr, failedPDA->startSector);
char *srcbuf, *destbuf;
+#if RF_ACC_TRACE > 0
RF_AccTraceEntry_t *tracerec = node->dagHdr->tracerec;
RF_Etimer_t timer;
+#endif
if (node->dagHdr->status == rf_enable) {
+#if RF_ACC_TRACE > 0
RF_ETIMER_START(timer);
+#endif
for (i = 0; i < node->numParams - 2; i += 2)
if (node->params[i + 1].p != node->results[0]) {
pda = (RF_PhysDiskAddr_t *) node->params[i].p;
@@ -527,9 +574,11 @@
destbuf = ((char *) node->results[0]) + rf_RaidAddressToByte(raidPtr, suoffset - failedSUOffset);
retcode = rf_bxor(srcbuf, destbuf, rf_RaidAddressToByte(raidPtr, pda->numSector));
}
+#if RF_ACC_TRACE > 0
RF_ETIMER_STOP(timer);
RF_ETIMER_EVAL(timer);
tracerec->xor_us += RF_ETIMER_VAL_US(timer);
+#endif
}
return (rf_GenericWakeupFunc(node, retcode));
}
diff -r 17d42b31eb7d -r 3ac050f14e73 sys/dev/raidframe/rf_driver.c
--- a/sys/dev/raidframe/rf_driver.c Mon Mar 01 23:30:01 2004 +0000
+++ b/sys/dev/raidframe/rf_driver.c Mon Mar 01 23:30:57 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_driver.c,v 1.86 2004/02/29 04:03:50 oster Exp $ */
+/* $NetBSD: rf_driver.c,v 1.87 2004/03/01 23:30:58 oster Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -73,7 +73,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.86 2004/02/29 04:03:50 oster Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_driver.c,v 1.87 2004/03/01 23:30:58 oster Exp $");
#include "opt_raid_diagnostic.h"
Home |
Main Index |
Thread Index |
Old Index