It turns out that -prof -threaded works (modulo some small changes),
because all the data structures used in profiling are only accessed by
one thread at a time, at long as we don't use +RTS -N2 or higher. So
this patch enables the use of -prof -threaded, but an error is given
if you ask for more than one CPU with +RTS -N.
WayDebug `allowedWith` _ = True
WayProf `allowedWith` WayNDP = True
+ WayThreaded `allowedWith` WayProf = True
_ `allowedWith` _ = False
errorBelch("bad value for -N");
error = rtsTrue;
}
+#if defined(PROFILING)
+ if (RtsFlags.ParFlags.nNodes > 1) {
+ errorBelch("bad option %s: only -N1 is supported with profiling", rts_argv[arg]);
+ error = rtsTrue;
+ }
+#endif
}
) break;
x86_init_fpu();
#endif
-#if defined(THREADED_RTS)
- ioManagerStart();
-#endif
-
/* Record initialization times */
stat_endInit();
}
// This must be done after module initialisation.
// ToDo: make this work in the presence of multiple hs_add_root()s.
initProfiling2();
+
+ // ditto.
+#if defined(THREADED_RTS)
+ ioManagerStart();
+#endif
}
/* ----------------------------------------------------------------------------