+ fclose(f);
+}
+
+/* Called at the end of execution, to write out the Hpc *.tix file
+ * for this exection. Safe to call, even if coverage is not used.
+ */
+void
+exitHpc(void) {
+ debugTrace(DEBUG_hpc,"exitHpc");
+
+ if (hpc_inited == 0) {
+ return;
+ }
+
+ // Only write the tix file if you are the original process.
+ // Any sub-process from use of fork from inside Haskell will
+ // not clober the .tix file.
+
+ if (hpc_pid == getpid()) {
+ FILE *f = fopen(tixFilename,"w");
+ writeTix(f);
+ }