From 13df972f6885ebdeba1ea38f0acd99ea0f2bfb49 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Wed, 23 Jul 2025 17:35:54 +0000 Subject: runtime/metrics: add metrics for goroutine sched states This is largely a port of CL 38180. For #15490. Change-Id: I2726111e472e81e9f9f0f294df97872c2689f061 Reviewed-on: https://go-review.googlesource.com/c/go/+/690397 Reviewed-by: Michael Pratt Auto-Submit: Michael Knyszek LUCI-TryBot-Result: Go LUCI --- src/runtime/mprof.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/runtime/mprof.go') diff --git a/src/runtime/mprof.go b/src/runtime/mprof.go index b2ff257f65..97b2907652 100644 --- a/src/runtime/mprof.go +++ b/src/runtime/mprof.go @@ -1308,7 +1308,7 @@ func goroutineProfileWithLabelsConcurrent(p []profilerecord.StackRecord, labels // allocation estimate without bothering to STW. As long as // this is close, then we'll only need to STW once (on the next // call). - return int(gcount()), false + return int(gcount(false)), false } semacquire(&goroutineProfile.sema) @@ -1324,7 +1324,7 @@ func goroutineProfileWithLabelsConcurrent(p []profilerecord.StackRecord, labels // goroutines that can vary between user and system to ensure that the count // doesn't change during the collection. So, check the finalizer goroutine // and cleanup goroutines in particular. - n = int(gcount()) + n = int(gcount(false)) if fingStatus.Load()&fingRunningFinalizer != 0 { n++ } -- cgit v1.3