X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsFlags.c;h=58b69aff49164d8438619f4a29ab6cb410a8f33d;hb=5c789e424c1461c1dadfd38c44fcb9e8f38bf755;hp=7b8a4d1d68d9cf048b5fcf8cf4fa95af3209818b;hpb=16871485a44ba8a6e93e40f30af7ea46839e0c4c;p=ghc-hetmet.git diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 7b8a4d1..58b69af 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -165,6 +165,7 @@ void initRtsFlagsDefaults(void) RtsFlags.DebugFlags.par = rtsFalse; RtsFlags.DebugFlags.linker = rtsFalse; RtsFlags.DebugFlags.squeeze = rtsFalse; + RtsFlags.DebugFlags.hpc = rtsFalse; #endif #if defined(PROFILING) || defined(PAR) @@ -193,6 +194,8 @@ void initRtsFlagsDefaults(void) RtsFlags.MiscFlags.tickInterval = 50; /* In milliseconds */ RtsFlags.ConcFlags.ctxtSwitchTime = 50; /* In milliseconds */ + RtsFlags.MiscFlags.install_signal_handlers = rtsTrue; + #ifdef THREADED_RTS RtsFlags.ParFlags.nNodes = 1; RtsFlags.ParFlags.migrate = rtsTrue; @@ -301,6 +304,11 @@ void initRtsFlagsDefaults(void) RtsFlags.TraceFlags.timestamp = rtsFalse; RtsFlags.TraceFlags.sched = rtsFalse; + +#ifdef USE_PAPI + /* By default no special measurements taken */ + RtsFlags.PapiFlags.eventType = 0; +#endif } static const char * @@ -390,7 +398,7 @@ usage_text[] = { #endif "", #if defined(TICKY_TICKY) -" -r Produce reduction profiling statistics (with -rstderr for stderr)", +" -r Produce ticky-ticky statistics (with -rstderr for stderr)", "", #endif #if defined(PAR) @@ -422,6 +430,7 @@ usage_text[] = { " -Dl DEBUG: linker", " -Dm DEBUG: stm", " -Dz DEBUG: stack squezing", +" -Dc DEBUG: program coverage", "", #endif /* DEBUG */ #if defined(THREADED_RTS) && !defined(NOSMP) @@ -429,6 +438,8 @@ usage_text[] = { " -qm Don't automatically migrate threads between CPUs", " -qw Migrate a thread to the current CPU when it is woken up", #endif +" --install-signal-handlers=", +" Install signal handlers (default: yes)", #if defined(THREADED_RTS) || defined(PAR) " -e Size of spark pools (default 100)", #endif @@ -449,6 +460,17 @@ usage_text[] = { #if defined(GRAN) /* ToDo: fill in decent Docu here */ " -b... All GranSim options start with -b; see GranSim User's Guide for details", #endif +#if defined(USE_PAPI) +" -aX CPU performance counter measurements using PAPI", +" (use with the -s option). X is one of:", +"", +/* " y - cycles", */ +" 1 - level 1 cache misses", +" 2 - level 2 cache misses", +" b - branch mispredictions", +" s - stalled cycles", +" e - cache miss and branch misprediction events", +#endif "", "RTS options may also be specified using the GHCRTS environment variable.", "", @@ -639,6 +661,23 @@ error = rtsTrue; error = rtsTrue; break; + /* This isn't going to allow us to keep related options + together as we add more --* flags. We really need a + proper options parser. */ + case '-': + if (strequal("install-signal-handlers=yes", + &rts_argv[arg][2])) { + RtsFlags.MiscFlags.install_signal_handlers = rtsTrue; + } + else if (strequal("install-signal-handlers=no", + &rts_argv[arg][2])) { + RtsFlags.MiscFlags.install_signal_handlers = rtsFalse; + } + else { + errorBelch("unknown RTS option: %s",rts_argv[arg]); + error = rtsTrue; + } + break; case 'A': RtsFlags.GcFlags.minAllocAreaSize = decode(rts_argv[arg]+2) / BLOCK_SIZE; @@ -647,6 +686,30 @@ error = rtsTrue; } break; +#ifdef USE_PAPI + case 'a': + switch(rts_argv[arg][2]) { + case '1': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_CACHE_L1; + break; + case '2': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_CACHE_L2; + break; + case 'b': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_BRANCH; + break; + case 's': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_STALLS; + break; + case 'e': + RtsFlags.PapiFlags.eventType = PAPI_FLAG_CB_EVENTS; + break; + default: + bad_option( rts_argv[arg] ); + } + break; +#endif + case 'B': RtsFlags.GcFlags.ringBell = rtsTrue; break; @@ -719,6 +782,9 @@ error = rtsTrue; case 'z': RtsFlags.DebugFlags.squeeze = rtsTrue; break; + case 'c': + RtsFlags.DebugFlags.hpc = rtsTrue; + break; default: bad_option( rts_argv[arg] ); }