summaryrefslogtreecommitdiff
path: root/rts/RtsFlags.c
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 /rts/RtsFlags.c
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.
Diffstat (limited to 'rts/RtsFlags.c')
-rw-r--r--rts/RtsFlags.c24
1 files changed, 18 insertions, 6 deletions
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;