X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsFlags.c;h=69064ea743a7b99f57fa24e8ec6147e891b23a81;hb=1a4ff8d84caf442116e48557f3b8eee353455430;hp=4c1f739e894615e8f62948ece354397c18cd31ef;hpb=1bd1fb932375bc4b065cc8de23f0d251e8075395;p=ghc-hetmet.git diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 4c1f739..69064ea 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -212,6 +212,7 @@ void initRtsFlagsDefaults(void) RtsFlags.ParFlags.nNodes = 1; RtsFlags.ParFlags.migrate = rtsTrue; RtsFlags.ParFlags.wakeupMigrate = rtsFalse; + RtsFlags.ParFlags.gcThreads = 1; #endif #ifdef PAR @@ -336,6 +337,7 @@ usage_text[] = { "The following run time system options are available:", "", " -? Prints this message and exits; the program is not executed", +" --info Print information about the RTS used by this program", "", " -K Sets the maximum stack size (default 8M) Egs: -K32k -K512k", " -k Sets the initial thread stack size (default 1k) Egs: -k4k -k2m", @@ -444,6 +446,7 @@ usage_text[] = { #endif /* DEBUG */ #if defined(THREADED_RTS) && !defined(NOSMP) " -N Use OS threads (default: 1)", +" -g Use OS threads for GC (default: 1)", " -qm Don't automatically migrate threads between CPUs", " -qw Migrate a thread to the current CPU when it is woken up", #endif @@ -684,18 +687,7 @@ error = rtsTrue; } else if (strequal("info", &rts_argv[arg][2])) { - char *s; - printf("RTS info:\n"); - printf("RTS from GHC " ProjectVersion "\n"); - printf("RTS way " RtsWay "\n"); - printf("Host platform " HostPlatform "\n"); - printf("Build platform " BuildPlatform "\n"); - printf("Target platform " TargetPlatform "\n"); - s = strcmp(GhcUnregisterised, "YES") == 0 ? "un" : ""; - printf("Compiler is %sregisterised\n", s); - s = strcmp(GhcEnableTablesNextToCode, "YES") == 0 - ? "" : "not "; - printf("Tables are %snext to code\n", s); + printRtsInfo(); exit(0); } else { @@ -1130,6 +1122,24 @@ error = rtsTrue; } ) break; + case 'g': + THREADED_BUILD_ONLY( + if (rts_argv[arg][2] != '\0') { + RtsFlags.ParFlags.gcThreads + = strtol(rts_argv[arg]+2, (char **) NULL, 10); + if (RtsFlags.ParFlags.nNodes <= 0) { + errorBelch("bad value for -g"); + 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; + case 'q': switch (rts_argv[arg][2]) { case '\0':