#include "Rts.h"
#include "RtsFlags.h"
#include "RtsUtils.h"
-#include "BlockAlloc.h"
#include "Profiling.h"
#ifdef HAVE_CTYPE_H
RtsFlags.ProfFlags.includeTSOs = rtsFalse;
RtsFlags.ProfFlags.showCCSOnException = rtsFalse;
RtsFlags.ProfFlags.maxRetainerSetSize = 8;
+ RtsFlags.ProfFlags.ccsLength = 25;
RtsFlags.ProfFlags.modSelector = NULL;
RtsFlags.ProfFlags.descrSelector = NULL;
RtsFlags.ProfFlags.typeSelector = NULL;
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 *
" -hb<bio>... closures with specified biographies (lag,drag,void,use)",
"",
" -R<size> Set the maximum retainer set size (default: 8)",
+"",
+" -L<chars> Maximum length of a cost-centre stack in a heap profile",
+" (default: 25)",
"",
" -i<sec> Time between heap samples (seconds, default: 0.1)",
"",
" -N<n> Use <n> PVMish processors in parallel (default: 2)",
/* NB: the -N<n> is implemented by the driver!! */
#endif
-" -C<secs> Context-switch interval in seconds",
-" (0 or no argument means switch as often as possible)",
-" the default is .02 sec; resolution is .02 sec",
+" -C<secs> 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<secs> Master tick interval in seconds.",
+" This sets the resolution for -C and the profile timer -i.",
+" Default: 0.02 sec.",
"",
" -vs Trace scheduler events (see also -Ds with -debug)",
" -vt Time-stamp trace messages",
#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<file> option). X is one of:",
+"",
+/* " y - cycles", */
+" 1 - level 1 cache misses",
+" 2 - level 2 cache misses",
+" b - branch mispredictions",
+" s - stalled cycles",
+#endif
"",
"RTS options may also be specified using the GHCRTS environment variable.",
"",
}
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;
+ default:
+ bad_option( rts_argv[arg] );
+ }
+ break;
+#endif
+
case 'B':
RtsFlags.GcFlags.ringBell = rtsTrue;
break;
PROFILING_BUILD_ONLY(
RtsFlags.ProfFlags.maxRetainerSetSize = atof(rts_argv[arg]+2);
) break;
-
+ case 'L':
+ PROFILING_BUILD_ONLY(
+ RtsFlags.ProfFlags.ccsLength = atof(rts_argv[arg]+2);
+ if(RtsFlags.ProfFlags.ccsLength <= 0) {
+ bad_option(rts_argv[arg]);
+ }
+ ) break;
case 'h': /* serial heap profile */
#if !defined(PROFILING) && defined(DEBUG)
switch (rts_argv[arg][2]) {