X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsFlags.c;h=397ea8b5ec33a20f04b29523ea3fbba8fd805993;hb=91a804680cfc5cb3894d996b9c7fb28b50180cdb;hp=1204c593565b19f522ba14c6c1df6e2c561c6610;hpb=a2a67cd520b9841114d69a87a423dabcb3b4368e;p=ghc-hetmet.git diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 1204c59..397ea8b 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -106,12 +106,11 @@ void initRtsFlagsDefaults(void) RtsFlags.DebugFlags.stable = rtsFalse; RtsFlags.DebugFlags.stm = rtsFalse; RtsFlags.DebugFlags.prof = rtsFalse; - RtsFlags.DebugFlags.eventlog = rtsFalse; RtsFlags.DebugFlags.apply = rtsFalse; RtsFlags.DebugFlags.linker = rtsFalse; RtsFlags.DebugFlags.squeeze = rtsFalse; RtsFlags.DebugFlags.hpc = rtsFalse; - RtsFlags.DebugFlags.timestamp = rtsFalse; + RtsFlags.DebugFlags.sparks = rtsFalse; #endif #if defined(PROFILING) @@ -135,8 +134,10 @@ void initRtsFlagsDefaults(void) RtsFlags.ProfFlags.bioSelector = NULL; #endif -#ifdef EVENTLOG - RtsFlags.EventLogFlags.doEventLogging = rtsFalse; +#ifdef TRACING + RtsFlags.TraceFlags.trace_stderr = rtsFalse; + RtsFlags.TraceFlags.timestamp = rtsFalse; + RtsFlags.TraceFlags.scheduler = rtsFalse; #endif RtsFlags.MiscFlags.tickInterval = 20; /* In milliseconds */ @@ -151,8 +152,9 @@ void initRtsFlagsDefaults(void) RtsFlags.ParFlags.migrate = rtsTrue; RtsFlags.ParFlags.wakeupMigrate = rtsFalse; RtsFlags.ParFlags.parGcEnabled = 1; - RtsFlags.ParFlags.parGcGen = 1; - RtsFlags.ParFlags.parGcLoadBalancing = 1; + RtsFlags.ParFlags.parGcGen = 0; + RtsFlags.ParFlags.parGcLoadBalancingEnabled = rtsTrue; + RtsFlags.ParFlags.parGcLoadBalancingGen = 1; RtsFlags.ParFlags.setAffinity = 0; #endif @@ -196,9 +198,11 @@ usage_text[] = { " -m Minimum % of heap which must be available (default 3%)", " -G Number of generations (default: 2)", " -T Number of steps in younger generations (default: 2)", -" -c Auto-enable compaction of the oldest generation when live data is", -" at least % of the maximum heap size set with -M (default: 30%)", -" -c Enable compaction for all major collections", +" -c Use in-place compaction instead of copying in the oldest generation", +" when live data is at least % of the maximum heap size set with", +" -M (default: 30%)", +" -c Use in-place compaction for all oldest generation collections", +" (the default is to use copying)", " -w Use mark-region for the oldest generation (experimental)", #if defined(THREADED_RTS) " -I Perform full GC after idle time (default: 0.3, 0 == off)", @@ -252,9 +256,13 @@ usage_text[] = { # endif #endif /* PROFILING or PAR */ -#ifdef EVENTLOG +#ifdef TRACING "", -" -l Log runtime events (generates binary trace file .eventlog)", +" -v Log events to stderr", +" -l Log events in binary format to the file .eventlog", +" -vt Include time stamps when tracing events to stderr with -v", +"", +" -ls Log scheduler events", "", #endif @@ -275,8 +283,6 @@ usage_text[] = { " This sets the resolution for -C and the profile timer -i.", " Default: 0.02 sec.", "", -" -vt Time-stamp debug messages", -"", #if defined(DEBUG) " -Ds DEBUG: scheduler", " -Di DEBUG: interpreter", @@ -293,15 +299,20 @@ usage_text[] = { " -Dm DEBUG: stm", " -Dz DEBUG: stack squezing", " -Dc DEBUG: program coverage", +" -Dr DEBUG: sparks", +"", +" NOTE: all -D options also enable -v automatically. Use -l to create a", +" binary event log file instead.", "", #endif /* DEBUG */ #if defined(THREADED_RTS) && !defined(NOSMP) " -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)", -" -qb Disable load-balancing in the parallel GC", -" -qa Use the OS to set thread affinity", +" -qg[] Use parallel GC only for generations >= ", +" (default: 0, -qg alone turns off parallel GC)", +" -qb[] Use load-balancing in the parallel GC only for generations >= ", +" (default: 1, -qb alone turns off load-balancing)", +" -qa Use the OS to set thread affinity (experimental)", " -qm Don't automatically migrate threads between CPUs", " -qw Migrate a thread to the current CPU when it is woken up", #endif @@ -472,10 +483,10 @@ errorBelch("not built for: -prof"); \ error = rtsTrue; #endif -#ifdef EVENTLOG -# define EVENTLOG_BUILD_ONLY(x) x +#ifdef TRACING +# define TRACING_BUILD_ONLY(x) x #else -# define EVENTLOG_BUILD_ONLY(x) \ +# define TRACING_BUILD_ONLY(x) \ errorBelch("not built for: -par-prof"); \ error = rtsTrue; #endif @@ -617,9 +628,6 @@ error = rtsTrue; case 'p': RtsFlags.DebugFlags.prof = rtsTrue; break; - case 'e': - RtsFlags.DebugFlags.eventlog = rtsTrue; - break; case 'l': RtsFlags.DebugFlags.linker = rtsTrue; break; @@ -635,10 +643,16 @@ error = rtsTrue; case 'c': RtsFlags.DebugFlags.hpc = rtsTrue; break; + case 'r': + RtsFlags.DebugFlags.sparks = rtsTrue; + break; default: bad_option( rts_argv[arg] ); } } + // -Dx also turns on -v. Use -l to direct trace + // events to the .eventlog file instead. + RtsFlags.TraceFlags.trace_stderr = rtsTrue; break; } #endif @@ -743,8 +757,19 @@ error = rtsTrue; /* =========== PROFILING ========================== */ case 'l': -#ifdef EVENTLOG - RtsFlags.EventLogFlags.doEventLogging = rtsTrue; +#ifdef TRACING + switch(rts_argv[arg][2]) { + case '\0': + RtsFlags.TraceFlags.trace_stderr = rtsFalse; + break; + case 's': + RtsFlags.TraceFlags.scheduler = rtsTrue; + break; + default: + errorBelch("unknown RTS option: %s",rts_argv[arg]); + error = rtsTrue; + break; + } #else errorBelch("not built for: -eventlog"); #endif @@ -985,21 +1010,25 @@ error = rtsTrue; errorBelch("incomplete RTS option: %s",rts_argv[arg]); error = rtsTrue; break; - case '1': - RtsFlags.ParFlags.parGcEnabled = rtsFalse; - break; case 'g': - if (rts_argv[arg][3] != '\0') { + if (rts_argv[arg][3] == '\0') { + RtsFlags.ParFlags.parGcEnabled = rtsFalse; + } else { + RtsFlags.ParFlags.parGcEnabled = rtsTrue; RtsFlags.ParFlags.parGcGen = strtol(rts_argv[arg]+3, (char **) NULL, 10); - } else { - errorBelch("bad value for -qg"); - error = rtsTrue; } break; case 'b': - RtsFlags.ParFlags.parGcLoadBalancing = rtsFalse; - break; + if (rts_argv[arg][3] == '\0') { + RtsFlags.ParFlags.parGcLoadBalancingEnabled = rtsFalse; + } + else { + RtsFlags.ParFlags.parGcLoadBalancingEnabled = rtsTrue; + RtsFlags.ParFlags.parGcLoadBalancingGen + = strtol(rts_argv[arg]+3, (char **) NULL, 10); + } + break; case 'a': RtsFlags.ParFlags.setAffinity = rtsTrue; break; @@ -1049,13 +1078,14 @@ error = rtsTrue; case 'v': switch(rts_argv[arg][2]) { - case '\0': - errorBelch("incomplete RTS option: %s",rts_argv[arg]); - error = rtsTrue; - break; +#ifdef TRACING + case '\0': + RtsFlags.TraceFlags.trace_stderr = rtsTrue; + break; case 't': - RtsFlags.DebugFlags.timestamp = rtsTrue; + RtsFlags.TraceFlags.timestamp = rtsTrue; break; +#endif case 's': case 'g': // ignored for backwards-compat