X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FRtsFlags.c;h=99bdb1ae68295faebc43b37a52a40dfe25ee0556;hb=cffcb52b7b7518db39d64394270392d06215cf90;hp=3c78d10452017f30e45f1c2249fa4cefcbbd96a2;hpb=567381a2cfdf7bf93e8c5daf3621383bec954041;p=ghc-hetmet.git diff --git a/ghc/rts/RtsFlags.c b/ghc/rts/RtsFlags.c index 3c78d10..99bdb1a 100644 --- a/ghc/rts/RtsFlags.c +++ b/ghc/rts/RtsFlags.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: RtsFlags.c,v 1.42 2001/07/23 23:37:35 andy Exp $ + * $Id: RtsFlags.c,v 1.69 2003/08/22 22:24:13 sof Exp $ * * (c) The AQUA Project, Glasgow University, 1994-1997 * (c) The GHC Team, 1998-1999 @@ -21,29 +21,30 @@ //@node Includes, Constants //@subsection Includes +#include "PosixSource.h" #include "Rts.h" #include "RtsFlags.h" #include "RtsUtils.h" #include "BlockAlloc.h" -#include "Itimer.h" /* CS_MIN_MILLISECS */ +#include "Timer.h" /* CS_MIN_MILLISECS */ #include "Profiling.h" -#if defined(PROFILING) -#include "Itimer.h" -#endif - #ifdef HAVE_CTYPE_H #include #endif +#include +#include + extern struct RTS_FLAGS RtsFlags; /* * Split argument lists */ -int prog_argc; /* an "int" so as to match normal "argc" */ +int prog_argc = 0; /* an "int" so as to match normal "argc" */ char **prog_argv = NULL; -int rts_argc; /* ditto */ +char *prog_name = NULL; /* 'basename' of prog_argv[0] */ +int rts_argc = 0; /* ditto */ char *rts_argv[MAX_RTS_ARGS]; //@node Constants, Static function decls, Includes @@ -55,41 +56,9 @@ char *rts_argv[MAX_RTS_ARGS]; #define RTS 1 #define PGM 0 -char *debug_opts_strs[] = { - "DEBUG (-D1): scheduler\n", - "DEBUG (-D2): evaluator\n", - "DEBUG (-D4): codegen\n", - "DEBUG (-D8): weak\n", - "DEBUG (-D16): gccafs\n", - "DEBUG (-D32): gc\n", - "DEBUG (-D64): block\n", - "DEBUG (-D128): sanity\n", - "DEBUG (-D256): stable\n", - "DEBUG (-D512): prof\n", - "DEBUG (-D1024): gran\n", - "DEBUG (-D2048): par\n", - "DEBUG (-D4096): linker\n" -}; - -char *debug_opts_prefix[] = { - "_-", /* scheduler */ - "_.", /* evaluator */ - "_,", /* codegen */ - "_;", /* weak */ - "_~", /* gccafs */ - "_@", /* gc */ - "_#", /* block */ - "_&", /* sanity */ - "_:", /* stable */ - "_!", /* prof */ - "_=", /* gran */ - "_=" /* par */ - "_*" /* linker */ -}; - #if defined(GRAN) -char *gran_debug_opts_strs[] = { +static char *gran_debug_opts_strs[] = { "DEBUG (-bDe, -bD1): event_trace; printing event trace.\n", "DEBUG (-bDE, -bD2): event_stats; printing event statistics.\n", "DEBUG (-bDb, -bD4): bq; check blocking queues\n", @@ -108,32 +77,13 @@ char *gran_debug_opts_strs[] = { }; /* one character codes for the available debug options */ -char gran_debug_opts_flags[] = { +static char gran_debug_opts_flags[] = { 'e', 'E', 'b', 'G', 'q', 'f', 'r', 'F', 'u', 'S', ':', 'o', 'z', 'P', 't' }; -/* prefix strings printed with the debug messages of the corresponding type */ -char *gran_debug_opts_prefix[] = { - "", /* event_trace */ - "", /* event_stats */ - "##", /* bq */ - "**", /* pack */ - "^^", /* checkSparkQ */ - "==", /* thunkStealing */ - "^^", /* randomSteal */ - "+-", /* findWork */ - "", /* unused */ - "++", /* pri */ - "::", /* checkLight */ - "##", /* sortedQ */ - "", /* blockOnFetch */ - "", /* packBuffer */ - "" /* blockOnFetch_sanity */ -}; - #elif defined(PAR) -char *par_debug_opts_strs[] = { +static char *par_debug_opts_strs[] = { "DEBUG (-qDv, -qD1): verbose; be generally verbose with parallel related stuff.\n", "DEBUG (-qDq, -qD2): bq; print blocking queues.\n", "DEBUG (-qDs, -qD4): schedule; scheduling of parallel threads.\n", @@ -151,27 +101,10 @@ char *par_debug_opts_strs[] = { }; /* one character codes for the available debug options */ -char par_debug_opts_flags[] = { +static char par_debug_opts_flags[] = { 'v', 'q', 's', 'e', 'r', 'w', 'F', 'f', 'l', 'o', 'p', 'z' }; -/* prefix strings printed with the debug messages of the corresponding type */ -char *par_debug_opts_prefix[] = { - " ", /* verbose */ - "##", /* bq */ - "--", /* schedule */ - "!!", /* free */ - "[]", /* resume */ - ";;", /* weight */ - "%%", /* fetch */ - //",,", /* ack */ - "$$", /* fish */ - "", /* tables */ - "**", /* packet */ - "**" /* pack */ - ":(" /* paranoia */ -}; - #endif /* PAR */ //@node Static function decls, Command-line option parsing routines, Constants @@ -201,10 +134,6 @@ static void process_par_option(int arg, int *rts_argc, char *rts_argv[], rtsBool static void set_par_debug_options(nat n); static void help_par_debug_options(nat n); #endif -#if defined(DEBUG) -static void set_debug_options(nat n); -static void help_debug_options(nat n); -#endif //@node Command-line option parsing routines, GranSim specific options, Static function decls //@subsection Command-line option parsing routines @@ -223,7 +152,7 @@ void initRtsFlagsDefaults(void) RtsFlags.GcFlags.minAllocAreaSize = (256 * 1024) / BLOCK_SIZE; RtsFlags.GcFlags.minOldGenSize = (1024 * 1024) / BLOCK_SIZE; - RtsFlags.GcFlags.maxHeapSize = (64 * 1024 * 1024) / BLOCK_SIZE; + RtsFlags.GcFlags.maxHeapSize = 0; /* off by default */ RtsFlags.GcFlags.heapSizeSuggestion = 0; /* none */ RtsFlags.GcFlags.pcFreeHeap = 3; /* 3% */ RtsFlags.GcFlags.oldGenFactor = 2; @@ -235,25 +164,48 @@ void initRtsFlagsDefaults(void) #else RtsFlags.GcFlags.generations = 2; RtsFlags.GcFlags.steps = 2; - RtsFlags.GcFlags.compact = rtsFalse; RtsFlags.GcFlags.squeezeUpdFrames = rtsTrue; #endif + RtsFlags.GcFlags.compact = rtsFalse; + RtsFlags.GcFlags.compactThreshold = 30.0; #ifdef RTS_GTK_FRONTPANEL RtsFlags.GcFlags.frontpanel = rtsFalse; #endif +#ifdef DEBUG + RtsFlags.DebugFlags.scheduler = rtsFalse; + RtsFlags.DebugFlags.interpreter = rtsFalse; + RtsFlags.DebugFlags.codegen = rtsFalse; + RtsFlags.DebugFlags.weak = rtsFalse; + RtsFlags.DebugFlags.gccafs = rtsFalse; + RtsFlags.DebugFlags.gc = rtsFalse; + RtsFlags.DebugFlags.block_alloc = rtsFalse; + RtsFlags.DebugFlags.sanity = rtsFalse; + RtsFlags.DebugFlags.stable = rtsFalse; + RtsFlags.DebugFlags.prof = rtsFalse; + RtsFlags.DebugFlags.gran = rtsFalse; + RtsFlags.DebugFlags.par = rtsFalse; + RtsFlags.DebugFlags.linker = rtsFalse; +#endif + #if defined(PROFILING) || defined(PAR) RtsFlags.CcFlags.doCostCentres = 0; #endif /* PROFILING or PAR */ #ifdef PROFILING RtsFlags.ProfFlags.doHeapProfile = rtsFalse; - RtsFlags.ProfFlags.profileFrequency = 20; + RtsFlags.ProfFlags.profileInterval = 100; + RtsFlags.ProfFlags.includeTSOs = rtsFalse; RtsFlags.ProfFlags.showCCSOnException = rtsFalse; + RtsFlags.ProfFlags.maxRetainerSetSize = 8; RtsFlags.ProfFlags.modSelector = NULL; RtsFlags.ProfFlags.descrSelector = NULL; RtsFlags.ProfFlags.typeSelector = NULL; RtsFlags.ProfFlags.ccSelector = NULL; + RtsFlags.ProfFlags.ccsSelector = NULL; + RtsFlags.ProfFlags.retainerSelector = NULL; + RtsFlags.ProfFlags.bioSelector = NULL; + #elif defined(DEBUG) RtsFlags.ProfFlags.doHeapProfile = rtsFalse; #endif @@ -383,12 +335,14 @@ usage_text[] = { " -k Sets the initial thread stack size (default 1k) Egs: -K4k -K2m", "", " -A Sets the minimum allocation area size (default 256k) Egs: -A1m -A10k", -" -M Sets the maximum heap size (default 64M) Egs: -M256k -M1G", +" -M Sets the maximum heap size (default unlimited) Egs: -M256k -M1G", " -H Sets the minimum heap size (default 0M) Egs: -H24m -H1G", -" -m% Minimum % of heap which must be available (default 3%)", +" -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 Enable compaction for the oldest generation", +" -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", "", " -t One-line GC statistics (default file: .stat)", " -s Summary GC statistics (with -Sstderr going to stderr)", @@ -409,17 +363,28 @@ usage_text[] = { # if defined(PROFILING) "", -" -hx Heap residency profile (XML) (output file .prof)", -" -h Heap residency profile (text) (output file .prof)", -" break-down: C = cost centre stack (default), M = module", -" D = closure description, Y = type description", +" -hx Heap residency profile (XML) (output file .prof)", +" -h Heap residency profile (hp2ps) (output file .hp)", +" break-down: c = cost centre stack (default)", +" m = module", +" d = closure description", +" y = type description", +" r = retainer", +" b = biography (LAG,DRAG,VOID,USE)", " A subset of closures may be selected thusly:", -" -hc{cc, cc ...} specific cost centre(s) (NOT STACKS!)", -" -hm{mod,mod...} all cost centres from the specified modules(s)", -" -hd{des,des...} closures with specified closure descriptions", -" -hy{typ,typ...} closures with specified type descriptions", +" -hc,... specific cost centre(s) (top of stack only)", +" -hC,... specific cost centre(s) (anywhere in stack)", +" -hm... all cost centres from the specified modules(s)", +" -hd,... closures with specified closure descriptions", +" -hy... closures with specified type descriptions", +" -hr... closures with specified retainers", +" -hb... closures with specified biographies (lag,drag,void,use)", +"", +" -R Set the maximum retainer set size (default: 8)", +"", +" -i Time between heap samples (seconds, default: 0.1)", "", -" -i Time between heap samples (msec, default: 20)", +" -xt Include threads (TSOs) in a heap profile", "", " -xc Show current cost centre stack on raising an exception", # endif @@ -443,6 +408,23 @@ usage_text[] = { " -C Context-switch interval in seconds", " (0 or no argument means switch as often as possible)", " the default is .02 sec; resolution is .02 sec", +"", +#if defined(DEBUG) +" -Ds DEBUG: scheduler", +" -Di DEBUG: interpreter", +" -Dc DEBUG: codegen", +" -Dw DEBUG: weak", +" -DG DEBUG: gccafs", +" -Dg DEBUG: gc", +" -Db DEBUG: block", +" -DS DEBUG: sanity", +" -Dt DEBUG: stable", +" -Dp DEBUG: prof", +" -Dr DEBUG: gran", +" -DP DEBUG: par", +" -Dl DEBUG: linker", +"", +#endif // DEBUG #if defined(SMP) " -N Use OS threads (default: 1)", #endif @@ -467,6 +449,8 @@ usage_text[] = { " -b... All GranSim options start with -b; see GranSim User's Guide for details", #endif "", +"RTS options may also be specified using the GHCRTS environment variable.", +"", "Other RTS options may be available for programs compiled a different way.", "The GHC User's Guide has full details.", "", @@ -479,6 +463,32 @@ strequal(const char *a, const char * b) return(strcmp(a, b) == 0); } +static void +splitRtsFlags(char *s, int *rts_argc, char *rts_argv[]) +{ + char *c1, *c2; + + c1 = s; + do { + while (isspace(*c1)) { c1++; }; + c2 = c1; + while (!isspace(*c2) && *c2 != '\0') { c2++; }; + + if (c1 == c2) { break; } + + if (*rts_argc < MAX_RTS_ARGS-1) { + s = stgMallocBytes(c2-c1+1, "RtsFlags.c:splitRtsFlags()"); + strncpy(s, c1, c2-c1); + s[c2-c1] = '\0'; + rts_argv[(*rts_argc)++] = s; + } else { + barf("too many RTS arguments (max %d)", MAX_RTS_ARGS-1); + } + + c1 = c2; + } while (*c1 != '\0'); +} + void setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]) { @@ -488,12 +498,11 @@ setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]) char *last_slash; /* Remove directory from argv[0] -- default files in current directory */ - - if ((last_slash = (char *) strrchr(argv[0], '/')) != NULL) - strcpy(argv[0], last_slash+1); - - /* Split arguments (argv) into PGM (argv) and RTS (rts_argv) parts */ - /* argv[0] must be PGM argument -- leave in argv */ + if ((last_slash = (char *) strrchr(argv[0], '/')) != NULL) { + prog_name = last_slash+1; + } else { + prog_name = argv[0]; + } total_arg = *argc; arg = 1; @@ -501,8 +510,40 @@ setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]) *argc = 1; *rts_argc = 0; - for (mode = PGM; arg < total_arg && ! strequal("--RTS", argv[arg]); arg++) { - if (strequal("+RTS", argv[arg])) { + // process arguments from the ghc_rts_opts global variable first. + // (arguments from the GHCRTS environment variable and the command + // line override these). + { + if (ghc_rts_opts != NULL) { + splitRtsFlags(ghc_rts_opts, rts_argc, rts_argv); + } + } + + // process arguments from the GHCRTS environment variable next + // (arguments from the command line override these). + { + char *ghc_rts = getenv("GHCRTS"); + + if (ghc_rts != NULL) { + splitRtsFlags(ghc_rts, rts_argc, rts_argv); + } + } + + // Split arguments (argv) into PGM (argv) and RTS (rts_argv) parts + // argv[0] must be PGM argument -- leave in argv + + for (mode = PGM; arg < total_arg; arg++) { + // The '--RTS' argument disables all future +RTS ... -RTS processing. + if (strequal("--RTS", argv[arg])) { + arg++; + break; + } + // The '--' argument is passed through to the program, but + // disables all further +RTS ... -RTS processing. + else if (strequal("--", argv[arg])) { + break; + } + else if (strequal("+RTS", argv[arg])) { mode = RTS; } else if (strequal("-RTS", argv[arg])) { @@ -518,17 +559,14 @@ setupRtsFlags(int *argc, char *argv[], int *rts_argc, char *rts_argv[]) barf("too many RTS arguments (max %d)", MAX_RTS_ARGS-1); } } - if (arg < total_arg) { - /* arg must be --RTS; process remaining program arguments */ - while (++arg < total_arg) { - argv[(*argc)++] = argv[arg]; - } + // process remaining program arguments + for (; arg < total_arg; arg++) { + argv[(*argc)++] = argv[arg]; } argv[*argc] = (char *) 0; rts_argv[*rts_argc] = (char *) 0; - /* Process RTS (rts_argv) part: mainly to determine statsfile */ - + // Process RTS (rts_argv) part: mainly to determine statsfile for (arg = 0; arg < *rts_argc; arg++) { if (rts_argv[arg][0] != '-') { fflush(stdout); @@ -620,8 +658,13 @@ error = rtsTrue; break; case 'c': - RtsFlags.GcFlags.compact = rtsTrue; - break; + if (rts_argv[arg][2] != '\0') { + RtsFlags.GcFlags.compactThreshold = + atof(rts_argv[arg]+2); + } else { + RtsFlags.GcFlags.compact = rtsTrue; + } + break; case 'F': RtsFlags.GcFlags.oldGenFactor = atof(rts_argv[arg]+2); @@ -632,12 +675,59 @@ error = rtsTrue; #ifdef DEBUG case 'D': - if (isdigit(rts_argv[arg][2])) {/* Set all debugging options in one */ - /* hack warning: interpret the flags as a binary number */ - nat n = decode(rts_argv[arg]+2); - set_debug_options(n); - } - break; + { + char *c; + + for (c = rts_argv[arg] + 2; *c != '\0'; c++) { + switch (*c) { + case 's': + RtsFlags.DebugFlags.scheduler = rtsTrue; + break; + case 'i': + RtsFlags.DebugFlags.interpreter = rtsTrue; + break; + case 'c': + RtsFlags.DebugFlags.codegen = rtsTrue; + break; + case 'w': + RtsFlags.DebugFlags.weak = rtsTrue; + break; + case 'G': + RtsFlags.DebugFlags.gccafs = rtsTrue; + break; + case 'g': + RtsFlags.DebugFlags.gc = rtsTrue; + break; + case 'b': + RtsFlags.DebugFlags.block_alloc = rtsTrue; + break; + case 'S': + RtsFlags.DebugFlags.sanity = rtsTrue; + break; + case 't': + RtsFlags.DebugFlags.stable = rtsTrue; + break; + case 'p': + RtsFlags.DebugFlags.prof = rtsTrue; + break; + case 'r': + RtsFlags.DebugFlags.gran = rtsTrue; + break; + case 'P': + RtsFlags.DebugFlags.par = rtsTrue; + break; + case 'l': + RtsFlags.DebugFlags.linker = rtsTrue; + break; + case 'a': + RtsFlags.DebugFlags.apply = rtsTrue; + break; + default: + bad_option( rts_argv[arg] ); + } + } + break; + } #endif case 'K': @@ -736,9 +826,6 @@ error = rtsTrue; /* =========== PROFILING ========================== */ case 'P': /* detailed cost centre profiling (time/alloc) */ - COST_CENTRE_USING_BUILD_ONLY( - RtsFlags.CcFlags.doCostCentres = COST_CENTRES_VERBOSE; - ) case 'p': /* cost centre profiling (time/alloc) */ COST_CENTRE_USING_BUILD_ONLY( switch (rts_argv[arg][2]) { @@ -749,11 +836,22 @@ error = rtsTrue; RtsFlags.CcFlags.doCostCentres = COST_CENTRES_ALL; break; default: - RtsFlags.CcFlags.doCostCentres = COST_CENTRES_SUMMARY; - break; + if (rts_argv[arg][1] == 'P') { + RtsFlags.CcFlags.doCostCentres = + COST_CENTRES_VERBOSE; + } else { + RtsFlags.CcFlags.doCostCentres = + COST_CENTRES_SUMMARY; + } + break; } ) break; + case 'R': + PROFILING_BUILD_ONLY( + RtsFlags.ProfFlags.maxRetainerSetSize = atof(rts_argv[arg]+2); + ) break; + case 'h': /* serial heap profile */ #if !defined(PROFILING) && defined(DEBUG) switch (rts_argv[arg][2]) { @@ -771,58 +869,109 @@ error = rtsTrue; #else PROFILING_BUILD_ONLY( switch (rts_argv[arg][2]) { - case '\0': - case CCchar: - RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CCS; - break; - case MODchar: - RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_MOD; - break; - case DESCRchar: - RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_DESCR; - break; - case TYPEchar: - RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_TYPE; + case '\0': + case 'C': + case 'c': + case 'M': + case 'm': + case 'D': + case 'd': + case 'Y': + case 'y': + case 'R': + case 'r': + case 'B': + case 'b': + if (rts_argv[arg][2] != '\0' && rts_argv[arg][3] != '\0') { + { + char *left = strchr(rts_argv[arg], '{'); + char *right = strrchr(rts_argv[arg], '}'); + + // curly braces are optional, for + // backwards compat. + if (left) + left = left+1; + else + left = rts_argv[arg] + 3; + + if (!right) + right = rts_argv[arg] + strlen(rts_argv[arg]); + + *right = '\0'; + + switch (rts_argv[arg][2]) { + case 'c': // cost centre label select + RtsFlags.ProfFlags.ccSelector = left; + break; + case 'C': + RtsFlags.ProfFlags.ccsSelector = left; + break; + case 'M': + case 'm': // cost centre module select + RtsFlags.ProfFlags.modSelector = left; + break; + case 'D': + case 'd': // closure descr select + RtsFlags.ProfFlags.descrSelector = left; + break; + case 'Y': + case 'y': // closure type select + RtsFlags.ProfFlags.typeSelector = left; + break; + case 'R': + case 'r': // retainer select + RtsFlags.ProfFlags.retainerSelector = left; + break; + case 'B': + case 'b': // biography select + RtsFlags.ProfFlags.bioSelector = left; + break; + } + } + break; + } + + if (RtsFlags.ProfFlags.doHeapProfile != 0) { + prog_belch("multiple heap profile options"); + error = rtsTrue; + break; + } + + switch (rts_argv[arg][2]) { + case '\0': + case 'C': + case 'c': + RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_CCS; + break; + case 'M': + case 'm': + RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_MOD; + break; + case 'D': + case 'd': + RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_DESCR; + break; + case 'Y': + case 'y': + RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_TYPE; + break; + case 'R': + case 'r': + RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_RETAINER; + break; + case 'B': + case 'b': + RtsFlags.ProfFlags.doHeapProfile = HEAP_BY_LDV; + break; + } break; - case 'c': /* cost centre label select */ - case 'm': /* cost centre module select */ - case 'd': /* closure descr select */ - case 'y': /* closure type select */ - {char *left = strchr(rts_argv[arg], '{'); - char *right = strrchr(rts_argv[arg], '}'); - if (! left || ! right || - strrchr(rts_argv[arg], '{') != left || - strchr(rts_argv[arg], '}') != right) { - prog_belch( - "Invalid heap profiling selection bracketing\n %s\n", - rts_argv[arg]); - error = rtsTrue; - } else { - *right = '\0'; - switch (rts_argv[arg][2]) { - case 'c': /* cost centre label select */ - RtsFlags.ProfFlags.ccSelector = left + 1; - break; - case 'm': /* cost centre module select */ - RtsFlags.ProfFlags.modSelector = left + 1; - break; - case 'd': /* closure descr select */ - RtsFlags.ProfFlags.descrSelector = left + 1; - break; - case 'y': /* closure type select */ - RtsFlags.ProfFlags.typeSelector = left + 1; - break; - } - } - } - break; - default: + + default: prog_belch("invalid heap profile option: %s",rts_argv[arg]); error = rtsTrue; } ) - -#endif +#endif // PROFILING break; #if defined(PROFILING) @@ -838,11 +987,9 @@ error = rtsTrue; if (cst != 0 && cst < CS_MIN_MILLISECS) cst = CS_MIN_MILLISECS; - RtsFlags.ProfFlags.profileFrequency = cst; + RtsFlags.ProfFlags.profileInterval = cst; } - break; - #endif /* =========== CONCURRENT ========================= */ @@ -924,8 +1071,15 @@ error = rtsTrue; case 'c': /* Debugging tool: show current cost centre on an exception */ PROFILING_BUILD_ONLY( - RtsFlags.ProfFlags.showCCSOnException = rtsTrue; - ) break; + RtsFlags.ProfFlags.showCCSOnException = rtsTrue; + ); + break; + + case 't': /* Include memory used by TSOs in a heap profile */ + PROFILING_BUILD_ONLY( + RtsFlags.ProfFlags.includeTSOs = rtsTrue; + ); + break; /* The option prefix '-xx' is reserved for future extension. KSW 1999-11. */ @@ -1245,8 +1399,7 @@ process_gran_option(int arg, int *rts_argc, char *rts_argv[], rtsBool *error) } else if (RtsFlags.GranFlags.proc > MAX_PROC || RtsFlags.GranFlags.proc < 1) { - fprintf(stderr,"setupRtsFlags: no more than %u processors -allowed\n", + fprintf(stderr,"setupRtsFlags: no more than %u processors allowed\n", MAX_PROC); *error = rtsTrue; } @@ -1931,43 +2084,6 @@ help_par_debug_options(nat n) { #endif /* PAR */ -#ifdef DEBUG -static void -set_debug_options(nat n) { - nat i; - - for (i=0; i<=MAX_DEBUG_OPTION; i++) - if ((n>>i)&1) { - fprintf(stderr, debug_opts_strs[i]); - switch (i) { - case 0: RtsFlags.DebugFlags.scheduler = rtsTrue; break; - case 1: RtsFlags.DebugFlags.evaluator = rtsTrue; break; - case 2: RtsFlags.DebugFlags.codegen = rtsTrue; break; - case 3: RtsFlags.DebugFlags.weak = rtsTrue; break; - case 4: RtsFlags.DebugFlags.gccafs = rtsTrue; break; - case 5: RtsFlags.DebugFlags.gc = rtsTrue; break; - case 6: RtsFlags.DebugFlags.block_alloc = rtsTrue; break; - case 7: RtsFlags.DebugFlags.sanity = rtsTrue; break; - case 8: RtsFlags.DebugFlags.stable = rtsTrue; break; - case 9: RtsFlags.DebugFlags.prof = rtsTrue; break; - case 10: RtsFlags.DebugFlags.gran = rtsTrue; break; - case 11: RtsFlags.DebugFlags.par = rtsTrue; break; - default: barf("set_debug_options: only %d debug options expected", - MAX_DEBUG_OPTION); - } /* switch */ - } /* if */ -} - -static void -help_debug_options(nat n) { - nat i; - - for (i=0; i<=MAX_DEBUG_OPTION; i++) - if ((n>>i)&1) - fprintf(stderr, debug_opts_strs[i]); -} -#endif /* DEBUG */ - //@node Aux fcts, , GranSim specific options //@subsection Aux fcts