aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/runtime2.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2023-05-10 20:36:08 +0000
committerGopher Robot <gobot@golang.org>2023-05-17 14:45:42 +0000
commit2f35a655e73837a95941eeda00f56c799ee64591 (patch)
tree36116dda3a71eb925765206fa09d72740d7c941d /src/runtime/runtime2.go
parentc213c905a29b3bce31b99ae91326bbaea106cc16 (diff)
downloadgo-2f35a655e73837a95941eeda00f56c799ee64591.tar.xz
runtime: capture per-m trace state in a type
More tightening up of the tracer's interface. While we're here, clarify why waittraceskip isn't included by explaining what the wait* fields in the M are really for. Change-Id: I0e7b4cac79fb77a7a0b3ca6b6cc267668e3610bc Reviewed-on: https://go-review.googlesource.com/c/go/+/494190 Auto-Submit: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/runtime2.go')
-rw-r--r--src/runtime/runtime2.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index 9e702aa033..0350052a25 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -577,13 +577,17 @@ type m struct {
lockedExt uint32 // tracking for external LockOSThread
lockedInt uint32 // tracking for internal lockOSThread
nextwaitm muintptr // next m waiting for lock
+
+ // wait* are used to carry arguments from gopark into park_m, because
+ // there's no stack to put them on. That is their sole purpose.
waitunlockf func(*g, unsafe.Pointer) bool
waitlock unsafe.Pointer
waittraceev byte
waittraceskip int
- startingtrace bool
- syscalltick uint32
- freelink *m // on sched.freem
+
+ syscalltick uint32
+ freelink *m // on sched.freem
+ trace mTraceState
// these are here because they are too large to be on the stack
// of low-level NOSPLIT functions.