diff options
| author | Rhys Hiltner <rhys@justin.tv> | 2022-02-14 12:16:22 -0800 |
|---|---|---|
| committer | Michael Knyszek <mknyszek@google.com> | 2022-05-03 20:49:07 +0000 |
| commit | 209942fa88ef49e98a0f36dbbfa74c936a8d0fad (patch) | |
| tree | 429acb5bdd6bcbd8ad4f30fc496400ddbbe223fc /src/runtime/mprof.go | |
| parent | 7c404d59db3591a7c5854b38dc0f05fcb7ac0cff (diff) | |
| download | go-209942fa88ef49e98a0f36dbbfa74c936a8d0fad.tar.xz | |
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>
Diffstat (limited to 'src/runtime/mprof.go')
| -rw-r--r-- | src/runtime/mprof.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/mprof.go b/src/runtime/mprof.go index 569c17f0a7..1edb5d6967 100644 --- a/src/runtime/mprof.go +++ b/src/runtime/mprof.go @@ -818,6 +818,10 @@ func goroutineProfileWithLabels(p []StackRecord, labels []unsafe.Pointer) (n int }) } + if raceenabled { + raceacquire(unsafe.Pointer(&labelSync)) + } + startTheWorld() return n, ok } |
