]> Cypherpunks repositories - gostls13.git/commit
runtime: avoid new linkname for goroutine profiles
authorMichael Pratt <mpratt@google.com>
Tue, 30 Jan 2024 16:01:05 +0000 (11:01 -0500)
committerGopher Robot <gobot@golang.org>
Tue, 30 Jan 2024 16:34:07 +0000 (16:34 +0000)
commit65f056d07ad1db7dd4fb23c4d35cf7b8bd0d6008
treeb875be427cd4c49c3e8f9cfe2a0e5af7d5091eaa
parentb89ad464510e643c23df28bc5c181ad0a16773bf
runtime: avoid new linkname for goroutine profiles

CL 464349 added a new linkname to provide gcount to runtime/pprof to
avoid a STW when estimating the goroutine profile allocation size.

However, adding a linkname here isn't necessary for a few reasons:

1. We already export gcount via NumGoroutines. I completely forgot about
   this during review.
2. aktau suggested that goroutineProfileWithLabelsConcurrent return
   gcount as a fast path estimate when the input is empty.

The second point keeps the code cleaner overall, so I've done that.

For #54014.

Change-Id: I6cb0811a769c805e269b55774cdd43509854078e
Reviewed-on: https://go-review.googlesource.com/c/go/+/559515
Auto-Submit: Michael Pratt <mpratt@google.com>
Auto-Submit: Nicolas Hillegeer <aktau@google.com>
Reviewed-by: Nicolas Hillegeer <aktau@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/runtime/mprof.go
src/runtime/pprof/pprof.go