aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vendor/github.com/google/pprof/internal/driver
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/internal/driver
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/internal/driver')
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go2
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go6
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/driver/webhtml.go21
3 files changed, 10 insertions, 19 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go
index 492400c5f3..237cc33233 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/cli.go
@@ -98,7 +98,7 @@ func parseFlags(o *plugin.Options) (*source, []string, error) {
// Recognize first argument as an executable or buildid override.
if len(args) > 1 {
arg0 := args[0]
- if file, err := o.Obj.Open(arg0, 0, ^uint64(0), 0); err == nil {
+ if file, err := o.Obj.Open(arg0, 0, ^uint64(0), 0, ""); err == nil {
file.Close()
execName = arg0
args = args[1:]
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go
index b8a69e87fc..0b361651bc 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/fetch.go
@@ -420,12 +420,14 @@ mapping:
fileNames = append(fileNames, filepath.Join(path, m.File))
}
for _, name := range fileNames {
- if f, err := obj.Open(name, m.Start, m.Limit, m.Offset); err == nil {
+ if f, err := obj.Open(name, m.Start, m.Limit, m.Offset, m.KernelRelocationSymbol); err == nil {
defer f.Close()
fileBuildID := f.BuildID()
if m.BuildID != "" && m.BuildID != fileBuildID {
ui.PrintErr("Ignoring local file " + name + ": build-id mismatch (" + m.BuildID + " != " + fileBuildID + ")")
} else {
+ // Explicitly do not update KernelRelocationSymbol --
+ // the new local file name is most likely missing it.
m.File = name
continue mapping
}
@@ -449,6 +451,8 @@ mapping:
if execName, buildID := s.ExecName, s.BuildID; execName != "" || buildID != "" {
m := p.Mapping[0]
if execName != "" {
+ // Explicitly do not update KernelRelocationSymbol --
+ // the source override is most likely missing it.
m.File = execName
}
if buildID != "" {
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/webhtml.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/webhtml.go
index b9c73271b8..63df668321 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/driver/webhtml.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/webhtml.go
@@ -17,13 +17,11 @@ package driver
import (
"html/template"
- "github.com/google/pprof/third_party/d3"
"github.com/google/pprof/third_party/d3flamegraph"
)
// addTemplates adds a set of template definitions to templates.
func addTemplates(templates *template.Template) {
- template.Must(templates.Parse(`{{define "d3script"}}` + d3.JSSource + `{{end}}`))
template.Must(templates.Parse(`{{define "d3flamegraphscript"}}` + d3flamegraph.JSSource + `{{end}}`))
template.Must(templates.Parse(`{{define "d3flamegraphcss"}}` + d3flamegraph.CSSSource + `{{end}}`))
template.Must(templates.Parse(`
@@ -1329,40 +1327,29 @@ function viewer(baseUrl, nodes) {
</div>
{{template "script" .}}
<script>viewer(new URL(window.location.href), {{.Nodes}});</script>
- <script>{{template "d3script" .}}</script>
<script>{{template "d3flamegraphscript" .}}</script>
<script>
var data = {{.FlameGraph}};
var width = document.getElementById('chart').clientWidth;
- var flameGraph = d3.flamegraph()
+ var flameGraph = flamegraph()
.width(width)
.cellHeight(18)
.minFrameSize(1)
.transitionDuration(750)
- .transitionEase(d3.easeCubic)
.inverted(true)
.sort(true)
.title('')
.tooltip(false)
- .details(document.getElementById('flamegraphdetails'));
+ .setDetailsElement(document.getElementById('flamegraphdetails'));
// <full name> (percentage, value)
flameGraph.label((d) => d.data.f + ' (' + d.data.p + ', ' + d.data.l + ')');
- (function(flameGraph) {
- var oldColorMapper = flameGraph.color();
- function colorMapper(d) {
- // Hack to force default color mapper to use 'warm' color scheme by not passing libtype
- const { data, highlight } = d;
- return oldColorMapper({ data: { n: data.n }, highlight });
- }
-
- flameGraph.color(colorMapper);
- }(flameGraph));
+ flameGraph.setColorHue('warm');
- d3.select('#chart')
+ select('#chart')
.datum(data)
.call(flameGraph);