summaryrefslogtreecommitdiff
path: root/src/cmd/vendor/github.com/google
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2020-02-03 11:38:49 -0500
committerBryan C. Mills <bcmills@google.com>2020-02-19 21:26:10 +0000
commit729930869064b1c6989b70ef8517a101d42c7f9b (patch)
treeae556c5e411ab0c56fc9aa4482c188a8c05bcaec /src/cmd/vendor/github.com/google
parent2f2e97c00cf7da51ed692ff9b3f214eea4df4090 (diff)
downloadgo-git-729930869064b1c6989b70ef8517a101d42c7f9b.tar.gz
all: update module dependencies
Updates #36905 Updates #36907 Change-Id: I293dcef67800d5c81ff3a254bbd49309c5880710 Reviewed-on: https://go-review.googlesource.com/c/go/+/217517 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Diffstat (limited to 'src/cmd/vendor/github.com/google')
-rw-r--r--src/cmd/vendor/github.com/google/pprof/driver/driver.go7
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/driver/driver_focus.go2
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/driver/flags.go21
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/plugin/plugin.go7
-rw-r--r--src/cmd/vendor/github.com/google/pprof/internal/report/report.go19
5 files changed, 19 insertions, 37 deletions
diff --git a/src/cmd/vendor/github.com/google/pprof/driver/driver.go b/src/cmd/vendor/github.com/google/pprof/driver/driver.go
index b1c745bacd..9bcbc8295a 100644
--- a/src/cmd/vendor/github.com/google/pprof/driver/driver.go
+++ b/src/cmd/vendor/github.com/google/pprof/driver/driver.go
@@ -92,13 +92,6 @@ type FlagSet interface {
Float64(name string, def float64, usage string) *float64
String(name string, def string, usage string) *string
- // BoolVar, IntVar, Float64Var, and StringVar define new flags referencing
- // a given pointer, like the functions of the same name in package flag.
- BoolVar(pointer *bool, name string, def bool, usage string)
- IntVar(pointer *int, name string, def int, usage string)
- Float64Var(pointer *float64, name string, def float64, usage string)
- StringVar(pointer *string, name string, def string, usage string)
-
// StringList is similar to String but allows multiple values for a
// single flag
StringList(name string, def string, usage string) *[]*string
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/driver_focus.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/driver_focus.go
index 551965e776..af7b8d478a 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/driver/driver_focus.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/driver_focus.go
@@ -25,7 +25,7 @@ import (
"github.com/google/pprof/profile"
)
-var tagFilterRangeRx = regexp.MustCompile("([+-]?[[:digit:]]+)([[:alpha:]]+)")
+var tagFilterRangeRx = regexp.MustCompile("([+-]?[[:digit:]]+)([[:alpha:]]+)?")
// applyFocus filters samples based on the focus/ignore options
func applyFocus(prof *profile.Profile, numLabelUnits map[string]string, v variables, ui plugin.UI) error {
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/driver/flags.go b/src/cmd/vendor/github.com/google/pprof/internal/driver/flags.go
index 6ef1397852..5390319166 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/driver/flags.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/driver/flags.go
@@ -44,27 +44,6 @@ func (*GoFlags) String(o, d, c string) *string {
return flag.String(o, d, c)
}
-// BoolVar implements the plugin.FlagSet interface.
-func (*GoFlags) BoolVar(b *bool, o string, d bool, c string) {
- flag.BoolVar(b, o, d, c)
-}
-
-// IntVar implements the plugin.FlagSet interface.
-func (*GoFlags) IntVar(i *int, o string, d int, c string) {
- flag.IntVar(i, o, d, c)
-}
-
-// Float64Var implements the plugin.FlagSet interface.
-// the value of the flag.
-func (*GoFlags) Float64Var(f *float64, o string, d float64, c string) {
- flag.Float64Var(f, o, d, c)
-}
-
-// StringVar implements the plugin.FlagSet interface.
-func (*GoFlags) StringVar(s *string, o, d, c string) {
- flag.StringVar(s, o, d, c)
-}
-
// StringList implements the plugin.FlagSet interface.
func (*GoFlags) StringList(o, d, c string) *[]*string {
return &[]*string{flag.String(o, d, c)}
diff --git a/src/cmd/vendor/github.com/google/pprof/internal/plugin/plugin.go b/src/cmd/vendor/github.com/google/pprof/internal/plugin/plugin.go
index a304284c31..4c1db2331f 100644
--- a/src/cmd/vendor/github.com/google/pprof/internal/plugin/plugin.go
+++ b/src/cmd/vendor/github.com/google/pprof/internal/plugin/plugin.go
@@ -61,13 +61,6 @@ type FlagSet interface {
Float64(name string, def float64, usage string) *float64
String(name string, def string, usage string) *string
- // BoolVar, IntVar, Float64Var, and StringVar define new flags referencing
- // a given pointer, like the functions of the same name in package flag.
- BoolVar(pointer *bool, name string, def bool, usage string)
- IntVar(pointer *int, name string, def int, usage string)
- Float64Var(pointer *float64, name string, def float64, usage string)
- StringVar(pointer *string, name string, def string, usage string)
-
// StringList is similar to String but allows multiple values for a
// single flag
StringList(name string, def string, usage string) *[]*string
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 fb67a343ba..1b555a4e2e 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
@@ -102,7 +102,7 @@ func Generate(w io.Writer, rpt *Report, obj plugin.ObjTool) error {
case Tags:
return printTags(w, rpt)
case Proto:
- return rpt.prof.Write(w)
+ return printProto(w, rpt)
case TopProto:
return printTopProto(w, rpt)
case Dis:
@@ -291,6 +291,23 @@ func (rpt *Report) newGraph(nodes graph.NodeSet) *graph.Graph {
return graph.New(rpt.prof, gopt)
}
+// printProto writes the incoming proto via thw writer w.
+// If the divide_by option has been specified, samples are scaled appropriately.
+func printProto(w io.Writer, rpt *Report) error {
+ p, o := rpt.prof, rpt.options
+
+ // Apply the sample ratio to all samples before saving the profile.
+ if r := o.Ratio; r > 0 && r != 1 {
+ for _, sample := range p.Sample {
+ for i, v := range sample.Value {
+ sample.Value[i] = int64(float64(v) * r)
+ }
+ }
+ }
+ return p.Write(w)
+}
+
+// printTopProto writes a list of the hottest routines in a profile as a profile.proto.
func printTopProto(w io.Writer, rpt *Report) error {
p := rpt.prof
o := rpt.options