From 4223294eab3dee0f6c03fd57fc24be3dc3e2d53a Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 27 May 2016 16:03:44 -0700 Subject: 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 --- src/cmd/internal/objfile/plan9obj.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/cmd/internal/objfile/plan9obj.go') diff --git a/src/cmd/internal/objfile/plan9obj.go b/src/cmd/internal/objfile/plan9obj.go index 6ee389dc2e..3e34f65ae7 100644 --- a/src/cmd/internal/objfile/plan9obj.go +++ b/src/cmd/internal/objfile/plan9obj.go @@ -147,6 +147,10 @@ func (f *plan9File) goarch() string { return "" } +func (f *plan9File) loadAddress() (uint64, error) { + return 0, fmt.Errorf("unknown load address") +} + func (f *plan9File) dwarf() (*dwarf.Data, error) { return nil, errors.New("no DWARF data in Plan 9 file") } -- cgit v1.3-6-g1900