summaryrefslogtreecommitdiff
path: root/rts/Trace.c
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2016-06-16 15:03:01 +0200
committerBen Gamari <ben@smart-cactus.org>2016-07-16 20:31:47 +0200
commita9bc54766ddd1bdb011f1656ad58fb409055d08f (patch)
tree4d91f1a2c4c0b44b61c910a11b998bc71154f71a /rts/Trace.c
parentb35e01c6c39d9f2d58009722e24d89049aa94287 (diff)
downloadhaskell-a9bc54766ddd1bdb011f1656ad58fb409055d08f.tar.gz
Log heap profiler samples to event log
Test Plan: Try it Reviewers: hvr, simonmar, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1722 GHC Trac Issues: #11094
Diffstat (limited to 'rts/Trace.c')
-rw-r--r--rts/Trace.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/rts/Trace.c b/rts/Trace.c
index 8480f10bbd..fdf80496f8 100644
--- a/rts/Trace.c
+++ b/rts/Trace.c
@@ -622,6 +622,49 @@ void traceTaskDelete_ (Task *task)
}
}
+void traceHeapProfBegin(StgWord8 profile_id)
+{
+ if (eventlog_enabled) {
+ postHeapProfBegin(profile_id);
+ }
+}
+
+void traceHeapProfSampleBegin(StgInt era)
+{
+ if (eventlog_enabled) {
+ postHeapProfSampleBegin(era);
+ }
+}
+
+void traceHeapProfSampleString(StgWord8 profile_id,
+ const char *label, StgWord residency)
+{
+ if (eventlog_enabled) {
+ postHeapProfSampleString(profile_id, label, residency);
+ }
+}
+
+#ifdef PROFILING
+void traceHeapProfCostCentre(StgWord32 ccID,
+ const char *label,
+ const char *module,
+ const char *srcloc,
+ StgBool is_caf)
+{
+ if (eventlog_enabled) {
+ postHeapProfCostCentre(ccID, label, module, srcloc, is_caf);
+ }
+}
+
+void traceHeapProfSampleCostCentre(StgWord8 profile_id,
+ CostCentreStack *stack, StgWord residency)
+{
+ if (eventlog_enabled) {
+ postHeapProfSampleCostCentre(profile_id, stack, residency);
+ }
+}
+#endif
+
#ifdef DEBUG
static void vtraceCap_stderr(Capability *cap, char *msg, va_list ap)
{