From 022bd0fd1091a29a41fa4c065ac35e45e3d6c576 Mon Sep 17 00:00:00 2001 From: Bhasker Hariharan Date: Wed, 22 May 2019 18:56:18 -0700 Subject: Fix the signature for gopark. gopark's signature was changed from having a string reason to a uint8. See: https://github.com/golang/go/commit/4d7cf3fedbc382215df5ff6167ee9782a9cc9375 This broke execution tracing of the sentry. Switching to the right signature makes tracing work again. Updates #220 PiperOrigin-RevId: 249565311 Change-Id: If77fd276cecb37d4003c8222f6de510b8031a074 --- pkg/sleep/sleep_unsafe.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'pkg/sleep') diff --git a/pkg/sleep/sleep_unsafe.go b/pkg/sleep/sleep_unsafe.go index 62e0abc34..0526f52de 100644 --- a/pkg/sleep/sleep_unsafe.go +++ b/pkg/sleep/sleep_unsafe.go @@ -12,6 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +// +build go1.11 +// +build !go1.13 + // Package sleep allows goroutines to efficiently sleep on multiple sources of // notifications (wakers). It offers O(1) complexity, which is different from // multi-channel selects which have O(n) complexity (where n is the number of @@ -85,7 +88,7 @@ var ( ) //go:linkname gopark runtime.gopark -func gopark(unlockf func(uintptr, *uintptr) bool, wg *uintptr, reason string, traceEv byte, traceskip int) +func gopark(unlockf func(uintptr, *uintptr) bool, wg *uintptr, reason uint8, traceEv byte, traceskip int) //go:linkname goready runtime.goready func goready(g uintptr, traceskip int) @@ -179,7 +182,10 @@ func (s *Sleeper) nextWaker(block bool) *Waker { // commitSleep to decide whether to immediately // wake the caller up or to leave it sleeping. const traceEvGoBlockSelect = 24 - gopark(commitSleep, &s.waitingG, "sleeper", traceEvGoBlockSelect, 0) + // See:runtime2.go in the go runtime package for + // the values to pass as the waitReason here. + const waitReasonSelect = 9 + gopark(commitSleep, &s.waitingG, waitReasonSelect, traceEvGoBlockSelect, 0) } // Pull the shared list out and reverse it in the local -- cgit v1.2.3