]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: increase systemstack calls in TestLabelSystemstack
authorMichael Pratt <mpratt@google.com>
Wed, 8 Dec 2021 20:30:28 +0000 (15:30 -0500)
committerMichael Pratt <mpratt@google.com>
Wed, 8 Dec 2021 23:00:01 +0000 (23:00 +0000)
commitf5ddd94334a63ac8107c976aa4bd6ee2171d7d64
tree8822aea0af26718674b47fa2eb639dac70603463
parentbb9b20a15d637667614ec4a312f216bd4c67b76a
runtime/pprof: increase systemstack calls in TestLabelSystemstack

TestLabelSystemstack needs to collect samples within runtime.systemstack
to complete the test.

The current approach uses fmt.Fprintf, which gets into systemstack
through the allocator and GC, but also does lots of other work. In my
measurements, approximately 2% of samples contain runtime.systemstack.

The new approach uses debug.SetGCPercent, which uses systemstack for
most of its work, including contention on mheap_.lock, which extends
usage even more. In my measurements, approximately 99% of samples
contain runtime.systemstack.

Fixes #50050

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