Commit b01288d5 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

rts: Disable tick timer unless really needed

Trac #9105 notes significant CPU usage by an otherwise idle process when
compiled with profiling. The reason for this is that we keep the tick
timer active in the profiling RTS even if profiling wasn't requested at
runtime.

If the user requests any sort of profiling then we need to keep the
timer active to ensure that samples are collected.

Test Plan: Validate, check CPU usage, ensure profiling still works

Reviewers: simonmar, austin

Reviewed By: simonmar, austin

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1822

GHC Trac Issues: #9105
parent 4d51bfc8
......@@ -72,10 +72,15 @@ handle_tick(int unused STG_UNUSED)
#endif
} else {
recent_activity = ACTIVITY_DONE_GC;
// disable timer signals (see #1623, #5991)
// but only if we're not profiling
// disable timer signals (see #1623, #5991, #9105)
// but only if we're not profiling (e.g. passed -h or -p RTS
// flags). If we are profiling we need to keep the timer active
// so that samples continue to be collected.
#ifndef PROFILING
stopTimer();
if (!(RtsFlags.ProfFlags.doHeapProfile
|| RtsFlags.CcFlags.doCostCentres)) {
stopTimer();
}
#endif
}
} else {
......
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