X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsFlags.c;h=0ab13992ce9479b1bd6ae8d42e58cdcc3486a16f;hb=0598a001b9d852a044a49f8fb6ab1a6b02a77d9e;hp=a3d1d83603400352292acda5a8104195632b85d0;hpb=ebf733111484edc973797025418cba8f096246f6;p=ghc-hetmet.git diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index a3d1d83..0ab1399 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -150,6 +150,18 @@ void initRtsFlagsDefaults(void) #endif RtsFlags.GcFlags.idleGCDelayTime = 300; /* millisecs */ +#if osf3_HOST_OS +/* ToDo: Perhaps by adjusting this value we can make linking without + * -static work (i.e., not generate a core-dumping executable)? */ +# if SIZEOF_VOID_P == 8 + RtsFlags.GcFlags.heapBase = 0x180000000L; +# else +# error I have no idea where to begin the heap on a non-64-bit osf3 machine. +# endif +#else + RtsFlags.GcFlags.heapBase = 0; /* means don't care */ +#endif + #ifdef DEBUG RtsFlags.DebugFlags.scheduler = rtsFalse; RtsFlags.DebugFlags.interpreter = rtsFalse; @@ -172,9 +184,10 @@ void initRtsFlagsDefaults(void) RtsFlags.CcFlags.doCostCentres = 0; #endif /* PROFILING or PAR */ -#ifdef PROFILING RtsFlags.ProfFlags.doHeapProfile = rtsFalse; RtsFlags.ProfFlags.profileInterval = 100; + +#ifdef PROFILING RtsFlags.ProfFlags.includeTSOs = rtsFalse; RtsFlags.ProfFlags.showCCSOnException = rtsFalse; RtsFlags.ProfFlags.maxRetainerSetSize = 8; @@ -186,14 +199,13 @@ void initRtsFlagsDefaults(void) RtsFlags.ProfFlags.ccsSelector = NULL; RtsFlags.ProfFlags.retainerSelector = NULL; RtsFlags.ProfFlags.bioSelector = NULL; - -#elif defined(DEBUG) - RtsFlags.ProfFlags.doHeapProfile = rtsFalse; #endif 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; @@ -380,23 +392,20 @@ usage_text[] = { " -L Maximum length of a cost-centre stack in a heap profile", " (default: 25)", "", -" -i Time between heap samples (seconds, default: 0.1)", -"", " -xt Include threads (TSOs) in a heap profile", "", " -xc Show current cost centre stack on raising an exception", +"", # endif #endif /* PROFILING or PAR */ -#if !defined(PROFILING) && defined(DEBUG) +#if !defined(PROFILING) "", -" -h Debugging Heap residency profile", -" (output file .hp)", -" break-down: L = closure label (default)", -" T = closure type (constructor, thunk etc.)", +" -hT Heap residency profile (output file .hp)", #endif +" -i Time between heap samples (seconds, default: 0.1)", "", #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) @@ -406,7 +415,7 @@ usage_text[] = { " -C Context-switch interval in seconds.", " 0 or no argument means switch as often as possible.", " Default: 0.02 sec; resolution is set by -V below.", -" -V Master tick interval in seconds.", +" -V Master tick interval in seconds (0 == disable timer).", " This sets the resolution for -C and the profile timer -i.", " Default: 0.02 sec.", "", @@ -436,6 +445,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 @@ -657,6 +668,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; @@ -915,12 +943,9 @@ error = rtsTrue; } ) break; case 'h': /* serial heap profile */ -#if !defined(PROFILING) && defined(DEBUG) +#if !defined(PROFILING) switch (rts_argv[arg][2]) { case '\0': - case 'L': - RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_INFOPTR; - break; case 'T': RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CLOSURE_TYPE; break; @@ -1036,7 +1061,6 @@ error = rtsTrue; #endif /* PROFILING */ break; -#if defined(PROFILING) case 'i': /* heap sample interval */ if (rts_argv[arg][2] == '\0') { /* use default */ @@ -1048,7 +1072,6 @@ error = rtsTrue; RtsFlags.ProfFlags.profileInterval = cst; } break; -#endif /* =========== CONCURRENT ========================= */ case 'C': /* context switch interval */ @@ -1181,6 +1204,16 @@ error = rtsTrue; error = rtsTrue; break; + case 'b': /* heapBase in hex; undocumented */ + if (rts_argv[arg][3] != '\0') { + RtsFlags.GcFlags.heapBase + = strtol(rts_argv[arg]+3, (char **) NULL, 16); + } else { + errorBelch("-xb: requires argument"); + error = rtsTrue; + } + break; + case 'c': /* Debugging tool: show current cost centre on an exception */ PROFILING_BUILD_ONLY( RtsFlags.ProfFlags.showCCSOnException = rtsTrue; @@ -1230,13 +1263,11 @@ error = rtsTrue; RtsFlags.MiscFlags.tickInterval); } -#ifdef PROFILING if (RtsFlags.ProfFlags.profileInterval > 0) { RtsFlags.MiscFlags.tickInterval = stg_min(RtsFlags.ProfFlags.profileInterval, RtsFlags.MiscFlags.tickInterval); } -#endif if (RtsFlags.ConcFlags.ctxtSwitchTime > 0) { RtsFlags.ConcFlags.ctxtSwitchTicks = @@ -1246,10 +1277,8 @@ error = rtsTrue; RtsFlags.ConcFlags.ctxtSwitchTicks = 0; } -#ifdef PROFILING RtsFlags.ProfFlags.profileIntervalTicks = RtsFlags.ProfFlags.profileInterval / RtsFlags.MiscFlags.tickInterval; -#endif if (error) { const char **p;