aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/pprof
diff options
context:
space:
mode:
authorDominik Honnef <dominik@honnef.co>2016-03-21 00:12:18 +0100
committerBrad Fitzpatrick <bradfitz@golang.org>2016-03-25 06:28:13 +0000
commitfdba5a7544e54227c910ae3b26511c718df786a1 (patch)
treeb2acc55d32e25e299654ce0de1abf7bdd1eaa048 /src/cmd/pprof
parent6a6a0734163567545aed2b558f24f2aafc6c9072 (diff)
downloadgo-fdba5a7544e54227c910ae3b26511c718df786a1.tar.gz
go-fdba5a7544e54227c910ae3b26511c718df786a1.zip
all: delete dead non-test code
This change removes a lot of dead code. Some of the code has never been used, not even when it was first commited. The rest shouldn't have survived refactors. This change doesn't remove unused routines helpful for debugging, nor does it remove code that's used in commented out blocks of code that are only unused temporarily. Furthermore, unused constants weren't removed when they were part of a set of constants from specifications. One noteworthy omission from this CL are about 1000 lines of unused code in cmd/fix, 700 lines of which are the typechecker, which hasn't been used ever since the pre-Go 1 fixes have been removed. I wasn't sure if this code should stick around for future uses of cmd/fix or be culled as well. Change-Id: Ib714bc7e487edc11ad23ba1c3222d1fd02e4a549 Reviewed-on: https://go-review.googlesource.com/20926 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd/pprof')
-rw-r--r--src/cmd/pprof/internal/report/report.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/cmd/pprof/internal/report/report.go b/src/cmd/pprof/internal/report/report.go
index b2b07b24f9..86bd4a280b 100644
--- a/src/cmd/pprof/internal/report/report.go
+++ b/src/cmd/pprof/internal/report/report.go
@@ -10,7 +10,6 @@ import (
"fmt"
"io"
"math"
- "os"
"path/filepath"
"regexp"
"sort"
@@ -248,14 +247,6 @@ func valueOrDot(value int64, rpt *Report) string {
return rpt.formatValue(value)
}
-// canAccessFile determines if the filename can be opened for reading.
-func canAccessFile(path string) bool {
- if fi, err := os.Stat(path); err == nil {
- return fi.Mode().Perm()&0400 != 0
- }
- return false
-}
-
// printTags collects all tags referenced in the profile and prints
// them in a sorted table.
func printTags(w io.Writer, rpt *Report) error {
@@ -764,14 +755,6 @@ type node struct {
tags tagMap
}
-func (ts tags) string() string {
- var ret string
- for _, s := range ts {
- ret = ret + fmt.Sprintf("%s %s %d %d\n", s.name, s.unit, s.value, s.weight)
- }
- return ret
-}
-
type nodeInfo struct {
name string
origName string
@@ -1697,22 +1680,3 @@ type Report struct {
sampleValue func(*profile.Sample) int64
formatValue func(int64) string
}
-
-func (rpt *Report) formatTags(s *profile.Sample) (string, bool) {
- var labels []string
- for key, vals := range s.Label {
- for _, v := range vals {
- labels = append(labels, key+":"+v)
- }
- }
- for key, nvals := range s.NumLabel {
- for _, v := range nvals {
- labels = append(labels, scaledValueLabel(v, key, "auto"))
- }
- }
- if len(labels) == 0 {
- return "", false
- }
- sort.Strings(labels)
- return strings.Join(labels, `\n`), true
-}