Skip to content

Add requestTickyCounterSamples to GHC.Internal.Profiling

Luite Stegeman requested to merge luite/ghc:reqticky into master

This adds requestTickyCounterSamples :: IO () to GHC.Internal.Profiling to write the current values of the ticky counters to the eventlog (and reset the counters).

I found this useful in combination eventlog trace markers with for profiling a program that repeatedly executes a pipeline with multiple stages (while not doing much in background threads at the same time):

requestTickyCounterSamples
traceMarkerIO "stage1_start"
-- stage 1 here
requestTickyCounterSamples
traceMarkerIO "stage2_start"
-- stage 2 here
requestTickyCounterSamples
traceMarkerIO "stage3_start"
-- stage 3 here
requestTickyCounterSamples
traceMarkerIO "pipeline_end"

A simple ghc-events based program can then group or filter the counts by pipeline stage(s).

Edited by Luite Stegeman

Merge request reports

Loading