diff options
| author | Michael Pratt <mpratt@google.com> | 2025-12-01 15:47:33 -0500 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2025-12-01 14:59:40 -0800 |
| commit | f22d37d574836ed4f1b42e283dda55dbd4d80aca (patch) | |
| tree | aa8fbb0434b2498258c46919d7d90f9837f433d1 /src/runtime/testdata | |
| parent | 8b5db48db11f6ec075fd1ea528a5d611579c3a0d (diff) | |
| download | go-f22d37d574836ed4f1b42e283dda55dbd4d80aca.tar.xz | |
runtime/internal/testprog: log initial SchedMetrics GOMAXPROCS
For #76613.
Change-Id: I6a6a636ccf28676b9cd1f820bbe42c2f3e974fee
Reviewed-on: https://go-review.googlesource.com/c/go/+/725660
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Diffstat (limited to 'src/runtime/testdata')
| -rw-r--r-- | src/runtime/testdata/testprog/schedmetrics.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/runtime/testdata/testprog/schedmetrics.go b/src/runtime/testdata/testprog/schedmetrics.go index bc0906330f..8e8abc4484 100644 --- a/src/runtime/testdata/testprog/schedmetrics.go +++ b/src/runtime/testdata/testprog/schedmetrics.go @@ -72,6 +72,9 @@ func SchedMetrics() { } } + initialGMP := runtime.GOMAXPROCS(-1) + logf("Initial GOMAXPROCS=%d", initialGMP) + // generalSlack is the amount of goroutines we allow ourselves to be // off by in any given category, either due to background system // goroutines. This excludes GC goroutines. @@ -80,7 +83,7 @@ func SchedMetrics() { // waitingSlack is the max number of blocked goroutines controlled // by the runtime that we'll allow for. This includes GC goroutines // as well as finalizer and cleanup goroutines. - waitingSlack := generalSlack + uint64(2*runtime.GOMAXPROCS(-1)) + waitingSlack := generalSlack + uint64(2*initialGMP) // threadsSlack is the maximum number of threads left over // from the runtime (sysmon, the template thread, etc.) |
