[commit: ghc] ghc-8.0: rts/Timer: Actually fix #9105 (7d123cc)

git at git.haskell.org git at git.haskell.org
Wed Jan 27 12:06:02 UTC 2016


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

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/7d123cc87ba69d96f4e32921549201537abe118b/ghc

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

commit 7d123cc87ba69d96f4e32921549201537abe118b
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
    
    (cherry picked from commit 1c6130d91420dc835c281bc9b13d603b7aa49b59)


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

7d123cc87ba69d96f4e32921549201537abe118b
 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