summaryrefslogtreecommitdiff
path: root/rts/Proftimer.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-13 21:12:53 -0400
committerBen Gamari <ben@smart-cactus.org>2020-11-21 13:13:29 -0500
commit7e93ae8b2257c17d5ae5ef7832db723e897c8e8b (patch)
tree89e8f5af3d57e78177da45d13a3037912ad9eb7d /rts/Proftimer.c
parent69bfbc216c2278c9796aa999c7815c19c12b0f2c (diff)
downloadhaskell-7e93ae8b2257c17d5ae5ef7832db723e897c8e8b.tar.gz
rts: Post ticky entry counts to the eventlog
We currently only post the entry counters, not the other global counters as in my experience the former are more useful. We use the heap profiler's census period to decide when to dump. Also spruces up the documentation surrounding ticky-ticky a bit.
Diffstat (limited to 'rts/Proftimer.c')
-rw-r--r--rts/Proftimer.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/rts/Proftimer.c b/rts/Proftimer.c
index 24f82ead6d..00b92a227d 100644
--- a/rts/Proftimer.c
+++ b/rts/Proftimer.c
@@ -20,6 +20,12 @@ static bool do_prof_ticks = false; // enable profiling ticks
static bool do_heap_prof_ticks = false; // enable heap profiling ticks
+// Sampling of Ticky-Ticky profiler to eventlog
+#if defined(TICKY_TICKY) && defined(TRACING)
+static int ticks_to_ticky_sample = 0;
+bool performTickySample = false;
+#endif
+
// Number of ticks until next heap census
static int ticks_to_heap_profile;
@@ -83,6 +89,16 @@ handleProfTick(void)
}
#endif
+#if defined(TICKY_TICKY) && defined(TRACING)
+ if (RtsFlags.TraceFlags.ticky) {
+ ticks_to_ticky_sample--;
+ if (ticks_to_ticky_sample <= 0) {
+ ticks_to_ticky_sample = RtsFlags.ProfFlags.heapProfileIntervalTicks;
+ performTickySample = true;
+ }
+ }
+#endif
+
if (RELAXED_LOAD(&do_heap_prof_ticks)) {
ticks_to_heap_profile--;
if (ticks_to_heap_profile <= 0) {