]> Cypherpunks.ru repositories - gostls13.git/commit
runtime/pprof: use new profile buffers for CPU profiling
authorRuss Cox <rsc@golang.org>
Thu, 9 Feb 2017 20:57:57 +0000 (15:57 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 24 Feb 2017 17:01:47 +0000 (17:01 +0000)
commit1a680a902ada111a0d8122e12b42f5b437ba2566
tree9dad4f7454e4b055cd65e2be887bcd5b08a06854
parenta1261b8b0a38814df453defb2fc2cae3ba0c956a
runtime/pprof: use new profile buffers for CPU profiling

This doesn't change the functionality of the current code,
but it sets us up for exporting the profiling labels into the profile.

The old code had a hash table of profile samples maintained
during the signal handler, with evictions going into a log.
The new code just logs every sample directly, leaving the
hash-based deduplication to an ordinary goroutine.

The new code also avoids storing the entire profile in two
forms in memory, an unfortunate regression introduced
when binary profile support was added. After this CL the
entire profile is only stored once in memory. We'd still like
to get back down to storing it zero times (streaming it to
the underlying io.Writer).

Change-Id: I0893a1788267c564aa1af17970d47377b2a43457
Reviewed-on: https://go-review.googlesource.com/36712
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/runtime/cpuprof.go
src/runtime/pprof/pprof.go
src/runtime/pprof/proto.go
src/runtime/pprof/proto_test.go
src/runtime/pprof/protomem_test.go
src/runtime/proc.go