aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vendor/github.com/google/pprof/internal/driver/driver.go
diff options
context:
space:
mode:
authorEmmanuel T Odeke <emmanuel@orijtech.com>2024-05-27 21:07:22 -0600
committerGopher Robot <gobot@golang.org>2024-05-31 19:48:28 +0000
commit9b43bfbc51c469ec13fca24960834a75b2bf66eb (patch)
treecafe177d5e024ae1a903f9c69824ed99ee673082 /src/cmd/vendor/github.com/google/pprof/internal/driver/driver.go
parent00b8071a12e298303b2f4bd0e9f641ef3e54772a (diff)
downloadgo-9b43bfbc51c469ec13fca24960834a75b2bf66eb.tar.xz
cmd/vendor: update github.com/google/pprof
Brings in the latest github.com/google/pprof. Fixes #67626 Change-Id: Id8faef20f0a9bf81dd117110bf540aca852db6be Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest Reviewed-on: https://go-review.googlesource.com/c/go/+/588655 Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'src/cmd/vendor/github.com/google/pprof/internal/driver/driver.go')
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/driver/driver.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/driver.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/driver.go
index 74ce8cb422..18941926c5 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/driver/driver.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/driver.go
@@ -20,6 +20,7 @@ package driver
import (
"bytes"
"fmt"
+ "io"
"os"
"path/filepath"
"regexp"
@@ -118,7 +119,14 @@ func generateReport(p *profile.Profile, cmd []string, cfg config, o *plugin.Opti
// Generate the report.
dst := new(bytes.Buffer)
- if err := report.Generate(dst, rpt, o.Obj); err != nil {
+ switch rpt.OutputFormat() {
+ case report.WebList:
+ // We need template expansion, so generate here instead of in report.
+ err = printWebList(dst, rpt, o.Obj)
+ default:
+ err = report.Generate(dst, rpt, o.Obj)
+ }
+ if err != nil {
return err
}
src := dst
@@ -155,6 +163,18 @@ func generateReport(p *profile.Profile, cmd []string, cfg config, o *plugin.Opti
return out.Close()
}
+func printWebList(dst io.Writer, rpt *report.Report, obj plugin.ObjTool) error {
+ listing, err := report.MakeWebList(rpt, obj, -1)
+ if err != nil {
+ return err
+ }
+ legend := report.ProfileLabels(rpt)
+ return renderHTML(dst, "sourcelisting", rpt, nil, legend, webArgs{
+ Standalone: true,
+ Listing: listing,
+ })
+}
+
func applyCommandOverrides(cmd string, outputFormat int, cfg config) config {
// Some report types override the trim flag to false below. This is to make
// sure the default heuristics of excluding insignificant nodes and edges