[commit: ghc] master: rts_apply uses CCS_MAIN rather than CCS_SYSTEM (#7753) (773365f)

git at git.haskell.org git at git.haskell.org
Sat Nov 2 20:58:39 UTC 2013


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/773365f91ff141ad38e929844c901ecd5465a000/ghc

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

commit 773365f91ff141ad38e929844c901ecd5465a000
Author: Takano Akio <aljee at hyper.cx>
Date:   Tue Oct 1 07:40:35 2013 +0900

    rts_apply uses CCS_MAIN rather than CCS_SYSTEM (#7753)
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


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

773365f91ff141ad38e929844c901ecd5465a000
 rts/RtsAPI.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rts/RtsAPI.c b/rts/RtsAPI.c
index 720b732..baa9934 100644
--- a/rts/RtsAPI.c
+++ b/rts/RtsAPI.c
@@ -198,7 +198,12 @@ rts_apply (Capability *cap, HaskellObj f, HaskellObj arg)
     StgThunk *ap;
 
     ap = (StgThunk *)allocate(cap,sizeofW(StgThunk) + 2);
-    SET_HDR(ap, (StgInfoTable *)&stg_ap_2_upd_info, CCS_SYSTEM);
+#ifdef PROFILING
+    // Here we don't want to use CCS_SYSTEM, because it's a hidden cost centre,
+    // and evaluating Haskell code under a hidden cost centre leads to
+    // confusing profiling output. (#7753)
+#endif
+    SET_HDR(ap, (StgInfoTable *)&stg_ap_2_upd_info, CCS_MAIN);
     ap->payload[0] = f;
     ap->payload[1] = arg;
     return (StgClosure *)ap;



More information about the ghc-commits mailing list