Commit 50c4d039 authored by Simon Marlow's avatar Simon Marlow
Browse files

Enable -prof -threaded (#886)

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.
parent 210ca9c0
......@@ -492,6 +492,7 @@ allowed_combination way = and [ x `allowedWith` y
WayDebug `allowedWith` _ = True
WayProf `allowedWith` WayNDP = True
WayThreaded `allowedWith` WayProf = True
_ `allowedWith` _ = False
......
......@@ -1117,6 +1117,12 @@ error = rtsTrue;
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;
......
......@@ -281,10 +281,6 @@ hs_init(int *argc, char **argv[])
x86_init_fpu();
#endif
#if defined(THREADED_RTS)
ioManagerStart();
#endif
/* Record initialization times */
stat_endInit();
}
......@@ -360,6 +356,11 @@ hs_add_root(void (*init_root)(void))
// 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
}
/* ----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment