]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: fix block profile bias
authorFelix Geisendörfer <felix.geisendoerfer@datadoghq.com>
Fri, 26 Feb 2021 13:41:19 +0000 (14:41 +0100)
committerMichael Pratt <mpratt@google.com>
Tue, 27 Apr 2021 18:54:49 +0000 (18:54 +0000)
commit0ae9c3b98bf01862f11d764ee379bebc29a76431
tree519de0afcb3e0158524171286d5e31a6729ea24d
parent8e0023b81b81352c1f8ea5cd58eea91939924f9d
runtime/pprof: fix block profile bias

Block profiles were biased towards infrequent long events over frequent
short events. This fix corrects the bias by aggregating shorter events
as longer but less frequent in the profiles. As a result their
cumulative duration will be accurately represented in the profile
without skewing their sample mean (duration/count).

Credit to @dvyukov for suggesting to adjust the count in the
saveblockevent function.

Fixes #44192.

Change-Id: I71a99d7f6ebdb2d484d44890a2517863cceb4004
Reviewed-on: https://go-review.googlesource.com/c/go/+/299991
Trust: Michael Pratt <mpratt@google.com>
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mprof.go
src/runtime/pprof/pprof_test.go