[Git][ghc/ghc][wip/con-info] 3 commits: Add missing case for unboxed sum
Matthew Pickering
gitlab at gitlab.haskell.org
Wed Nov 4 16:29:03 UTC 2020
Matthew Pickering pushed to branch wip/con-info at Glasgow Haskell Compiler / GHC
Commits:
4f0b7a39 by Matthew Pickering at 2020-11-04T10:44:56+00:00
Add missing case for unboxed sum
- - - - -
2dcc8657 by Matthew Pickering at 2020-11-04T10:45:09+00:00
move traceIPE out of profiling block
- - - - -
395abf45 by Matthew Pickering at 2020-11-04T16:28:50+00:00
Move postIPE
- - - - -
5 changed files:
- compiler/GHC/CoreToStg.hs
- rts/IPE.c
- rts/Trace.c
- rts/eventlog/EventLog.c
- rts/eventlog/EventLog.h
Changes:
=====================================
compiler/GHC/CoreToStg.hs
=====================================
@@ -925,6 +925,7 @@ lookupBinding env v = case lookupVarEnv env v of
incDc :: DataCon -> CtsM (Maybe Int)
incDc dc | isUnboxedTupleDataCon dc = return Nothing
+incDc dc | isUnboxedSumDataCon dc = return Nothing
incDc dc = CtsM $ \dflags _ -> if not (gopt Opt_DistinctConstructorTables dflags) then return Nothing else do
env <- get
cc <- ask
=====================================
rts/IPE.c
=====================================
@@ -15,25 +15,31 @@
#include "Arena.h"
#include "Printer.h"
#include "Capability.h"
-#include "Trace.h"
#include <fs_rts.h>
#include <string.h>
+#if defined(TRACING)
+#include "Trace.h"
+#endif
+
InfoProvEnt *IPE_LIST = NULL;
void
dumpIPEToEventLog(void)
{
+#if defined(TRACING)
InfoProvEnt *ip, *next;
for (ip = IPE_LIST; ip != NULL; ip = next) {
next = ip->link;
traceIPE(ip->info, ip->prov.table_name, ip->prov.closure_desc, ip->prov.label,
ip->prov.module, ip->prov.srcloc);
}
+#endif
}
+
/* -----------------------------------------------------------------------------
Registering IPEs
=====================================
rts/Trace.c
=====================================
@@ -638,6 +638,18 @@ void traceHeapProfSampleString(StgWord8 profile_id,
}
}
+void traceIPE(StgInfoTable * info,
+ const char *table_name,
+ const char *closure_desc,
+ const char *label,
+ const char *module,
+ const char *srcloc )
+{
+ if (eventlog_enabled) {
+ postIPE(INFO_PTR_TO_STRUCT(info), table_name, closure_desc, label, module, srcloc);
+ }
+}
+
#if defined(PROFILING)
void traceHeapProfCostCentre(StgWord32 ccID,
const char *label,
@@ -650,17 +662,6 @@ void traceHeapProfCostCentre(StgWord32 ccID,
}
}
-void traceIPE(StgInfoTable * info,
- const char *table_name,
- const char *closure_desc,
- const char *label,
- const char *module,
- const char *srcloc )
-{
- if (eventlog_enabled) {
- postIPE(INFO_PTR_TO_STRUCT(info), table_name, closure_desc, label, module, srcloc);
- }
-}
// This one is for .hp samples
void traceHeapProfSampleCostCentre(StgWord8 profile_id,
=====================================
rts/eventlog/EventLog.c
=====================================
@@ -1413,31 +1413,6 @@ void postHeapProfCostCentre(StgWord32 ccID,
postWord8(&eventBuf, is_caf);
RELEASE_LOCK(&eventBufMutex);
}
-void postIPE(StgWord64 info,
- const char *table_name,
- const char *closure_desc,
- const char *label,
- const char *module,
- const char *srcloc)
-{
- ACQUIRE_LOCK(&eventBufMutex);
- StgWord table_name_len = strlen(table_name);
- StgWord closure_desc_len = strlen(closure_desc);
- StgWord label_len = strlen(label);
- StgWord module_len = strlen(module);
- StgWord srcloc_len = strlen(srcloc);
- StgWord len = 8+table_name_len+closure_desc_len+label_len+module_len+srcloc_len+3;
- ensureRoomForVariableEvent(&eventBuf, len);
- postEventHeader(&eventBuf, EVENT_IPE);
- postPayloadSize(&eventBuf, len);
- postWord64(&eventBuf, info);
- postString(&eventBuf, table_name);
- postString(&eventBuf, closure_desc);
- postString(&eventBuf, label);
- postString(&eventBuf, module);
- postString(&eventBuf, srcloc);
- RELEASE_LOCK(&eventBufMutex);
-}
void postHeapProfSampleCostCentre(StgWord8 profile_id,
CostCentreStack *stack,
@@ -1503,6 +1478,32 @@ void postProfBegin(void)
}
#endif /* PROFILING */
+void postIPE(StgWord64 info,
+ const char *table_name,
+ const char *closure_desc,
+ const char *label,
+ const char *module,
+ const char *srcloc)
+{
+ ACQUIRE_LOCK(&eventBufMutex);
+ StgWord table_name_len = strlen(table_name);
+ StgWord closure_desc_len = strlen(closure_desc);
+ StgWord label_len = strlen(label);
+ StgWord module_len = strlen(module);
+ StgWord srcloc_len = strlen(srcloc);
+ StgWord len = 8+table_name_len+closure_desc_len+label_len+module_len+srcloc_len+3;
+ ensureRoomForVariableEvent(&eventBuf, len);
+ postEventHeader(&eventBuf, EVENT_IPE);
+ postPayloadSize(&eventBuf, len);
+ postWord64(&eventBuf, info);
+ postString(&eventBuf, table_name);
+ postString(&eventBuf, closure_desc);
+ postString(&eventBuf, label);
+ postString(&eventBuf, module);
+ postString(&eventBuf, srcloc);
+ RELEASE_LOCK(&eventBufMutex);
+}
+
void printAndClearEventBuf (EventsBuf *ebuf)
{
closeBlockMarker(ebuf);
=====================================
rts/eventlog/EventLog.h
=====================================
@@ -157,12 +157,6 @@ void postHeapProfCostCentre(StgWord32 ccID,
const char *module,
const char *srcloc,
StgBool is_caf);
-void postIPE(StgWord64 info,
- const char *table_name,
- const char *closure_desc,
- const char *label,
- const char *module,
- const char *srcloc);
void postHeapProfSampleCostCentre(StgWord8 profile_id,
CostCentreStack *stack,
@@ -174,6 +168,13 @@ void postProfSampleCostCentre(Capability *cap,
void postProfBegin(void);
#endif /* PROFILING */
+void postIPE(StgWord64 info,
+ const char *table_name,
+ const char *closure_desc,
+ const char *label,
+ const char *module,
+ const char *srcloc);
+
void postConcUpdRemSetFlush(Capability *cap);
void postConcMarkEnd(StgWord32 marked_obj_count);
void postNonmovingHeapCensus(int log_blk_size,
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d92b162377ac683780ba565afdc4830d11904e5d...395abf45f360f56e27cd947a96c4854e879232f7
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d92b162377ac683780ba565afdc4830d11904e5d...395abf45f360f56e27cd947a96c4854e879232f7
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20201104/3dd31eb6/attachment-0001.html>
More information about the ghc-commits
mailing list