]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof: clean up call/return PCs in memory profiles
authorAustin Clements <austin@google.com>
Tue, 9 May 2017 02:31:41 +0000 (22:31 -0400)
committerAustin Clements <austin@google.com>
Mon, 15 May 2017 18:20:20 +0000 (18:20 +0000)
commit1dc0f9696b743b10bf0b7b49780bee7f4756499b
treeef59c31d252ca77300c180b769e188230597ff88
parent1d44c4e37847a975c40f8f15df7914939b540f6b
runtime/pprof: clean up call/return PCs in memory profiles

Proto profile conversion is inconsistent about call vs return PCs in
profile locations. The proto defines locations to be call PCs. This is
what we do when proto-izing CPU profiles, but we fail to convert the
return PCs in memory and count profile stacks to call PCs when
converting them to proto locations.

Fix this in the heap and count profile conversion functions.
TestConvertMemProfile also hard-codes this failure to convert from
return PCs to call PCs, so fix up the addresses in the synthesized
profile to be return PCs while checking that we get call PCs out of
the conversion.

Change-Id: If1fc028b86fceac6d71a2d9fa6c41ff442c89296
Reviewed-on: https://go-review.googlesource.com/42951
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
src/runtime/pprof/pprof.go
src/runtime/pprof/proto.go
src/runtime/pprof/protomem.go
src/runtime/pprof/protomem_test.go