rts_apply uses CCS_MAIN rather than CCS_SYSTEM (#7753)
authorTakano Akio <aljee@hyper.cx>
Mon, 30 Sep 2013 22:40:35 +0000 (07:40 +0900)
committerAustin Seipp <austin@well-typed.com>
Sat, 2 Nov 2013 20:58:07 +0000 (15:58 -0500)
Signed-off-by: Austin Seipp <austin@well-typed.com>
rts/RtsAPI.c

index 720b732..baa9934 100644 (file)
@@ -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;