diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-11-25 13:11:39 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-11-25 16:11:36 +0000 |
commit | 6b1098511aaabd2c9503ee7be6da1944466f9cb4 (patch) | |
tree | 83b3001603c7e6a5cfb3ac04adbb99c40504942e /rts/Task.h | |
parent | 18aae18503442276e14a47eabf4786bc7210662e (diff) | |
download | haskell-6b1098511aaabd2c9503ee7be6da1944466f9cb4.tar.gz |
Time handling overhaul
Terminology cleanup: the type "Ticks" has been renamed "Time", which
is an StgWord64 in units of TIME_RESOLUTION (currently nanoseconds).
The terminology "tick" is now used consistently to mean the interval
between timer signals.
The ticker now always ticks in realtime (actually CLOCK_MONOTONIC if
we have it). Before it used CPU time in the non-threaded RTS and
realtime in the threaded RTS, but I've discovered that the CPU timer
has terrible resolution (at least on Linux) and isn't much use for
profiling. So now we always use realtime. This should also fix
The default tick interval is now 10ms, except when profiling where we
drop it to 1ms. This gives more accurate profiles without affecting
runtime too much (<1%).
Lots of cleanups - the resolution of Time is now in one place
only (Rts.h) rather than having calculations that depend on the
resolution scattered all over the RTS. I hope I found them all.
Diffstat (limited to 'rts/Task.h')
-rw-r--r-- | rts/Task.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/rts/Task.h b/rts/Task.h index 4000a045d4..386e003d28 100644 --- a/rts/Task.h +++ b/rts/Task.h @@ -149,12 +149,12 @@ typedef struct Task_ { // really want separate stats for each call in a nested chain of // foreign->haskell->foreign->haskell calls, but we'll get a // separate Task for each of the haskell calls. - Ticks elapsedtimestart; - Ticks muttimestart; - Ticks mut_time; - Ticks mut_etime; - Ticks gc_time; - Ticks gc_etime; + Time elapsedtimestart; + Time muttimestart; + Time mut_time; + Time mut_etime; + Time gc_time; + Time gc_etime; // Links tasks on the returning_tasks queue of a Capability, and // on spare_workers. @@ -208,7 +208,7 @@ void workerTaskStop (Task *task); void taskTimeStamp (Task *task); // The current Task has finished a GC, record the amount of time spent. -void taskDoneGC (Task *task, Ticks cpu_time, Ticks elapsed_time); +void taskDoneGC (Task *task, Time cpu_time, Time elapsed_time); // Put the task back on the free list, mark it stopped. Used by // forkProcess(). |