X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsFlags.c;h=3fac86bf4ee26658d7741928029a4b0545e21317;hb=bd78c94a3b41f8d2097efc0415fa26e0cd1140ef;hp=cce2b28fed518e04185508f95a1cfec262ccba71;hpb=3ebcd3deb769a03f4ded0fca2cf38201048c0214;p=ghc-hetmet.git diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index cce2b28..3fac86b 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -17,6 +17,14 @@ #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef HAVE_WINDOWS_H +#include +#endif + #include #include @@ -176,11 +184,14 @@ void initRtsFlagsDefaults(void) RtsFlags.DebugFlags.stable = rtsFalse; RtsFlags.DebugFlags.stm = rtsFalse; RtsFlags.DebugFlags.prof = rtsFalse; + RtsFlags.DebugFlags.eventlog = rtsFalse; RtsFlags.DebugFlags.gran = rtsFalse; RtsFlags.DebugFlags.par = rtsFalse; + RtsFlags.DebugFlags.apply = rtsFalse; RtsFlags.DebugFlags.linker = rtsFalse; RtsFlags.DebugFlags.squeeze = rtsFalse; RtsFlags.DebugFlags.hpc = rtsFalse; + RtsFlags.DebugFlags.timestamp = rtsFalse; #endif #if defined(PROFILING) || defined(PAR) @@ -204,10 +215,15 @@ void initRtsFlagsDefaults(void) RtsFlags.ProfFlags.bioSelector = NULL; #endif +#ifdef EVENTLOG + RtsFlags.EventLogFlags.doEventLogging = rtsFalse; +#endif + RtsFlags.MiscFlags.tickInterval = 20; /* In milliseconds */ RtsFlags.ConcFlags.ctxtSwitchTime = 20; /* In milliseconds */ RtsFlags.MiscFlags.install_signal_handlers = rtsTrue; + RtsFlags.MiscFlags.machineReadable = rtsFalse; RtsFlags.MiscFlags.linkerMemBase = 0; #ifdef THREADED_RTS @@ -216,6 +232,7 @@ void initRtsFlagsDefaults(void) RtsFlags.ParFlags.wakeupMigrate = rtsFalse; RtsFlags.ParFlags.parGcEnabled = 1; RtsFlags.ParFlags.parGcGen = 1; + RtsFlags.ParFlags.parGcLoadBalancing = 1; #endif #ifdef PAR @@ -318,10 +335,6 @@ void initRtsFlagsDefaults(void) RtsFlags.TickyFlags.tickyFile = NULL; #endif - RtsFlags.TraceFlags.timestamp = rtsFalse; - RtsFlags.TraceFlags.sched = rtsFalse; - RtsFlags.TraceFlags.gc = rtsFalse; - #ifdef USE_PAPI /* By default no special measurements taken */ RtsFlags.PapiFlags.eventType = 0; @@ -408,6 +421,13 @@ usage_text[] = { "", # endif #endif /* PROFILING or PAR */ + +#ifdef EVENTLOG +"", +" -l Log runtime events (generates binary trace file .eventlog)", +"", +#endif + #if !defined(PROFILING) "", " -hT Heap residency profile (output file .hp)", @@ -429,8 +449,7 @@ usage_text[] = { " This sets the resolution for -C and the profile timer -i.", " Default: 0.02 sec.", "", -" -vs Trace scheduler events (see also -Ds with -debug)", -" -vt Time-stamp trace messages", +" -vt Time-stamp debug messages", "", #if defined(DEBUG) " -Ds DEBUG: scheduler", @@ -442,8 +461,10 @@ usage_text[] = { " -DS DEBUG: sanity", " -Dt DEBUG: stable", " -Dp DEBUG: prof", +" -De DEBUG: event logging", " -Dr DEBUG: gran", " -DP DEBUG: par", +" -Da DEBUG: apply", " -Dl DEBUG: linker", " -Dm DEBUG: stm", " -Dz DEBUG: stack squezing", @@ -451,7 +472,8 @@ usage_text[] = { "", #endif /* DEBUG */ #if defined(THREADED_RTS) && !defined(NOSMP) -" -N Use OS threads (default: 1)", +" -N Use processors (default: 1)", +" -N Determine the number of processors to use automatically", " -q1 Use one OS thread for GC (turns off parallel GC)", " -qg Use parallel GC only for generations >= (default: 1)", " -qm Don't automatically migrate threads between CPUs", @@ -647,6 +669,14 @@ errorBelch("not built for: -prof"); \ error = rtsTrue; #endif +#ifdef EVENTLOG +# define EVENTLOG_BUILD_ONLY(x) x +#else +# define EVENTLOG_BUILD_ONLY(x) \ +errorBelch("not built for: -par-prof"); \ +error = rtsTrue; +#endif + #ifdef PAR # define PAR_BUILD_ONLY(x) x #else @@ -696,6 +726,10 @@ error = rtsTrue; &rts_argv[arg][2])) { RtsFlags.MiscFlags.install_signal_handlers = rtsFalse; } + else if (strequal("machine-readable", + &rts_argv[arg][2])) { + RtsFlags.MiscFlags.machineReadable = rtsTrue; + } else if (strequal("info", &rts_argv[arg][2])) { printRtsInfo(); @@ -804,6 +838,9 @@ error = rtsTrue; case 'p': RtsFlags.DebugFlags.prof = rtsTrue; break; + case 'e': + RtsFlags.DebugFlags.eventlog = rtsTrue; + break; case 'r': RtsFlags.DebugFlags.gran = rtsTrue; break; @@ -938,6 +975,14 @@ error = rtsTrue; /* =========== PROFILING ========================== */ + case 'l': +#ifdef EVENTLOG + RtsFlags.EventLogFlags.doEventLogging = rtsTrue; +#else + errorBelch("not built for: -eventlog"); +#endif + break; + case 'P': /* detailed cost centre profiling (time/alloc) */ case 'p': /* cost centre profiling (time/alloc) */ COST_CENTRE_USING_BUILD_ONLY( @@ -1131,7 +1176,13 @@ error = rtsTrue; #if defined(THREADED_RTS) && !defined(NOSMP) case 'N': THREADED_BUILD_ONLY( - if (rts_argv[arg][2] != '\0') { + if (rts_argv[arg][2] == '\0') { +#if defined(PROFILING) + RtsFlags.ParFlags.nNodes = 1; +#else + RtsFlags.ParFlags.nNodes = getNumberOfProcessors(); +#endif + } else { RtsFlags.ParFlags.nNodes = strtol(rts_argv[arg]+2, (char **) NULL, 10); if (RtsFlags.ParFlags.nNodes <= 0) { @@ -1179,6 +1230,9 @@ error = rtsTrue; error = rtsTrue; } break; + case 'b': + RtsFlags.ParFlags.parGcLoadBalancing = rtsFalse; + break; case 'm': RtsFlags.ParFlags.migrate = rtsFalse; break; @@ -1244,13 +1298,11 @@ error = rtsTrue; error = rtsTrue; break; case 't': - RtsFlags.TraceFlags.timestamp = rtsTrue; + RtsFlags.DebugFlags.timestamp = rtsTrue; break; case 's': - RtsFlags.TraceFlags.sched = rtsTrue; - break; case 'g': - RtsFlags.TraceFlags.gc = rtsTrue; + // ignored for backwards-compat break; default: errorBelch("unknown RTS option: %s",rts_argv[arg]);