]> Cypherpunks repositories - gostls13.git/commit
runtime/pprof, cmd/pprof: fix profiling for PIE
authorIan Lance Taylor <iant@golang.org>
Fri, 27 May 2016 23:03:44 +0000 (16:03 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 31 May 2016 13:02:09 +0000 (13:02 +0000)
commit4223294eab3dee0f6c03fd57fc24be3dc3e2d53a
tree70f810ef844aee4ef2a974661de8f6fb347b97df
parent87ee12cece96ec5837fe89c37899d725e7e852d9
runtime/pprof, cmd/pprof: fix profiling for PIE

In order to support pprof for position independent executables, pprof
needs to adjust the PC addresses stored in the profile by the address at
which the program is loaded. The legacy profiling support which we use
already supports recording the GNU/Linux /proc/self/maps data
immediately after the CPU samples, so do that. Also change the pprof
symbolizer to use the information, if available, when looking up
addresses in the Go pcline data.

Fixes #15714.

Change-Id: I4bf679210ef7c51d85cf873c968ce82db8898e3e
Reviewed-on: https://go-review.googlesource.com/23525
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
12 files changed:
src/cmd/internal/objfile/elf.go
src/cmd/internal/objfile/goobj.go
src/cmd/internal/objfile/macho.go
src/cmd/internal/objfile/objfile.go
src/cmd/internal/objfile/pe.go
src/cmd/internal/objfile/plan9obj.go
src/cmd/pprof/pprof.go
src/go/build/deps_test.go
src/runtime/crash_cgo_test.go
src/runtime/crash_test.go
src/runtime/pprof/pprof.go
src/runtime/pprof/pprof_test.go