summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-07-08 19:44:23 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-07-08 19:44:23 +0000
commitf5605a5a2ea4a4707c9bec48048d730f0f56dae2 (patch)
tree04f8bba097c31a3838716d4ec289f78bb0b39286
parent08f3834baf68671f1b9e61def2e4d5511fbe2c8d (diff)
downloadhaskell-f5605a5a2ea4a4707c9bec48048d730f0f56dae2.tar.gz
Fix the +RTS -V0 option introduced recently; it didn't work at all, now it does.
Also, I documented it. +RTS -V0 disables the internal RTS timer completely, which is useful for repeatable debugginng.
-rw-r--r--docs/users_guide/runtime_control.xml8
-rw-r--r--rts/Makefile2
-rw-r--r--rts/RtsFlags.c24
-rw-r--r--rts/Timer.c4
4 files changed, 30 insertions, 8 deletions
diff --git a/docs/users_guide/runtime_control.xml b/docs/users_guide/runtime_control.xml
index e89f340430..95365bacce 100644
--- a/docs/users_guide/runtime_control.xml
+++ b/docs/users_guide/runtime_control.xml
@@ -108,6 +108,14 @@
the <option>-C</option> or <option>-i</option> options.
However, setting <option>-V</option> is required in order to
increase the resolution of the time profiler.</para>
+
+ <para>Using a value of zero disables the RTS clock
+ completetly, and has the effect of disabling timers that
+ depend on it: the context switch timer and the heap profiling
+ timer. Context switches will still happen, but
+ deterministically and at a rate much faster than normal.
+ Disabling the interval timer is useful for debugging, because
+ it eliminates a source of non-determinism at runtime.</para>
</listitem>
</varlistentry>
diff --git a/rts/Makefile b/rts/Makefile
index 2c5dcc4f4b..8d39ed012f 100644
--- a/rts/Makefile
+++ b/rts/Makefile
@@ -330,7 +330,7 @@ sm/Compact_HC_OPTS += -optc-finline-limit=2500
SRC_CC_OPTS += -fno-strict-aliasing
# Cmm must be compiled via-C for now, because the NCG can't handle loops
-SRC_HC_OPTS += -fvia-C
+# SRC_HC_OPTS += -fvia-C
# We *want* type-checking of hand-written cmm.
SRC_HC_OPTS += -dcmm-lint
diff --git a/rts/RtsFlags.c b/rts/RtsFlags.c
index 0ab13992ce..9dd6b19312 100644
--- a/rts/RtsFlags.c
+++ b/rts/RtsFlags.c
@@ -1244,13 +1244,20 @@ error = rtsTrue;
}
}
- // Determine what tick interval we should use for the RTS timer
- // by taking the shortest of the various intervals that we need to
- // monitor.
- if (RtsFlags.MiscFlags.tickInterval <= 0) {
+ if (RtsFlags.MiscFlags.tickInterval < 0) {
RtsFlags.MiscFlags.tickInterval = 50;
}
+ // If the master timer is disabled, turn off the other timers.
+ if (RtsFlags.MiscFlags.tickInterval == 0) {
+ RtsFlags.ConcFlags.ctxtSwitchTime = 0;
+ RtsFlags.GcFlags.idleGCDelayTime = 0;
+ RtsFlags.ProfFlags.profileInterval = 0;
+ }
+
+ // Determine what tick interval we should use for the RTS timer
+ // by taking the shortest of the various intervals that we need to
+ // monitor.
if (RtsFlags.ConcFlags.ctxtSwitchTime > 0) {
RtsFlags.MiscFlags.tickInterval =
stg_min(RtsFlags.ConcFlags.ctxtSwitchTime,
@@ -1277,8 +1284,13 @@ error = rtsTrue;
RtsFlags.ConcFlags.ctxtSwitchTicks = 0;
}
- RtsFlags.ProfFlags.profileIntervalTicks =
- RtsFlags.ProfFlags.profileInterval / RtsFlags.MiscFlags.tickInterval;
+ if (RtsFlags.ProfFlags.profileInterval > 0) {
+ RtsFlags.ProfFlags.profileIntervalTicks =
+ RtsFlags.ProfFlags.profileInterval /
+ RtsFlags.MiscFlags.tickInterval;
+ } else {
+ RtsFlags.ProfFlags.profileIntervalTicks = 0;
+ }
if (error) {
const char **p;
diff --git a/rts/Timer.c b/rts/Timer.c
index 0e0b5386b7..586991a4db 100644
--- a/rts/Timer.c
+++ b/rts/Timer.c
@@ -93,5 +93,7 @@ startTimer(void)
void
stopTimer(void)
{
- stopTicker();
+ if (RtsFlags.MiscFlags.tickInterval != 0) {
+ stopTicker();
+ }
}