diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2019-10-09 14:32:13 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-23 05:58:58 -0400 |
commit | 17987a4b665d4a270b1bebba1f61d67887f2653c (patch) | |
tree | 922a01003b495c1a0cdf9457f7ecbb4985e20578 /rts/Proftimer.c | |
parent | b521e8b698cc415684fbc0ea5ddfab51077cb144 (diff) | |
download | haskell-17987a4b665d4a270b1bebba1f61d67887f2653c.tar.gz |
eventlog: Dump cost centre stack on each sample
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 |