Commit da12da79 authored by Daniel Gröber (dxld)'s avatar Daniel Gröber (dxld)

rts: retainer: Remove cStackSize debug counter

This can only ever be one since 5f1d949a ("Remove explicit recursion in
retainer profiling"), so it's pointless.
parent fa66e3e5
...@@ -102,15 +102,6 @@ static uint32_t checkHeapSanityForRetainerProfiling( void ); ...@@ -102,15 +102,6 @@ static uint32_t checkHeapSanityForRetainerProfiling( void );
static void retainPushClosure( StgClosure *p, StgClosure *c, retainer c_child_r); static void retainPushClosure( StgClosure *p, StgClosure *c, retainer c_child_r);
#if defined(DEBUG_RETAINER) #if defined(DEBUG_RETAINER)
/*
cStackSize records how many times retainStack() has been invoked recursively,
that is, the number of activation records for retainStack() on the C stack.
maxCStackSize records its max value.
Invariants:
cStackSize <= maxCStackSize
*/
static uint32_t cStackSize, maxCStackSize;
static uint32_t sumOfNewCost; // sum of the cost of each object, computed static uint32_t sumOfNewCost; // sum of the cost of each object, computed
// when the object is first visited // when the object is first visited
static uint32_t sumOfNewCostExtra; // for those objects not visited during static uint32_t sumOfNewCostExtra; // for those objects not visited during
...@@ -225,7 +216,7 @@ static stackElement *currentStackBoundary; ...@@ -225,7 +216,7 @@ static stackElement *currentStackBoundary;
stackSize is just an estimate measure of the depth of the graph. The reason stackSize is just an estimate measure of the depth of the graph. The reason
is that some heap objects have only a single child and may not result is that some heap objects have only a single child and may not result
in a new element being pushed onto the stack. Therefore, at the end of in a new element being pushed onto the stack. Therefore, at the end of
retainer profiling, maxStackSize + maxCStackSize is some value no greater retainer profiling, maxStackSize is some value no greater
than the actual depth of the graph. than the actual depth of the graph.
*/ */
static int stackSize, maxStackSize; static int stackSize, maxStackSize;
...@@ -1244,11 +1235,6 @@ retainStack( StgClosure *c, retainer c_child_r, ...@@ -1244,11 +1235,6 @@ retainStack( StgClosure *c, retainer c_child_r,
StgWord bitmap; StgWord bitmap;
uint32_t size; uint32_t size;
#if defined(DEBUG_RETAINER)
cStackSize++;
if (cStackSize > maxCStackSize) maxCStackSize = cStackSize;
#endif
/* /*
Each invocation of retainStack() creates a new virtual Each invocation of retainStack() creates a new virtual
stack. Since all such stacks share a single common stack, we stack. Since all such stacks share a single common stack, we
...@@ -1358,10 +1344,6 @@ retainStack( StgClosure *c, retainer c_child_r, ...@@ -1358,10 +1344,6 @@ retainStack( StgClosure *c, retainer c_child_r,
debugBelch("retainStack() finished: currentStackBoundary = 0x%x\n", debugBelch("retainStack() finished: currentStackBoundary = 0x%x\n",
currentStackBoundary); currentStackBoundary);
#endif #endif
#if defined(DEBUG_RETAINER)
cStackSize--;
#endif
} }
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
...@@ -1943,8 +1925,6 @@ retainerProfile(void) ...@@ -1943,8 +1925,6 @@ retainerProfile(void)
#if defined(DEBUG_RETAINER) #if defined(DEBUG_RETAINER)
stackSize = 0; stackSize = 0;
maxStackSize = 0; maxStackSize = 0;
cStackSize = 0;
maxCStackSize = 0;
#endif #endif
numObjectVisited = 0; numObjectVisited = 0;
timesAnyObjectVisited = 0; timesAnyObjectVisited = 0;
...@@ -2022,7 +2002,7 @@ retainerProfile(void) ...@@ -2022,7 +2002,7 @@ retainerProfile(void)
stat_endRP( stat_endRP(
retainerGeneration - 1, // retainerGeneration has just been incremented! retainerGeneration - 1, // retainerGeneration has just been incremented!
#if defined(DEBUG_RETAINER) #if defined(DEBUG_RETAINER)
maxCStackSize, maxStackSize, maxStackSize,
#endif #endif
(double)timesAnyObjectVisited / numObjectVisited); (double)timesAnyObjectVisited / numObjectVisited);
} }
......
...@@ -516,7 +516,6 @@ void ...@@ -516,7 +516,6 @@ void
stat_endRP( stat_endRP(
uint32_t retainerGeneration, uint32_t retainerGeneration,
#if defined(DEBUG_RETAINER) #if defined(DEBUG_RETAINER)
uint32_t maxCStackSize,
int maxStackSize, int maxStackSize,
#endif #endif
double averageNumVisit) double averageNumVisit)
...@@ -530,7 +529,6 @@ stat_endRP( ...@@ -530,7 +529,6 @@ stat_endRP(
fprintf(prof_file, "Retainer Profiling: %d, at %f seconds\n", fprintf(prof_file, "Retainer Profiling: %d, at %f seconds\n",
retainerGeneration, mut_user_time_during_RP()); retainerGeneration, mut_user_time_during_RP());
#if defined(DEBUG_RETAINER) #if defined(DEBUG_RETAINER)
fprintf(prof_file, "\tMax C stack size = %u\n", maxCStackSize);
fprintf(prof_file, "\tMax auxiliary stack size = %u\n", maxStackSize); fprintf(prof_file, "\tMax auxiliary stack size = %u\n", maxStackSize);
#endif #endif
fprintf(prof_file, "\tAverage number of visits per object = %f\n", fprintf(prof_file, "\tAverage number of visits per object = %f\n",
......
...@@ -41,9 +41,9 @@ void stat_endGC (Capability *cap, struct gc_thread_ *_gct, W_ live, ...@@ -41,9 +41,9 @@ void stat_endGC (Capability *cap, struct gc_thread_ *_gct, W_ live,
void stat_startRP(void); void stat_startRP(void);
void stat_endRP(uint32_t, void stat_endRP(uint32_t,
#if defined(DEBUG_RETAINER) #if defined(DEBUG_RETAINER)
uint32_t, int, int,
#endif #endif
double); double);
#endif /* PROFILING */ #endif /* PROFILING */
#if defined(PROFILING) || defined(DEBUG) #if defined(PROFILING) || defined(DEBUG)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment