summaryrefslogtreecommitdiff
path: root/rts/Profiling.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/Profiling.c')
-rw-r--r--rts/Profiling.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/rts/Profiling.c b/rts/Profiling.c
index 9523572887..9f1a442951 100644
--- a/rts/Profiling.c
+++ b/rts/Profiling.c
@@ -22,6 +22,7 @@
#include "Printer.h"
#include "Capability.h"
+#include <fs_rts.h>
#include <string.h>
#if defined(DEBUG)
@@ -264,7 +265,7 @@ initProfilingLogFile(void)
sprintf(prof_filename, "%s.prof", stem);
/* open the log file */
- if ((prof_file = fopen(prof_filename, "w")) == NULL) {
+ if ((prof_file = __rts_fopen(prof_filename, "w")) == NULL) {
debugBelch("Can't open profiling report file %s\n", prof_filename);
RtsFlags.CcFlags.doCostCentres = 0;
// Retainer profiling (`-hr` or `-hr<cc> -h<x>`) writes to
@@ -281,7 +282,7 @@ initProfilingLogFile(void)
sprintf(hp_filename, "%s.hp", stem);
/* open the log file */
- if ((hp_file = fopen(hp_filename, "w")) == NULL) {
+ if ((hp_file = __rts_fopen(hp_filename, "w")) == NULL) {
debugBelch("Can't open profiling report file %s\n",
hp_filename);
RtsFlags.ProfFlags.doHeapProfile = 0;
@@ -307,6 +308,25 @@ endProfiling ( void )
}
}
+
+/*
+ These are used in the C stubs produced by the code generator
+ to register code.
+ */
+void registerCcList(CostCentre **cc_list)
+{
+ for (CostCentre **i = cc_list; *i != NULL; i++) {
+ REGISTER_CC(*i);
+ }
+}
+
+void registerCcsList(CostCentreStack **cc_list)
+{
+ for (CostCentreStack **i = cc_list; *i != NULL; i++) {
+ REGISTER_CCS(*i);
+ }
+}
+
/* -----------------------------------------------------------------------------
Set CCCS when entering a function.