diff options
author | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
---|---|---|
committer | Kavon Farvardin <kavon@farvard.in> | 2018-09-23 15:29:37 -0500 |
commit | 84c2ad99582391005b5e873198b15e9e9eb4f78d (patch) | |
tree | caa8c2f2ec7e97fbb4977263c6817c9af5025cf4 /rts/Profiling.c | |
parent | 8ddb47cfcf5776e9a3c55fd37947c8a95e00fa12 (diff) | |
parent | e68b439fe5de61b9a2ca51af472185c62ccb8b46 (diff) | |
download | haskell-wip/T13904.tar.gz |
update to current master againwip/T13904
Diffstat (limited to 'rts/Profiling.c')
-rw-r--r-- | rts/Profiling.c | 24 |
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. |