From ec549fc10671e8d9c4c7d8594b8ae7acf91a6062 Mon Sep 17 00:00:00 2001 From: Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> Date: Fri, 15 Mar 2019 21:03:18 +0100 Subject: [PATCH] perf_hooks: reset prev_ before starting ELD timer reset `ELDHistogram.prev_` before staring timer to ensure that start timer doesn't leak across `disable()` `enable()` calls. --- src/node_perf.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node_perf.cc b/src/node_perf.cc index e16be29a872f80..1ca5cd5e01ea47 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -539,6 +539,7 @@ bool ELDHistogram::RecordDelta() { bool ELDHistogram::Enable() { if (enabled_) return false; enabled_ = true; + prev_ = 0; uv_timer_start(timer_, ELDHistogramDelayInterval, resolution_,