From cffd7a3ec47bc2553b6f080399633123fa3cfc1d Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Mon, 26 Jan 2026 11:53:10 -0500 Subject: cmd/pprof: update vendored github.com/google/pprof Pull in the latest published version of github.com/google/pprof as part of the continuous process of keeping Go's dependencies up to date. For #36905. [git-generate] cd src/cmd go get github.com/google/pprof@v0.0.0-20260115054156-294ebfa9ad83 go mod tidy go mod vendor Change-Id: Ife3c2d40fa9c34e69cdde27b5c7846e499094abf Reviewed-on: https://go-review.googlesource.com/c/go/+/739300 Reviewed-by: Carlos Amedee Reviewed-by: Florian Lehner LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov Auto-Submit: Dmitri Shuralyov --- .../vendor/github.com/google/pprof/internal/driver/settings.go | 2 +- src/cmd/vendor/github.com/google/pprof/internal/driver/svg.go | 2 +- src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go | 2 +- .../vendor/github.com/google/pprof/internal/graph/dotgraph.go | 6 +++--- src/cmd/vendor/github.com/google/pprof/internal/report/report.go | 2 +- src/cmd/vendor/github.com/google/pprof/internal/report/source.go | 9 +++++---- src/cmd/vendor/github.com/google/pprof/profile/profile.go | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) (limited to 'src/cmd/vendor/github.com') diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/settings.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/settings.go index 5011a06666..a07db37e77 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/driver/settings.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/settings.go @@ -90,7 +90,7 @@ func configMenu(fname string, u url.URL) []configMenuEntry { result := make([]configMenuEntry, len(configs)) lastMatch := -1 for i, cfg := range configs { - dst, changed := cfg.config.makeURL(u) + dst, changed := cfg.makeURL(u) if !changed { lastMatch = i } diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/svg.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/svg.go index 9cbef4d787..20832b7d2d 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/driver/svg.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/svg.go @@ -33,7 +33,7 @@ var ( func massageSVG(svg string) string { // Work around for dot bug which misses quoting some ampersands, // resulting on unparsable SVG. - svg = strings.Replace(svg, "&;", "&;", -1) + svg = strings.ReplaceAll(svg, "&;", "&;") // Dot's SVG output is // diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go index 568a5cb99a..a747635c59 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/webui.go @@ -353,7 +353,7 @@ func dotToSvg(dot []byte) ([]byte, error) { } // Fix dot bug related to unquoted ampersands. - svg := bytes.Replace(out.Bytes(), []byte("&;"), []byte("&;"), -1) + svg := bytes.ReplaceAll(out.Bytes(), []byte("&;"), []byte("&;")) // Cleanup for embedding by dropping stuff before the start. if pos := bytes.Index(svg, []byte("= 0 { diff --git a/src/cmd/vendor/github.com/google/pprof/internal/graph/dotgraph.go b/src/cmd/vendor/github.com/google/pprof/internal/graph/dotgraph.go index 09d40fd2c9..d704fc4e13 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/graph/dotgraph.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/graph/dotgraph.go @@ -384,11 +384,11 @@ func dotColor(score float64, isBackground bool) string { func multilinePrintableName(info *NodeInfo) string { infoCopy := *info infoCopy.Name = escapeForDot(ShortenFunctionName(infoCopy.Name)) - infoCopy.Name = strings.Replace(infoCopy.Name, "::", `\n`, -1) + infoCopy.Name = strings.ReplaceAll(infoCopy.Name, "::", `\n`) // Go type parameters are reported as "[...]" by Go pprof profiles. // Keep this ellipsis rather than replacing with newlines below. - infoCopy.Name = strings.Replace(infoCopy.Name, "[...]", "[…]", -1) - infoCopy.Name = strings.Replace(infoCopy.Name, ".", `\n`, -1) + infoCopy.Name = strings.ReplaceAll(infoCopy.Name, "[...]", "[…]") + infoCopy.Name = strings.ReplaceAll(infoCopy.Name, ".", `\n`) if infoCopy.File != "" { infoCopy.File = filepath.Base(infoCopy.File) } diff --git a/src/cmd/vendor/github.com/google/pprof/internal/report/report.go b/src/cmd/vendor/github.com/google/pprof/internal/report/report.go index ad8b84bf80..73a601c3e3 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/report/report.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/report/report.go @@ -535,7 +535,7 @@ func symbolsFromBinaries(prof *profile.Profile, g *graph.Graph, rx *regexp.Regex // the regexp (unless the regexp is an address and the mapping's range covers // the address) if !fileHasSamplesAndMatched[m.File] { - if address == nil || !(m.Start <= *address && *address <= m.Limit) { + if address == nil || m.Start > *address || *address > m.Limit { continue } } diff --git a/src/cmd/vendor/github.com/google/pprof/internal/report/source.go b/src/cmd/vendor/github.com/google/pprof/internal/report/source.go index f17952faee..771f500ec1 100644 --- a/src/cmd/vendor/github.com/google/pprof/internal/report/source.go +++ b/src/cmd/vendor/github.com/google/pprof/internal/report/source.go @@ -1066,15 +1066,16 @@ func trimPath(path, trimPath, searchPath string) string { func indentation(line string) int { column := 0 for _, c := range line { - if c == ' ' { + switch c { + case ' ': column++ - } else if c == '\t' { + case '\t': column++ for column%8 != 0 { column++ } - } else { - break + default: + return column } } return column diff --git a/src/cmd/vendor/github.com/google/pprof/profile/profile.go b/src/cmd/vendor/github.com/google/pprof/profile/profile.go index 43f561d445..18df65a8df 100644 --- a/src/cmd/vendor/github.com/google/pprof/profile/profile.go +++ b/src/cmd/vendor/github.com/google/pprof/profile/profile.go @@ -278,7 +278,7 @@ func (p *Profile) massageMappings() { // Use heuristics to identify main binary and move it to the top of the list of mappings for i, m := range p.Mapping { - file := strings.TrimSpace(strings.Replace(m.File, "(deleted)", "", -1)) + file := strings.TrimSpace(strings.ReplaceAll(m.File, "(deleted)", "")) if len(file) == 0 { continue } -- cgit v1.3