[eros-cvs] cvs commit: eros/src/base/sys/kernel kern_ObjectCache.cxx
shap@eros.cs.jhu.edu
shap@eros.cs.jhu.edu
Mon, 2 Jul 2001 23:54:08 -0400
shap 01/07/02 23:54:08
Modified: src/base/sys/kernel kern_ObjectCache.cxx
Log:
Verbose search (optional) for debugging
Revision Changes Path
1.125 +35 -2 eros/src/base/sys/kernel/kern_ObjectCache.cxx
Index: kern_ObjectCache.cxx
===================================================================
RCS file: /cvs/eros/src/base/sys/kernel/kern_ObjectCache.cxx,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -r1.124 -r1.125
--- kern_ObjectCache.cxx 2001/06/19 15:34:58 1.124
+++ kern_ObjectCache.cxx 2001/07/03 03:54:08 1.125
@@ -45,6 +45,7 @@
#define dbg_ndalloc 0x8 /* node allocation */
#define dbg_pgalloc 0x10 /* page allocation */
#define dbg_obsrc 0x20 /* addition of object sources */
+#define dbg_findfirst 0x40 /* finding first subrange */
/* Following should be an OR of some of the above */
#define dbg_flags ( 0u )
@@ -1402,19 +1403,51 @@
subStart = ~0llu; /* until proven otherwise */
subEnd = ~0llu;
+ DEBUG(findfirst)
+ MsgLog::printf("ObCache::FindFirstSubrange(): limStart 0x%08x%08x, "
+ "limEnd 0x%08x%08x nSource %d\n",
+ (unsigned long) (limStart >> 32),
+ (unsigned long) (limStart),
+ (unsigned long) (limEnd >> 32),
+ (unsigned long) (limEnd),
+ nSource);
+
/* ObjectSources (ignoring the object cache) implement disjoint
* ranges, but they do not necessarily implement fully populated
* ranges.
*/
for (unsigned i = 1; i < nSource; i++) {
/* Check if the requested range and the source overlap: */
- if (sources[i]->end < limStart || sources[i]->start >= limEnd)
+ if (sources[i]->end <= limStart) {
+ DEBUG(findfirst)
+ MsgLog::printf("Reject %d: end 0x%08x%08x <= limStart\n",
+ i,
+ (unsigned long) (sources[i]->end >> 32),
+ (unsigned long) (sources[i]->end));
+ continue;
+ }
+
+ if (sources[i]->start >= limEnd) {
+ DEBUG(findfirst)
+ MsgLog::printf("Reject %d: start 0x%08x%08x >= limStart\n",
+ i,
+ (unsigned long) (sources[i]->start >> 32),
+ (unsigned long) (sources[i]->start));
continue;
+ }
/* If so, and if the answer could possibly be better than what we
* already have, ask the source: */
- if (sources[i]->start < subStart)
+ if (sources[i]->start < subStart) {
+ DEBUG(findfirst)
+ MsgLog::printf("Consulting source %d for [0x%08x%08x, 0x%08x%08x)\n",
+ i,
+ (unsigned long) (sources[i]->start >> 32),
+ (unsigned long) (sources[i]->start),
+ (unsigned long) (sources[i]->end >> 32),
+ (unsigned long) (sources[i]->end));
sources[i]->FindFirstSubrange(limStart, limEnd, subStart, subEnd);
+ }
}
}