summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2020-12-07 13:19:28 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-03 08:12:29 -0500
commitd89deeba47ce04a5198a71fa4cbc203fe2c90794 (patch)
tree8f879bbb0774ce686e1688cc638ef22179babf51 /rts/Schedule.c
parentd8dc0f96237fe6fe7081c04727c7c2573477e5cb (diff)
downloadhaskell-d89deeba47ce04a5198a71fa4cbc203fe2c90794.tar.gz
Profiling: Allow heap profiling to be controlled dynamically.
This patch exposes three new functions in `GHC.Profiling` which allow heap profiling to be enabled and disabled dynamically. 1. startHeapProfTimer - Starts heap profiling with the given RTS options 2. stopHeapProfTimer - Stops heap profiling 3. requestHeapCensus - Perform a heap census on the next context switch, regardless of whether the timer is enabled or not.
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 390e505cf2..d9d5c9a74a 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -416,7 +416,7 @@ run_thread:
// that.
cap->r.rCurrentTSO = t;
- startHeapProfTimer();
+ resumeHeapProfTimer();
// ----------------------------------------------------------------------
// Run the current thread
@@ -534,7 +534,7 @@ run_thread:
// ----------------------------------------------------------------------
// Costs for the scheduler are assigned to CCS_SYSTEM
- stopHeapProfTimer();
+ pauseHeapProfTimer();
#if defined(PROFILING)
cap->r.rCCCS = CCS_SYSTEM;
#endif