From 9ed2a6d2c935e2c4671568951fee044561df0174 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. PR-URL: https://github.com/nodejs/node/pull/26693 Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig Reviewed-By: Yongsheng Zhang --- 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_,