summaryrefslogtreecommitdiff
path: root/rts/Proftimer.c
diff options
context:
space:
mode:
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) {