summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2019-06-06 09:28:47 +0200
committerDaniel Gröber <dxld@darkboxed.org>2019-09-22 14:34:56 +0200
commitda12da7945ae59d5132506829612e57db58bbf83 (patch)
tree4539e045d5b084c145afb0c72dc6ed98f624ff35
parentfa66e3e5a3a34d1b84c4883d374644079e2ed61f (diff)
downloadhaskell-da12da7945ae59d5132506829612e57db58bbf83.tar.gz
rts: retainer: Remove cStackSize debug counter
This can only ever be one since 5f1d949ab9 ("Remove explicit recursion in retainer profiling"), so it's pointless.
-rw-r--r--rts/RetainerProfile.c24
-rw-r--r--rts/Stats.c2
-rw-r--r--rts/Stats.h4
3 files changed, 4 insertions, 26 deletions
diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c
index 360db37a19..79aade9c44 100644
--- a/rts/RetainerProfile.c
+++ b/rts/RetainerProfile.c
@@ -102,15 +102,6 @@ static uint32_t checkHeapSanityForRetainerProfiling( void );
static void retainPushClosure( StgClosure *p, StgClosure *c, retainer c_child_r);
#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
// when the object is first visited
static uint32_t sumOfNewCostExtra; // for those objects not visited during
@@ -225,7 +216,7 @@ static stackElement *currentStackBoundary;
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
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.
*/
static int stackSize, maxStackSize;
@@ -1244,11 +1235,6 @@ retainStack( StgClosure *c, retainer c_child_r,
StgWord bitmap;
uint32_t size;
-#if defined(DEBUG_RETAINER)
- cStackSize++;
- if (cStackSize > maxCStackSize) maxCStackSize = cStackSize;
-#endif
-
/*
Each invocation of retainStack() creates a new virtual
stack. Since all such stacks share a single common stack, we
@@ -1358,10 +1344,6 @@ retainStack( StgClosure *c, retainer c_child_r,
debugBelch("retainStack() finished: currentStackBoundary = 0x%x\n",
currentStackBoundary);
#endif
-
-#if defined(DEBUG_RETAINER)
- cStackSize--;
-#endif
}
/* ----------------------------------------------------------------------------
@@ -1943,8 +1925,6 @@ retainerProfile(void)
#if defined(DEBUG_RETAINER)
stackSize = 0;
maxStackSize = 0;
- cStackSize = 0;
- maxCStackSize = 0;
#endif
numObjectVisited = 0;
timesAnyObjectVisited = 0;
@@ -2022,7 +2002,7 @@ retainerProfile(void)
stat_endRP(
retainerGeneration - 1, // retainerGeneration has just been incremented!
#if defined(DEBUG_RETAINER)
- maxCStackSize, maxStackSize,
+ maxStackSize,
#endif
(double)timesAnyObjectVisited / numObjectVisited);
}
diff --git a/rts/Stats.c b/rts/Stats.c
index 264e1c7877..b3730c611e 100644
--- a/rts/Stats.c
+++ b/rts/Stats.c
@@ -516,7 +516,6 @@ void
stat_endRP(
uint32_t retainerGeneration,
#if defined(DEBUG_RETAINER)
- uint32_t maxCStackSize,
int maxStackSize,
#endif
double averageNumVisit)
@@ -530,7 +529,6 @@ stat_endRP(
fprintf(prof_file, "Retainer Profiling: %d, at %f seconds\n",
retainerGeneration, mut_user_time_during_RP());
#if defined(DEBUG_RETAINER)
- fprintf(prof_file, "\tMax C stack size = %u\n", maxCStackSize);
fprintf(prof_file, "\tMax auxiliary stack size = %u\n", maxStackSize);
#endif
fprintf(prof_file, "\tAverage number of visits per object = %f\n",
diff --git a/rts/Stats.h b/rts/Stats.h
index ed2479863a..73bed2273d 100644
--- a/rts/Stats.h
+++ b/rts/Stats.h
@@ -41,9 +41,9 @@ void stat_endGC (Capability *cap, struct gc_thread_ *_gct, W_ live,
void stat_startRP(void);
void stat_endRP(uint32_t,
#if defined(DEBUG_RETAINER)
- uint32_t, int,
+ int,
#endif
- double);
+ double);
#endif /* PROFILING */
#if defined(PROFILING) || defined(DEBUG)