[commit: ghc] master: rts/Timer: Actually fix #9105 (1c6130d)

git at git.haskell.org git at git.haskell.org
Wed Jan 27 10:30:58 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/1c6130d91420dc835c281bc9b13d603b7aa49b59/ghc

>---------------------------------------------------------------

commit 1c6130d91420dc835c281bc9b13d603b7aa49b59
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Wed Jan 27 11:05:23 2016 +0100

    rts/Timer: Actually fix #9105
    
    jberthold astutely pointed out that the previous fix (D1822) could not
    have possibly fixed the issue as the patch would only have had any
    effect if !PROFILING.
    
    Test Plan: Check for reduced CPU usage when compiled with `-prof` but
    without `+RTS -p`
    
    Reviewers: simonmar, austin, jberthold
    
    Reviewed By: simonmar, jberthold
    
    Subscribers: simonmar, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1844
    
    GHC Trac Issues: #9105


>---------------------------------------------------------------

1c6130d91420dc835c281bc9b13d603b7aa49b59
 rts/Timer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/rts/Timer.c b/rts/Timer.c
index bf7240b..9136c60 100644
--- a/rts/Timer.c
+++ b/rts/Timer.c
@@ -76,11 +76,13 @@ handle_tick(int unused STG_UNUSED)
               // 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.
-#ifndef PROFILING
+#ifdef PROFILING
               if (!(RtsFlags.ProfFlags.doHeapProfile
                     || RtsFlags.CcFlags.doCostCentres)) {
                   stopTimer();
               }
+#else
+              stopTimer();
 #endif
           }
       } else {



More information about the ghc-commits mailing list