summaryrefslogtreecommitdiff
path: root/rts/Trace.c
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2019-10-09 14:32:13 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2019-10-16 11:03:18 +0100
commit0ce834af05a0d994ba991d61800124093fa878dd (patch)
tree653eee37cf616b943fd9f8f0f45e1aceb95270af /rts/Trace.c
parent1357d02380641ba33b05eb87c80e6a4250cd4a3b (diff)
downloadhaskell-wip/ccs-sample-events.tar.gz
eventlog: Dump cost centre stack on each samplewip/ccs-sample-events
With this change it is possible to reconstruct the timing portion of a `.prof` file after the fact. By logging the stacks at each time point a more precise executation trace of the program can be observed rather than all identical cost centres being identified in the report. There are two new events: 1. `EVENT_PROF_BEGIN` - emitted at the start of profiling to communicate the tick interval 2. `EVENT_PROF_SAMPLE_COST_CENTRE` - emitted on each tick to communicate the current call stack. Fixes #17322
Diffstat (limited to 'rts/Trace.c')
-rw-r--r--rts/Trace.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/rts/Trace.c b/rts/Trace.c
index de647f762b..c8a951a510 100644
--- a/rts/Trace.c
+++ b/rts/Trace.c
@@ -656,6 +656,7 @@ void traceHeapProfCostCentre(StgWord32 ccID,
}
}
+// This one is for .hp samples
void traceHeapProfSampleCostCentre(StgWord8 profile_id,
CostCentreStack *stack, StgWord residency)
{
@@ -663,6 +664,21 @@ void traceHeapProfSampleCostCentre(StgWord8 profile_id,
postHeapProfSampleCostCentre(profile_id, stack, residency);
}
}
+
+// This one is for .prof samples
+void traceProfSampleCostCentre(Capability *cap,
+ CostCentreStack *stack, StgWord tick)
+{
+ if (eventlog_enabled) {
+ postProfSampleCostCentre(cap, stack, tick);
+ }
+}
+void traceProfBegin(void)
+{
+ if (eventlog_enabled) {
+ postProfBegin();
+ }
+}
#endif
#if defined(DEBUG)