X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsFlags.c;h=7e836afefc6ca0c105f624bbfd2de410f115e492;hb=35a38acc6010d97b349092f9179c14d18f129e9b;hp=0f83b3356c3a23ba8bb7275f2196ef9fa4c3b1db;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c index 0f83b33..7e836af 100644 --- a/rts/RtsFlags.c +++ b/rts/RtsFlags.c @@ -1,26 +1,12 @@ - /* ----------------------------------------------------------------------------- * * (c) The AQUA Project, Glasgow University, 1994-1997 - * (c) The GHC Team, 1998-1999 + * (c) The GHC Team, 1998-2006 * * Functions for parsing the argument list. * * ---------------------------------------------------------------------------*/ -//@menu -//* Includes:: -//* Constants:: -//* Static function decls:: -//* Command-line option parsing routines:: -//* GranSim specific options:: -//* Aux fcts:: -//@end menu -//*/ - -//@node Includes, Constants -//@subsection Includes - #include "PosixSource.h" #include "Rts.h" #include "RtsFlags.h" @@ -48,9 +34,6 @@ 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 -//@subsection Constants - /* * constants, used later */ @@ -108,9 +91,6 @@ static char par_debug_opts_flags[] = { #endif /* PAR */ -//@node Static function decls, Command-line option parsing routines, Constants -//@subsection Static function decls - /* ----------------------------------------------------------------------------- Static function decls -------------------------------------------------------------------------- */ @@ -137,9 +117,6 @@ static void set_par_debug_options(nat n); static void help_par_debug_options(nat n); #endif -//@node Command-line option parsing routines, GranSim specific options, Static function decls -//@subsection Command-line option parsing routines - /* ----------------------------------------------------------------------------- * Command-line option parsing routines. * ---------------------------------------------------------------------------*/ @@ -178,7 +155,6 @@ void initRtsFlagsDefaults(void) #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; @@ -322,6 +298,9 @@ void initRtsFlagsDefaults(void) RtsFlags.TickyFlags.showTickyStats = rtsFalse; RtsFlags.TickyFlags.tickyFile = NULL; #endif + + RtsFlags.TraceFlags.timestamp = rtsFalse; + RtsFlags.TraceFlags.sched = rtsFalse; } static const char * @@ -419,10 +398,12 @@ usage_text[] = { " (0 or no argument means switch as often as possible)", " the default is .02 sec; resolution is .02 sec", "", +" -vs Trace scheduler events (see also -Ds with -debug)", +" -vt Time-stamp trace messages", +"", #if defined(DEBUG) " -Ds DEBUG: scheduler", " -Di DEBUG: interpreter", -" -Dc DEBUG: codegen", " -Dw DEBUG: weak", " -DG DEBUG: gccafs", " -Dg DEBUG: gc", @@ -693,9 +674,6 @@ error = rtsTrue; case 'i': RtsFlags.DebugFlags.interpreter = rtsTrue; break; - case 'c': - RtsFlags.DebugFlags.codegen = rtsTrue; - break; case 'w': RtsFlags.DebugFlags.weak = rtsTrue; break; @@ -1054,7 +1032,7 @@ error = rtsTrue; } ) break; - case 'q': + case 'q': switch (rts_argv[arg][2]) { case '\0': errorBelch("incomplete RTS option: %s",rts_argv[arg]); @@ -1116,6 +1094,27 @@ error = rtsTrue; } ) break; + /* =========== TRACING ---------=================== */ + + case 'v': + switch(rts_argv[arg][2]) { + case '\0': + errorBelch("incomplete RTS option: %s",rts_argv[arg]); + error = rtsTrue; + break; + case 't': + RtsFlags.TraceFlags.timestamp = rtsTrue; + break; + case 's': + RtsFlags.TraceFlags.sched = rtsTrue; + break; + default: + errorBelch("unknown RTS option: %s",rts_argv[arg]); + error = rtsTrue; + break; + } + break; + /* =========== EXTENDED OPTIONS =================== */ case 'x': /* Extend the argument space */ @@ -1166,9 +1165,6 @@ error = rtsTrue; #if defined(GRAN) -//@node GranSim specific options, Aux fcts, Command-line option parsing routines -//@subsection GranSim specific options - static void enable_GranSimLight(void) { @@ -2140,9 +2136,6 @@ help_par_debug_options(nat n) { #endif /* PAR */ -//@node Aux fcts, , GranSim specific options -//@subsection Aux fcts - static void stats_fprintf(FILE *f, char *s, ...) {