mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime/pprof: add race annotations for goroutine profiles
The race annotations for goroutine label maps covered the special type of read necessary to create CPU profiles. Extend that to include goroutine profiles. Annotate the copy involved in creating new goroutines. Fixes #50292 Change-Id: I10f69314e4f4eba85c506590fe4781f4d6b8ec2d Reviewed-on: https://go-review.googlesource.com/c/go/+/385660 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
7c404d59db
commit
209942fa88
3 changed files with 67 additions and 1 deletions
|
|
@ -4155,6 +4155,11 @@ func newproc1(fn *funcval, callergp *g, callerpc uintptr) *g {
|
|||
_p_.goidcache++
|
||||
if raceenabled {
|
||||
newg.racectx = racegostart(callerpc)
|
||||
if newg.labels != nil {
|
||||
// See note in proflabel.go on labelSync's role in synchronizing
|
||||
// with the reads in the signal handler.
|
||||
racereleasemergeg(newg, unsafe.Pointer(&labelSync))
|
||||
}
|
||||
}
|
||||
if trace.enabled {
|
||||
traceGoCreate(newg, newg.startpc)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue