summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-12-21 21:23:00 -0500
committerBen Gamari <ben@smart-cactus.org>2021-01-06 22:37:22 -0500
commit578b7ea28cd0b41bf99a91b0c5853b27037f5993 (patch)
tree0632257d470915444087b7aa15774c72068e79b5
parent0a6518bbcf241c06ef0ac7e13d6ca61b9f2712a9 (diff)
downloadhaskell-wip/ticky-eventlog.tar.gz
rts/eventlog: Reset ticky counters after dumping samplewip/ticky-eventlog
-rw-r--r--docs/users_guide/eventlog-formats.rst2
-rw-r--r--rts/eventlog/EventLog.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/docs/users_guide/eventlog-formats.rst b/docs/users_guide/eventlog-formats.rst
index 3c274ceea9..e0f4430a3f 100644
--- a/docs/users_guide/eventlog-formats.rst
+++ b/docs/users_guide/eventlog-formats.rst
@@ -885,4 +885,4 @@ entry counters to the eventlog.
:field Word64: number of times this has been allocated (words). Only
produced for modules compiled with :ghc-flag:`-ticky-allocd`.
- Records the counter statistics at a moment in time.
+ Records the number of "ticks" recorded by a ticky-ticky counter single the last sample.
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index 6c7d1e836c..8aeea789e6 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -1524,6 +1524,10 @@ static void postTickyCounterSample(EventsBuf *eb, StgEntCounter *p)
postWord64(eb, p->entry_count);
postWord64(eb, p->allocs);
postWord64(eb, p->allocd);
+
+ p->entry_count = 0;
+ p->allocs = 0;
+ p->allocd = 0;
}
void postTickyCounterSamples(StgEntCounter *counters)