aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vendor/github.com/google/pprof/profile/encode.go
diff options
context:
space:
mode:
authorHeschi Kreinick <heschi@google.com>2022-03-16 18:17:58 -0400
committerGopher Robot <gobot@golang.org>2022-03-18 18:48:36 +0000
commit7e5804cb7014bf3154542a3d2afc68c3a61b7452 (patch)
tree7de804293b5c1d7057bff7924cce0bf5648e464b /src/cmd/vendor/github.com/google/pprof/profile/encode.go
parent9f252a0462bd8c279beec56d1538e8a6c26c44c5 (diff)
downloadgo-7e5804cb7014bf3154542a3d2afc68c3a61b7452.tar.xz
cmd: update vendored pprof
go get github.com/google/pprof@latest go mod vendor Plus a tiny change to the pprof command to match an upstream interface change. Updates #36905. Change-Id: I4c7bbe8c317a6eeb217fce971b208f96ab0727fa Reviewed-on: https://go-review.googlesource.com/c/go/+/393370 Trust: Heschi Kreinick <heschi@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com> Auto-Submit: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/cmd/vendor/github.com/google/pprof/profile/encode.go')
-rw-r--r--src/cmd/vendor/github.com/google/pprof/profile/encode.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/profile/encode.go b/src/cmd/vendor/github.com/google/pprof/profile/encode.go
index ab7f03ae26..96aa271e54 100644
--- a/src/cmd/vendor/github.com/google/pprof/profile/encode.go
+++ b/src/cmd/vendor/github.com/google/pprof/profile/encode.go
@@ -17,6 +17,7 @@ package profile
import (
"errors"
"sort"
+ "strings"
)
func (p *Profile) decoder() []decoder {
@@ -252,6 +253,14 @@ func (p *Profile) postDecode() error {
} else {
mappings[m.ID] = m
}
+
+ // If this a main linux kernel mapping with a relocation symbol suffix
+ // ("[kernel.kallsyms]_text"), extract said suffix.
+ // It is fairly hacky to handle at this level, but the alternatives appear even worse.
+ if strings.HasPrefix(m.File, "[kernel.kallsyms]") {
+ m.KernelRelocationSymbol = strings.ReplaceAll(m.File, "[kernel.kallsyms]", "")
+ }
+
}
functions := make(map[uint64]*Function, len(p.Function))