summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-11-21 11:10:22 -0500
committerBen Gamari <ben@smart-cactus.org>2020-11-29 09:52:59 -0500
commitbe6b148c4451af0e33eb0206f9f6d8b4756cde8c (patch)
tree8231e11384dc7fb9fd5fcdb56d451f4e99f66248
parent5bf85a6f0926794f2ea0d151a226aafaaf5a9423 (diff)
downloadhaskell-be6b148c4451af0e33eb0206f9f6d8b4756cde8c.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 83aeac3779..8fe997d1e4 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -2072,6 +2072,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)