summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-11-21 11:10:22 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-11-30 19:48:53 -0500
commit490aa14dbc98e4713f913c4417d454e53b8b278a (patch)
treedb2dcb5c605dcf1ab6c424e40c627a4ec6085537
parent5eb163f321fdc9a3dbb5e02a157b7f8194e70fcc (diff)
downloadhaskell-490aa14dbc98e4713f913c4417d454e53b8b278a.tar.gz
rts/linker: Initialise CCSs from native shared objects
-rw-r--r--rts/Linker.c6
-rw-r--r--rts/Profiling.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 211b65150f..136f3f3a7d 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -2070,6 +2070,12 @@ static void * loadNativeObj_ELF (pathchar *path, char **errmsg)
loaded_objects = nc;
retval = nc->dlopen_handle;
+
+#if defined(PROFILING)
+ // collect any new cost centres that were defined in the loaded object.
+ refreshProfilingCCSs();
+#endif
+
goto success;
dl_iterate_phdr_fail:
diff --git a/rts/Profiling.c b/rts/Profiling.c
index 04f00da157..c84296cd5d 100644
--- a/rts/Profiling.c
+++ b/rts/Profiling.c
@@ -54,7 +54,7 @@ FILE *prof_file;
// List of all cost centres. Used for reporting.
CostCentre *CC_LIST = NULL;
// All cost centre stacks temporarily appear here, to be able to make CCS_MAIN a
-// parent of all cost centres stacks (done in initProfiling2()).
+// parent of all cost centres stacks (done in refreshProfilingCCSs()).
static CostCentreStack *CCS_LIST = NULL;
#if defined(THREADED_RTS)