diff options
| author | Peter Weinberger <pjw@google.com> | 2016-09-22 09:48:30 -0400 |
|---|---|---|
| committer | Peter Weinberger <pjw@google.com> | 2016-10-28 11:47:16 +0000 |
| commit | ca922b6d363b6ca47822188dcbc5b92d912c7a4b (patch) | |
| tree | 5bee54a86cd9db992e5d77e735b94d9a0eed9a17 /src/runtime/proc.go | |
| parent | b679665a182bd6ec2989ae759df6b11142921cfb (diff) | |
| download | go-ca922b6d363b6ca47822188dcbc5b92d912c7a4b.tar.xz | |
runtime: Profile goroutines holding contended mutexes.
runtime.SetMutexProfileFraction(n int) will capture 1/n-th of stack
traces of goroutines holding contended mutexes if n > 0. From runtime/pprof,
pprot.Lookup("mutex").WriteTo writes the accumulated
stack traces to w (in essentially the same format that blocking
profiling uses).
Change-Id: Ie0b54fa4226853d99aa42c14cb529ae586a8335a
Reviewed-on: https://go-review.googlesource.com/29650
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/proc.go')
| -rw-r--r-- | src/runtime/proc.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go index 9fc24e3ae3..8b57514ac0 100644 --- a/src/runtime/proc.go +++ b/src/runtime/proc.go @@ -923,7 +923,7 @@ func restartg(gp *g) { // in panic or being exited, this may not reliably stop all // goroutines. func stopTheWorld(reason string) { - semacquire(&worldsema, false) + semacquire(&worldsema, 0) getg().m.preemptoff = reason systemstack(stopTheWorldWithSema) } @@ -946,7 +946,7 @@ var worldsema uint32 = 1 // preemption first and then should stopTheWorldWithSema on the system // stack: // -// semacquire(&worldsema, false) +// semacquire(&worldsema, 0) // m.preemptoff = "reason" // systemstack(stopTheWorldWithSema) // |
