]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: Profile goroutines holding contended mutexes.
authorPeter Weinberger <pjw@google.com>
Thu, 22 Sep 2016 13:48:30 +0000 (09:48 -0400)
committerPeter Weinberger <pjw@google.com>
Fri, 28 Oct 2016 11:47:16 +0000 (11:47 +0000)
commitca922b6d363b6ca47822188dcbc5b92d912c7a4b
tree5bee54a86cd9db992e5d77e735b94d9a0eed9a17
parentb679665a182bd6ec2989ae759df6b11142921cfb
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>
15 files changed:
src/cmd/go/test.go
src/cmd/go/testflag.go
src/cmd/internal/pprof/profile/legacy_profile.go
src/runtime/mgc.go
src/runtime/mprof.go
src/runtime/pprof/pprof.go
src/runtime/pprof/pprof_test.go
src/runtime/proc.go
src/runtime/runtime2.go
src/runtime/sema.go
src/runtime/trace.go
src/sync/mutex.go
src/sync/mutex_test.go
src/sync/runtime.go
src/testing/testing.go