diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2019-10-09 14:32:13 +0100 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2019-10-16 11:03:18 +0100 |
commit | 0ce834af05a0d994ba991d61800124093fa878dd (patch) | |
tree | 653eee37cf616b943fd9f8f0f45e1aceb95270af /rts/Proftimer.c | |
parent | 1357d02380641ba33b05eb87c80e6a4250cd4a3b (diff) | |
download | haskell-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/Proftimer.c')
-rw-r--r-- | rts/Proftimer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/rts/Proftimer.c b/rts/Proftimer.c index eb4a932cdb..68a73a5446 100644 --- a/rts/Proftimer.c +++ b/rts/Proftimer.c @@ -12,6 +12,7 @@ #include "Profiling.h" #include "Proftimer.h" #include "Capability.h" +#include "Trace.h" #if defined(PROFILING) static bool do_prof_ticks = false; // enable profiling ticks @@ -77,6 +78,7 @@ handleProfTick(void) uint32_t n; for (n=0; n < n_capabilities; n++) { capabilities[n]->r.rCCCS->time_ticks++; + traceProfSampleCostCentre(capabilities[n], capabilities[n]->r.rCCCS, total_ticks); } } #endif |