Release console for ghci wrapper
[ghc.git] / rts / Timer.c
index 2a229a4..8e2fb4a 100644 (file)
@@ -65,16 +65,23 @@ handle_tick(int unused STG_UNUSED)
       if (ticks_to_gc == 0) {
           if (RtsFlags.GcFlags.doIdleGC) {
               recent_activity = ACTIVITY_INACTIVE;
-#ifdef THREADED_RTS
+#if defined(THREADED_RTS)
               wakeUpRts();
               // The scheduler will call stopTimer() when it has done
               // the GC.
 #endif
           } else {
               recent_activity = ACTIVITY_DONE_GC;
-              // disable timer signals (see #1623, #5991)
-              // but only if we're not profiling
-#ifndef PROFILING
+              // disable timer signals (see #1623, #5991, #9105)
+              // but only if we're not profiling (e.g. passed -h or -p RTS
+              // flags). If we are profiling we need to keep the timer active
+              // so that samples continue to be collected.
+#if defined(PROFILING)
+              if (!(RtsFlags.ProfFlags.doHeapProfile
+                    || RtsFlags.CcFlags.doCostCentres)) {
+                  stopTimer();
+              }
+#else
               stopTimer();
 #endif
           }
@@ -127,17 +134,9 @@ stopTimer(void)
 }
 
 void
-exitTimer (rtsBool wait)
+exitTimer (bool wait)
 {
     if (RtsFlags.MiscFlags.tickInterval != 0) {
         exitTicker(wait);
     }
 }
-
-// Local Variables:
-// mode: C
-// fill-column: 80
-// indent-tabs-mode: nil
-// c-basic-offset: 4
-// buffer-file-coding-system: utf-8-unix
-// End: