aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Hillegeer <aktau@google.com>2024-12-12 08:35:17 -0800
committerGopher Robot <gobot@golang.org>2025-02-18 08:13:46 -0800
commitecda82012d3cff21c758fa45eb5e86365015a131 (patch)
tree0ee538b8522f38a6b598562ca7189ae021d860c5 /src
parent81c66e71d480ae2372b7eea4bcdf600b50fdd5e1 (diff)
downloadgo-ecda82012d3cff21c758fa45eb5e86365015a131.tar.xz
runtime: only read pp.m in schedtrace if needed
Change-Id: Iad3353431a2ef97c1e0c440bdd84b78cb5ea990e Reviewed-on: https://go-review.googlesource.com/c/go/+/635635 Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Nicolas Hillegeer <aktau@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src')
-rw-r--r--src/runtime/proc.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index ce6cf88d0c..c9d04edd07 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -6391,11 +6391,11 @@ func schedtrace(detailed bool) {
// Even if we hold schedlock, most data can be changed concurrently.
// E.g. (p->m ? p->m->id : -1) can crash if p->m changes from non-nil to nil.
for i, pp := range allp {
- mp := pp.m.ptr()
h := atomic.Load(&pp.runqhead)
t := atomic.Load(&pp.runqtail)
if detailed {
print(" P", i, ": status=", pp.status, " schedtick=", pp.schedtick, " syscalltick=", pp.syscalltick, " m=")
+ mp := pp.m.ptr()
if mp != nil {
print(mp.id)
} else {