1
0
mirror of https://github.com/golang/go synced 2024-11-17 12:54:47 -07:00
The Go programming language
Go to file
Michael Anthony Knyszek b6b72c775a runtime: emit a ProcSteal from entersyscall_gcwait
Currently entersyscall_gcwait always emits a ProcStop event. Most of the
time, this is correct, since the thread that just put the P into
_Psyscall is the same one that is putting it into _Pgcstop. However it's
possible for another thread to steal the P, start running a goroutine,
and then enter another syscall, putting the P back into _Psyscall. In
this case ProcStop is incorrect; the P is getting stolen. This leads to
broken traces.

Fix this by always emitting a ProcSteal event from entersyscall_gcwait.
This means that most of the time a thread will be 'stealing' the proc
from itself when it enters this function, but that's theoretically fine.
A ProcSteal is really just a fancy ProcStop.

Well, it would be if the parser correctly handled a self-steal. This is
a minor bug that just never came up before, but it's an update order
error (the mState is looked up and modified, but then it's modified
again at the end of the function to match newCtx). There's really no
reason a self-steal shouldn't be allowed, so fix that up and add a test.

Change-Id: Iec3d7639d331e3f2d127f92ce50c2c4a7818fcd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/544215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
2023-11-21 22:29:44 +00:00
.github .github: issue template for telemetry proposals 2023-09-14 21:29:10 +00:00
api Revert "math/rand/v2: add ChaCha8" 2023-11-20 18:39:03 +00:00
doc crypto/tls: disable ExportKeyingMaterial without EMS 2023-11-21 16:29:49 +00:00
lib/time
misc misc/wasm: support new wasmtime CLI 2023-11-19 21:11:54 +00:00
src runtime: emit a ProcSteal from entersyscall_gcwait 2023-11-21 22:29:44 +00:00
test cmd/compile/internal/walk: copy SSA-able variables 2023-11-21 20:34:12 +00:00
.gitattributes
.gitignore
codereview.cfg
CONTRIBUTING.md
go.env
LICENSE
PATENTS
README.md
SECURITY.md SECURITY.md: update the Reporting a Vulnerability link 2023-09-22 21:17:24 +00:00

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 4.0 Attributions license.

Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at https://go.dev/dl/.

After downloading a binary release, visit https://go.dev/doc/install for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.

Contributing

Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.

Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.