Commit d2847b05 authored by Simon Marlow's avatar Simon Marlow

Add new RTS flags for tracing:

  -vs       Trace scheduler events (see also -Ds with -debug)
  -vt       Time-stamp trace messages

the intention is that we will pipe the -vs output into a
profile-generating tool.  This commit includes the flags only,
functionality to follow.
parent 04a046e8
......@@ -289,6 +289,10 @@ struct TICKY_FLAGS {
FILE *tickyFile;
};
struct TRACE_FLAGS {
rtsBool sched; /* trace scheduler events for profiling */
rtsBool timestamp; /* add timestamps to traces */
};
/* Put them together: */
......@@ -300,6 +304,7 @@ typedef struct _RTS_FLAGS {
struct COST_CENTRE_FLAGS CcFlags;
struct PROFILING_FLAGS ProfFlags;
struct TICKY_FLAGS TickyFlags;
struct TRACE_FLAGS TraceFlags;
#if defined(THREADED_RTS) || defined(PAR)
struct PAR_FLAGS ParFlags;
......
/* -----------------------------------------------------------------------------
*
* (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.
*
......@@ -299,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 *
......@@ -396,6 +398,9 @@ 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",
......@@ -1027,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]);
......@@ -1089,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 */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment