]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: compare all samples vs rusage in TestCPUProfileMultithreadMagnitude
authorMichael Pratt <mpratt@google.com>
Wed, 19 Jan 2022 19:25:12 +0000 (14:25 -0500)
committerMichael Pratt <mpratt@google.com>
Wed, 19 Jan 2022 20:07:20 +0000 (20:07 +0000)
commitd1640d86522c08e662eec86de985e9781e879e20
tree490eba975983fd04325075c407adf9db73c02f28
parentefbecc7eff88a0d54f3ea9fca290e1808e197ae2
runtime/pprof: compare all samples vs rusage in TestCPUProfileMultithreadMagnitude

TestCPUProfileMultithreadMagnitude compares pprof results vs OS rusage
to verify that pprof is capturing all CPU usage. Presently it compares
the sum of cpuHog1 samples vs rusage. However, background usage from the
scheduler, GC, etc can cause additional CPU usage causing test failures
if rusage is too far off from the cpuHog1 samples.

That said, this test doesn't actually need to care about cpuHog1
samples. It simply cares that pprof samples match rusage, not what the
breakdown of usage was. As a result, we can compare the sum of _all_
pprof samples vs rusage, which should implicitly include any background
CPU usage.

Fixes #50097.

Change-Id: I649a18de5b3dcf58b62be5962fa508d14cd4dc79
Reviewed-on: https://go-review.googlesource.com/c/go/+/379535
Trust: Michael Pratt <mpratt@google.com>
Run-TryBot: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/runtime/pprof/pprof_test.go