mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
87ee12cece
commit
4223294eab
12 changed files with 128 additions and 15 deletions
|
|
@ -94,6 +94,10 @@ func (f *goobjFile) goarch() string {
|
|||
return "GOARCH unimplemented for debug/goobj files"
|
||||
}
|
||||
|
||||
func (f *goobjFile) loadAddress() (uint64, error) {
|
||||
return 0, fmt.Errorf("unknown load address")
|
||||
}
|
||||
|
||||
func (f *goobjFile) dwarf() (*dwarf.Data, error) {
|
||||
return nil, errors.New("no DWARF data in go object file")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue