Browse Source

init project

chenqinghe 4 years ago
parent
commit
b0e252bc98
100 changed files with 344 additions and 51 deletions
  1. 3
    0
      .gitignore
  2. 17
    0
      cmd/webpprof/index.html
  3. 185
    0
      cmd/webpprof/main.go
  4. 4
    4
      driver/driver.go
  5. 2
    1
      go.mod
  6. 53
    2
      go.sum
  7. 1
    1
      pkg/binutils/addr2liner.go
  8. 1
    1
      pkg/binutils/addr2liner_llvm.go
  9. 1
    1
      pkg/binutils/addr2liner_nm.go
  10. 2
    2
      pkg/binutils/binutils.go
  11. 1
    1
      pkg/binutils/binutils_test.go
  12. 1
    1
      pkg/binutils/disasm.go
  13. 1
    1
      pkg/binutils/disasm_test.go
  14. 0
    0
      pkg/binutils/testdata/build_binaries.sh
  15. 0
    0
      pkg/binutils/testdata/exe_linux_64
  16. 0
    0
      pkg/binutils/testdata/exe_mac_64
  17. 0
    0
      pkg/binutils/testdata/exe_mac_64.dSYM/Contents/Info.plist
  18. 0
    0
      pkg/binutils/testdata/exe_mac_64.dSYM/Contents/Resources/DWARF/exe_mac_64
  19. 0
    0
      pkg/binutils/testdata/fake-llvm-symbolizer
  20. 0
    0
      pkg/binutils/testdata/lib_mac_64
  21. 0
    0
      pkg/binutils/testdata/lib_mac_64.dSYM/Contents/Info.plist
  22. 0
    0
      pkg/binutils/testdata/lib_mac_64.dSYM/Contents/Resources/DWARF/lib_mac_64
  23. 0
    0
      pkg/binutils/testdata/malformed_elf
  24. 0
    0
      pkg/binutils/testdata/malformed_macho
  25. 2
    2
      pkg/driver/cli.go
  26. 2
    2
      pkg/driver/commands.go
  27. 0
    0
      pkg/driver/config.go
  28. 38
    2
      pkg/driver/driver.go
  29. 2
    2
      pkg/driver/driver_focus.go
  30. 3
    3
      pkg/driver/driver_test.go
  31. 2
    2
      pkg/driver/fetch.go
  32. 5
    5
      pkg/driver/fetch_test.go
  33. 0
    0
      pkg/driver/flags.go
  34. 3
    3
      pkg/driver/flamegraph.go
  35. 2
    2
      pkg/driver/interactive.go
  36. 4
    4
      pkg/driver/interactive_test.go
  37. 4
    4
      pkg/driver/options.go
  38. 0
    0
      pkg/driver/settings.go
  39. 0
    0
      pkg/driver/settings_test.go
  40. 0
    0
      pkg/driver/svg.go
  41. 0
    0
      pkg/driver/tempfile.go
  42. 0
    0
      pkg/driver/testdata/cppbench.contention
  43. 0
    0
      pkg/driver/testdata/cppbench.cpu
  44. 0
    0
      pkg/driver/testdata/cppbench.small.contention
  45. 0
    0
      pkg/driver/testdata/file1000.src
  46. 0
    0
      pkg/driver/testdata/file2000.src
  47. 0
    0
      pkg/driver/testdata/file3000.src
  48. 0
    0
      pkg/driver/testdata/go.crc32.cpu
  49. 0
    0
      pkg/driver/testdata/go.nomappings.crash
  50. 0
    0
      pkg/driver/testdata/pprof.contention.cum.files.dot
  51. 0
    0
      pkg/driver/testdata/pprof.contention.flat.addresses.dot.focus.ignore
  52. 0
    0
      pkg/driver/testdata/pprof.cpu.addresses.traces
  53. 0
    0
      pkg/driver/testdata/pprof.cpu.call_tree.callgrind
  54. 0
    0
      pkg/driver/testdata/pprof.cpu.callgrind
  55. 0
    0
      pkg/driver/testdata/pprof.cpu.comments
  56. 0
    0
      pkg/driver/testdata/pprof.cpu.cum.lines.text.focus.hide
  57. 0
    0
      pkg/driver/testdata/pprof.cpu.cum.lines.text.hide
  58. 0
    0
      pkg/driver/testdata/pprof.cpu.cum.lines.text.show
  59. 0
    0
      pkg/driver/testdata/pprof.cpu.cum.lines.topproto.hide
  60. 0
    0
      pkg/driver/testdata/pprof.cpu.cum.lines.tree.show_from
  61. 0
    0
      pkg/driver/testdata/pprof.cpu.flat.addresses.disasm
  62. 0
    0
      pkg/driver/testdata/pprof.cpu.flat.addresses.noinlines.text
  63. 0
    0
      pkg/driver/testdata/pprof.cpu.flat.addresses.weblist
  64. 0
    0
      pkg/driver/testdata/pprof.cpu.flat.filefunctions.noinlines.text
  65. 0
    0
      pkg/driver/testdata/pprof.cpu.flat.functions.call_tree.dot
  66. 0
    0
      pkg/driver/testdata/pprof.cpu.flat.functions.dot
  67. 0
    0
      pkg/driver/testdata/pprof.cpu.flat.functions.noinlines.text
  68. 0
    0
      pkg/driver/testdata/pprof.cpu.flat.functions.text
  69. 0
    0
      pkg/driver/testdata/pprof.cpu.lines.topproto
  70. 0
    0
      pkg/driver/testdata/pprof.cpu.peek
  71. 0
    0
      pkg/driver/testdata/pprof.cpu.tags
  72. 0
    0
      pkg/driver/testdata/pprof.cpu.tags.focus.ignore
  73. 0
    0
      pkg/driver/testdata/pprof.cpu.traces
  74. 0
    0
      pkg/driver/testdata/pprof.cpusmall.flat.addresses.tree
  75. 0
    0
      pkg/driver/testdata/pprof.heap.callgrind
  76. 0
    0
      pkg/driver/testdata/pprof.heap.comments
  77. 0
    0
      pkg/driver/testdata/pprof.heap.cum.lines.tree.focus
  78. 0
    0
      pkg/driver/testdata/pprof.heap.cum.relative_percentages.tree.focus
  79. 0
    0
      pkg/driver/testdata/pprof.heap.flat.files.seconds.text
  80. 0
    0
      pkg/driver/testdata/pprof.heap.flat.files.text
  81. 0
    0
      pkg/driver/testdata/pprof.heap.flat.files.text.focus
  82. 0
    0
      pkg/driver/testdata/pprof.heap.flat.inuse_objects.text
  83. 0
    0
      pkg/driver/testdata/pprof.heap.flat.inuse_space.dot.focus
  84. 0
    0
      pkg/driver/testdata/pprof.heap.flat.inuse_space.dot.focus.ignore
  85. 0
    0
      pkg/driver/testdata/pprof.heap.flat.lines.dot.focus
  86. 0
    0
      pkg/driver/testdata/pprof.heap.tags
  87. 0
    0
      pkg/driver/testdata/pprof.heap.tags.unit
  88. 0
    0
      pkg/driver/testdata/pprof.heap_alloc.flat.alloc_objects.text
  89. 0
    0
      pkg/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot
  90. 0
    0
      pkg/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot.focus
  91. 0
    0
      pkg/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot.hide
  92. 0
    0
      pkg/driver/testdata/pprof.heap_request.tags.focus
  93. 0
    0
      pkg/driver/testdata/pprof.heap_sizetags.dot
  94. 0
    0
      pkg/driver/testdata/pprof.heap_tags.traces
  95. 0
    0
      pkg/driver/testdata/pprof.long_name_funcs.dot
  96. 0
    0
      pkg/driver/testdata/pprof.long_name_funcs.text
  97. 0
    0
      pkg/driver/testdata/pprof.unknown.flat.functions.call_tree.text
  98. 1
    1
      pkg/driver/webhtml.go
  99. 4
    4
      pkg/driver/webui.go
  100. 0
    0
      pkg/driver/webui_test.go

+ 3
- 0
.gitignore View File

6
 core
6
 core
7
 coverage.txt
7
 coverage.txt
8
 pprof
8
 pprof
9
+*.pprof
10
+node_modules
11
+.idea

+ 17
- 0
cmd/webpprof/index.html View File

1
+<!DOCTYPE html>
2
+<html lang="en">
3
+<head>
4
+    <meta charset="UTF-8">
5
+    <title>upload pprof profile file</title>
6
+</head>
7
+<body>
8
+
9
+<form action="http://localhost:8090/upload" method="post" enctype="multipart/form-data">
10
+    <input type="file" name="file">
11
+    <input type="submit" name="上传" id="">
12
+</form>
13
+
14
+
15
+
16
+</body>
17
+</html>

+ 185
- 0
cmd/webpprof/main.go View File

1
+package main
2
+
3
+import (
4
+	"crypto/md5"
5
+	"encoding/hex"
6
+	"fmt"
7
+	"io/ioutil"
8
+	"net/http"
9
+	_ "net/http/pprof"
10
+	"os"
11
+
12
+	"github.com/gin-gonic/gin"
13
+	"github.com/google/pprof/pkg/driver"
14
+	"github.com/google/pprof/profile"
15
+	"github.com/sirupsen/logrus"
16
+)
17
+
18
+func main() {
19
+	r := gin.Default()
20
+
21
+	r.OPTIONS("/upload", func(c *gin.Context) {
22
+		c.Header("Access-Control-Allow-Origin", "http://localhost:8080")
23
+		c.Header("Access-Control-Allow-Credentials", "true")
24
+		c.Header("Access-Control-Allow-Method", "POST")
25
+		//c.Header("","")
26
+		//c.Header("","")
27
+		//Access-Control-Allow-Origin: *
28
+		//	Access-Control-Allow-Credentials: true
29
+		//Access-Control-Expose-Headers: FooBar
30
+		//Content-Type: text/html; charset=utf-8
31
+	})
32
+	r.POST("/upload", upload)
33
+
34
+	r.GET("/pprof/:hash/:method", mapping)
35
+	//r.GET("/pprof/:hash/", dot)
36
+	//r.GET("/pprof/:hash/top", top)
37
+	//r.GET("/pprof/:hash/disasm", disasm)
38
+	//r.GET("/pprof/:hash/source", source)
39
+	//r.GET("/pprof/:hash/peek", peek)
40
+	//r.GET("/pprof/:hash/flamegraph", flamegraph)
41
+	//r.GET("/pprof/:hash/saveconfig", saveconfig)
42
+	//r.GET("/pprof/:hash/deleteconfig", deleteconfig)
43
+
44
+	go func() {
45
+		http.ListenAndServe(":8091", nil)
46
+	}()
47
+
48
+	r.Run(":8090")
49
+
50
+}
51
+
52
+func mapping(c *gin.Context) {
53
+	hash := c.Param("hash")
54
+	if hash == "" {
55
+		c.AbortWithStatus(http.StatusNotFound)
56
+		return
57
+	}
58
+
59
+	filename := fmt.Sprintf("%s.pprof", hash)
60
+	f, err := os.OpenFile(filename, os.O_RDONLY, os.ModePerm)
61
+	if err != nil {
62
+		c.AbortWithError(http.StatusInternalServerError, err)
63
+		return
64
+	}
65
+	defer f.Close()
66
+	prof, err := profile.Parse(f)
67
+	if err != nil {
68
+		c.AbortWithError(http.StatusInternalServerError, err)
69
+		return
70
+	}
71
+
72
+	ui, err := driver.MakeWebInterface(prof, nil)
73
+	if err != nil {
74
+		c.AbortWithError(http.StatusInternalServerError, err)
75
+		return
76
+	}
77
+
78
+	method := c.Param("method")
79
+	switch method {
80
+	case "", "dot":
81
+		ui.Dot(c.Writer, c.Request)
82
+	case "top":
83
+		ui.Top(c.Writer, c.Request)
84
+	case "disasm":
85
+		ui.Disasm(c.Writer, c.Request)
86
+	case "source":
87
+		ui.Source(c.Writer, c.Request)
88
+	case "peek":
89
+		ui.Peek(c.Writer, c.Request)
90
+	case "flamegraph":
91
+		ui.Flamegraph(c.Writer, c.Request)
92
+	case "saveconfig":
93
+		ui.SaveConfig(c.Writer, c.Request)
94
+	case "deleteconfig":
95
+		ui.DeleteConfig(c.Writer, c.Request)
96
+	default:
97
+		c.AbortWithStatus(http.StatusNotFound)
98
+	}
99
+}
100
+
101
+func upload(c *gin.Context) {
102
+	f, _, err := c.Request.FormFile("file")
103
+	if err != nil {
104
+		logrus.Errorln("upload file error:", err)
105
+		c.AbortWithError(http.StatusInternalServerError, err)
106
+		return
107
+	}
108
+
109
+	fdata, _ := ioutil.ReadAll(f)
110
+	f.Close()
111
+
112
+	rhash := hash(fdata)
113
+
114
+	if fileExist(rhash) { // 文件已存在
115
+		c.Redirect(http.StatusFound, fmt.Sprintf("/pprof/%s/flamegraph", rhash))
116
+		return
117
+	}
118
+
119
+	fileDst := fmt.Sprintf("%s.pprof", rhash)
120
+	file, err := os.Create(fileDst)
121
+	if err != nil {
122
+		c.AbortWithError(http.StatusInternalServerError, err)
123
+		return
124
+	}
125
+	defer file.Close()
126
+
127
+	if _, err := file.Write(fdata); err != nil {
128
+		c.AbortWithError(http.StatusInternalServerError, err)
129
+		return
130
+	}
131
+
132
+	c.JSONP(http.StatusOK, map[string]interface{}{
133
+		"code": 0,
134
+		"msg":  "ok",
135
+		"data": rhash,
136
+	})
137
+}
138
+
139
+func hash(data []byte) string {
140
+	h := md5.New()
141
+	h.Write(data)
142
+
143
+	return hex.EncodeToString(h.Sum(nil))
144
+}
145
+
146
+func fileExist(file string) bool {
147
+	return false
148
+}
149
+
150
+//
151
+//func dot(c *gin.Context)    {}
152
+//func top(c *gin.Context)    {}
153
+//func disasm(c *gin.Context) {}
154
+//func source(c *gin.Context) {}
155
+//func peek(c *gin.Context)   {}
156
+//func flamegraph(c *gin.Context) {
157
+//	hash := c.Param("hash")
158
+//	if hash == "" {
159
+//		c.AbortWithStatus(http.StatusNotFound)
160
+//		return
161
+//	}
162
+//
163
+//	filename := fmt.Sprintf("%s.pprof", hash)
164
+//	f, err := os.OpenFile(filename, os.O_RDONLY, os.ModePerm)
165
+//	if err != nil {
166
+//		c.AbortWithError(http.StatusInternalServerError, err)
167
+//		return
168
+//	}
169
+//	defer f.Close()
170
+//	prof, err := profile.Parse(f)
171
+//	if err != nil {
172
+//		c.AbortWithError(http.StatusInternalServerError, err)
173
+//		return
174
+//	}
175
+//
176
+//	ui, err := driver.MakeWebInterface(prof, nil)
177
+//	if err != nil {
178
+//		c.AbortWithError(http.StatusInternalServerError, err)
179
+//		return
180
+//	}
181
+//
182
+//	ui.Flamegraph(c.Writer, c.Request)
183
+//}
184
+//func saveconfig(c *gin.Context)   {}
185
+//func deleteconfig(c *gin.Context) {}

+ 4
- 4
driver/driver.go View File

21
 	"regexp"
21
 	"regexp"
22
 	"time"
22
 	"time"
23
 
23
 
24
-	internaldriver "github.com/google/pprof/internal/driver"
25
-	"github.com/google/pprof/internal/plugin"
24
+	internaldriver "github.com/google/pprof/pkg/driver"
25
+	"github.com/google/pprof/pkg/plugin"
26
 	"github.com/google/pprof/profile"
26
 	"github.com/google/pprof/profile"
27
 )
27
 )
28
 
28
 
227
 }
227
 }
228
 
228
 
229
 // internalObjTool is a wrapper to map from the pprof external
229
 // internalObjTool is a wrapper to map from the pprof external
230
-// interface to the internal interface.
230
+// interface to the pkg interface.
231
 type internalObjTool struct {
231
 type internalObjTool struct {
232
 	ObjTool
232
 	ObjTool
233
 }
233
 }
282
 }
282
 }
283
 
283
 
284
 // internalSymbolizer is a wrapper to map from the pprof external
284
 // internalSymbolizer is a wrapper to map from the pprof external
285
-// interface to the internal interface.
285
+// interface to the pkg interface.
286
 type internalSymbolizer struct {
286
 type internalSymbolizer struct {
287
 	Symbolizer
287
 	Symbolizer
288
 }
288
 }

+ 2
- 1
go.mod View File

6
 	github.com/chzyer/logex v1.1.10 // indirect
6
 	github.com/chzyer/logex v1.1.10 // indirect
7
 	github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
7
 	github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
8
 	github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
8
 	github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 // indirect
9
+	github.com/gin-gonic/gin v1.6.3
9
 	github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6
10
 	github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6
10
-	golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e // indirect
11
+	github.com/sirupsen/logrus v1.6.0
11
 )
12
 )

+ 53
- 2
go.sum View File

4
 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
4
 github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
5
 github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
5
 github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8=
6
 github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
6
 github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
7
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
8
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
9
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
10
+github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
11
+github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
12
+github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
13
+github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
14
+github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
15
+github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
16
+github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
17
+github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
18
+github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
19
+github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
20
+github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
21
+github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
22
+github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
23
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
24
+github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
7
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=
25
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6 h1:UDMh68UUwekSh5iP2OMhRRZJiiBccgV7axzUG8vi56c=
8
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
26
 github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
9
-golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e h1:9vRrk9YW2BTzLP0VCB9ZDjU4cPqkg+IDWL7XgxA1yxQ=
10
-golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
27
+github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
28
+github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
29
+github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8=
30
+github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
31
+github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
32
+github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
33
+github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
34
+github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
35
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=
36
+github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
37
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
38
+github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
39
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
40
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
41
+github.com/sirupsen/logrus v1.6.0 h1:UBcNElsrwanuuMsnGSlYmtmgbb23qDR5dG+6X6Oo89I=
42
+github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88=
43
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
44
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
45
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
46
+github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
47
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
48
+github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
49
+github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
50
+github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
51
+github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
52
+golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
53
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42 h1:vEOn+mP2zCOVzKckCZy6YsCtDblrpj/w7B9nxGNELpg=
54
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
55
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
56
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
57
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
58
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
59
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
60
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
61
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

internal/binutils/addr2liner.go → pkg/binutils/addr2liner.go View File

23
 	"strings"
23
 	"strings"
24
 	"sync"
24
 	"sync"
25
 
25
 
26
-	"github.com/google/pprof/internal/plugin"
26
+	"github.com/google/pprof/pkg/plugin"
27
 )
27
 )
28
 
28
 
29
 const (
29
 const (

internal/binutils/addr2liner_llvm.go → pkg/binutils/addr2liner_llvm.go View File

23
 	"strings"
23
 	"strings"
24
 	"sync"
24
 	"sync"
25
 
25
 
26
-	"github.com/google/pprof/internal/plugin"
26
+	"github.com/google/pprof/pkg/plugin"
27
 )
27
 )
28
 
28
 
29
 const (
29
 const (

internal/binutils/addr2liner_nm.go → pkg/binutils/addr2liner_nm.go View File

22
 	"strconv"
22
 	"strconv"
23
 	"strings"
23
 	"strings"
24
 
24
 
25
-	"github.com/google/pprof/internal/plugin"
25
+	"github.com/google/pprof/pkg/plugin"
26
 )
26
 )
27
 
27
 
28
 const (
28
 const (

internal/binutils/binutils.go → pkg/binutils/binutils.go View File

31
 	"strings"
31
 	"strings"
32
 	"sync"
32
 	"sync"
33
 
33
 
34
-	"github.com/google/pprof/internal/elfexec"
35
-	"github.com/google/pprof/internal/plugin"
34
+	"github.com/google/pprof/pkg/elfexec"
35
+	"github.com/google/pprof/pkg/plugin"
36
 )
36
 )
37
 
37
 
38
 // A Binutils implements plugin.ObjTool by invoking the GNU binutils.
38
 // A Binutils implements plugin.ObjTool by invoking the GNU binutils.

internal/binutils/binutils_test.go → pkg/binutils/binutils_test.go View File

25
 	"strings"
25
 	"strings"
26
 	"testing"
26
 	"testing"
27
 
27
 
28
-	"github.com/google/pprof/internal/plugin"
28
+	"github.com/google/pprof/pkg/plugin"
29
 )
29
 )
30
 
30
 
31
 var testAddrMap = map[int]string{
31
 var testAddrMap = map[int]string{

internal/binutils/disasm.go → pkg/binutils/disasm.go View File

20
 	"regexp"
20
 	"regexp"
21
 	"strconv"
21
 	"strconv"
22
 
22
 
23
-	"github.com/google/pprof/internal/plugin"
23
+	"github.com/google/pprof/pkg/plugin"
24
 	"github.com/ianlancetaylor/demangle"
24
 	"github.com/ianlancetaylor/demangle"
25
 )
25
 )
26
 
26
 

internal/binutils/disasm_test.go → pkg/binutils/disasm_test.go View File

19
 	"regexp"
19
 	"regexp"
20
 	"testing"
20
 	"testing"
21
 
21
 
22
-	"github.com/google/pprof/internal/plugin"
22
+	"github.com/google/pprof/pkg/plugin"
23
 )
23
 )
24
 
24
 
25
 // TestFindSymbols tests the FindSymbols routine using a hardcoded nm output.
25
 // TestFindSymbols tests the FindSymbols routine using a hardcoded nm output.

internal/binutils/testdata/build_binaries.sh → pkg/binutils/testdata/build_binaries.sh View File


internal/binutils/testdata/exe_linux_64 → pkg/binutils/testdata/exe_linux_64 View File


internal/binutils/testdata/exe_mac_64 → pkg/binutils/testdata/exe_mac_64 View File


internal/binutils/testdata/exe_mac_64.dSYM/Contents/Info.plist → pkg/binutils/testdata/exe_mac_64.dSYM/Contents/Info.plist View File


internal/binutils/testdata/exe_mac_64.dSYM/Contents/Resources/DWARF/exe_mac_64 → pkg/binutils/testdata/exe_mac_64.dSYM/Contents/Resources/DWARF/exe_mac_64 View File


internal/binutils/testdata/fake-llvm-symbolizer → pkg/binutils/testdata/fake-llvm-symbolizer View File


internal/binutils/testdata/lib_mac_64 → pkg/binutils/testdata/lib_mac_64 View File


internal/binutils/testdata/lib_mac_64.dSYM/Contents/Info.plist → pkg/binutils/testdata/lib_mac_64.dSYM/Contents/Info.plist View File


internal/binutils/testdata/lib_mac_64.dSYM/Contents/Resources/DWARF/lib_mac_64 → pkg/binutils/testdata/lib_mac_64.dSYM/Contents/Resources/DWARF/lib_mac_64 View File


internal/binutils/testdata/malformed_elf → pkg/binutils/testdata/malformed_elf View File


internal/binutils/testdata/malformed_macho → pkg/binutils/testdata/malformed_macho View File


internal/driver/cli.go → pkg/driver/cli.go View File

20
 	"os"
20
 	"os"
21
 	"strings"
21
 	"strings"
22
 
22
 
23
-	"github.com/google/pprof/internal/binutils"
24
-	"github.com/google/pprof/internal/plugin"
23
+	"github.com/google/pprof/pkg/binutils"
24
+	"github.com/google/pprof/pkg/plugin"
25
 )
25
 )
26
 
26
 
27
 type source struct {
27
 type source struct {

internal/driver/commands.go → pkg/driver/commands.go View File

25
 	"strings"
25
 	"strings"
26
 	"time"
26
 	"time"
27
 
27
 
28
-	"github.com/google/pprof/internal/plugin"
29
-	"github.com/google/pprof/internal/report"
28
+	"github.com/google/pprof/pkg/plugin"
29
+	"github.com/google/pprof/pkg/report"
30
 )
30
 )
31
 
31
 
32
 // commands describes the commands accepted by pprof.
32
 // commands describes the commands accepted by pprof.

internal/driver/config.go → pkg/driver/config.go View File


internal/driver/driver.go → pkg/driver/driver.go View File

20
 import (
20
 import (
21
 	"bytes"
21
 	"bytes"
22
 	"fmt"
22
 	"fmt"
23
+	"net/http"
23
 	"os"
24
 	"os"
24
 	"path/filepath"
25
 	"path/filepath"
25
 	"regexp"
26
 	"regexp"
26
 	"strings"
27
 	"strings"
27
 
28
 
28
-	"github.com/google/pprof/internal/plugin"
29
-	"github.com/google/pprof/internal/report"
29
+	"github.com/google/pprof/pkg/plugin"
30
+	"github.com/google/pprof/pkg/report"
30
 	"github.com/google/pprof/profile"
31
 	"github.com/google/pprof/profile"
31
 )
32
 )
32
 
33
 
59
 	return interactive(p, o)
60
 	return interactive(p, o)
60
 }
61
 }
61
 
62
 
63
+type ExportedWebInterface struct {
64
+	*webInterface
65
+}
66
+
67
+func (ui *ExportedWebInterface) Dot(w http.ResponseWriter, req *http.Request)    { ui.dot(w, req) }
68
+func (ui *ExportedWebInterface) Top(w http.ResponseWriter, req *http.Request)    { ui.dot(w, req) }
69
+func (ui *ExportedWebInterface) Disasm(w http.ResponseWriter, req *http.Request) { ui.disasm(w, req) }
70
+func (ui *ExportedWebInterface) Source(w http.ResponseWriter, req *http.Request) { ui.source(w, req) }
71
+func (ui *ExportedWebInterface) Peek(w http.ResponseWriter, req *http.Request)   { ui.peek(w, req) }
72
+func (ui *ExportedWebInterface) Flamegraph(w http.ResponseWriter, req *http.Request) {
73
+	ui.flamegraph(w, req)
74
+}
75
+func (ui *ExportedWebInterface) SaveConfig(w http.ResponseWriter, req *http.Request) {
76
+	ui.saveConfig(w, req)
77
+}
78
+func (ui *ExportedWebInterface) DeleteConfig(w http.ResponseWriter, req *http.Request) {
79
+	ui.deleteConfig(w, req)
80
+}
81
+
82
+var defaultOptions *plugin.Options
83
+
84
+func init() { defaultOptions = setDefaults(&plugin.Options{}) }
85
+
86
+func MakeWebInterface(p *profile.Profile, o *plugin.Options) (*ExportedWebInterface, error) {
87
+	if o == nil {
88
+		o = defaultOptions
89
+	}
90
+	ui, err := makeWebInterface(p, o)
91
+	if err != nil {
92
+		return nil, err
93
+	}
94
+
95
+	return &ExportedWebInterface{ui}, nil
96
+}
97
+
62
 func generateRawReport(p *profile.Profile, cmd []string, cfg config, o *plugin.Options) (*command, *report.Report, error) {
98
 func generateRawReport(p *profile.Profile, cmd []string, cfg config, o *plugin.Options) (*command, *report.Report, error) {
63
 	p = p.Copy() // Prevent modification to the incoming profile.
99
 	p = p.Copy() // Prevent modification to the incoming profile.
64
 
100
 

internal/driver/driver_focus.go → pkg/driver/driver_focus.go View File

20
 	"strconv"
20
 	"strconv"
21
 	"strings"
21
 	"strings"
22
 
22
 
23
-	"github.com/google/pprof/internal/measurement"
24
-	"github.com/google/pprof/internal/plugin"
23
+	"github.com/google/pprof/pkg/measurement"
24
+	"github.com/google/pprof/pkg/plugin"
25
 	"github.com/google/pprof/profile"
25
 	"github.com/google/pprof/profile"
26
 )
26
 )
27
 
27
 

internal/driver/driver_test.go → pkg/driver/driver_test.go View File

30
 	"testing"
30
 	"testing"
31
 	"time"
31
 	"time"
32
 
32
 
33
-	"github.com/google/pprof/internal/plugin"
34
-	"github.com/google/pprof/internal/proftest"
35
-	"github.com/google/pprof/internal/symbolz"
33
+	"github.com/google/pprof/pkg/plugin"
34
+	"github.com/google/pprof/pkg/proftest"
35
+	"github.com/google/pprof/pkg/symbolz"
36
 	"github.com/google/pprof/profile"
36
 	"github.com/google/pprof/profile"
37
 )
37
 )
38
 
38
 

internal/driver/fetch.go → pkg/driver/fetch.go View File

30
 	"sync"
30
 	"sync"
31
 	"time"
31
 	"time"
32
 
32
 
33
-	"github.com/google/pprof/internal/measurement"
34
-	"github.com/google/pprof/internal/plugin"
33
+	"github.com/google/pprof/pkg/measurement"
34
+	"github.com/google/pprof/pkg/plugin"
35
 	"github.com/google/pprof/profile"
35
 	"github.com/google/pprof/profile"
36
 )
36
 )
37
 
37
 

internal/driver/fetch_test.go → pkg/driver/fetch_test.go View File

35
 	"testing"
35
 	"testing"
36
 	"time"
36
 	"time"
37
 
37
 
38
-	"github.com/google/pprof/internal/binutils"
39
-	"github.com/google/pprof/internal/plugin"
40
-	"github.com/google/pprof/internal/proftest"
41
-	"github.com/google/pprof/internal/symbolizer"
42
-	"github.com/google/pprof/internal/transport"
38
+	"github.com/google/pprof/pkg/binutils"
39
+	"github.com/google/pprof/pkg/plugin"
40
+	"github.com/google/pprof/pkg/proftest"
41
+	"github.com/google/pprof/pkg/symbolizer"
42
+	"github.com/google/pprof/pkg/transport"
43
 	"github.com/google/pprof/profile"
43
 	"github.com/google/pprof/profile"
44
 )
44
 )
45
 
45
 

internal/driver/flags.go → pkg/driver/flags.go View File


internal/driver/flamegraph.go → pkg/driver/flamegraph.go View File

20
 	"net/http"
20
 	"net/http"
21
 	"strings"
21
 	"strings"
22
 
22
 
23
-	"github.com/google/pprof/internal/graph"
24
-	"github.com/google/pprof/internal/measurement"
25
-	"github.com/google/pprof/internal/report"
23
+	"github.com/google/pprof/pkg/graph"
24
+	"github.com/google/pprof/pkg/measurement"
25
+	"github.com/google/pprof/pkg/report"
26
 )
26
 )
27
 
27
 
28
 type treeNode struct {
28
 type treeNode struct {

internal/driver/interactive.go → pkg/driver/interactive.go View File

22
 	"strconv"
22
 	"strconv"
23
 	"strings"
23
 	"strings"
24
 
24
 
25
-	"github.com/google/pprof/internal/plugin"
26
-	"github.com/google/pprof/internal/report"
25
+	"github.com/google/pprof/pkg/plugin"
26
+	"github.com/google/pprof/pkg/report"
27
 	"github.com/google/pprof/profile"
27
 	"github.com/google/pprof/profile"
28
 )
28
 )
29
 
29
 

internal/driver/interactive_test.go → pkg/driver/interactive_test.go View File

20
 	"strings"
20
 	"strings"
21
 	"testing"
21
 	"testing"
22
 
22
 
23
-	"github.com/google/pprof/internal/plugin"
24
-	"github.com/google/pprof/internal/proftest"
25
-	"github.com/google/pprof/internal/report"
26
-	"github.com/google/pprof/internal/transport"
23
+	"github.com/google/pprof/pkg/plugin"
24
+	"github.com/google/pprof/pkg/proftest"
25
+	"github.com/google/pprof/pkg/report"
26
+	"github.com/google/pprof/pkg/transport"
27
 	"github.com/google/pprof/profile"
27
 	"github.com/google/pprof/profile"
28
 )
28
 )
29
 
29
 

internal/driver/options.go → pkg/driver/options.go View File

21
 	"os"
21
 	"os"
22
 	"strings"
22
 	"strings"
23
 
23
 
24
-	"github.com/google/pprof/internal/binutils"
25
-	"github.com/google/pprof/internal/plugin"
26
-	"github.com/google/pprof/internal/symbolizer"
27
-	"github.com/google/pprof/internal/transport"
24
+	"github.com/google/pprof/pkg/binutils"
25
+	"github.com/google/pprof/pkg/plugin"
26
+	"github.com/google/pprof/pkg/symbolizer"
27
+	"github.com/google/pprof/pkg/transport"
28
 )
28
 )
29
 
29
 
30
 // setDefaults returns a new plugin.Options with zero fields sets to
30
 // setDefaults returns a new plugin.Options with zero fields sets to

internal/driver/settings.go → pkg/driver/settings.go View File


internal/driver/settings_test.go → pkg/driver/settings_test.go View File


internal/driver/svg.go → pkg/driver/svg.go View File


internal/driver/tempfile.go → pkg/driver/tempfile.go View File


internal/driver/testdata/cppbench.contention → pkg/driver/testdata/cppbench.contention View File


internal/driver/testdata/cppbench.cpu → pkg/driver/testdata/cppbench.cpu View File


internal/driver/testdata/cppbench.small.contention → pkg/driver/testdata/cppbench.small.contention View File


internal/driver/testdata/file1000.src → pkg/driver/testdata/file1000.src View File


internal/driver/testdata/file2000.src → pkg/driver/testdata/file2000.src View File


internal/driver/testdata/file3000.src → pkg/driver/testdata/file3000.src View File


internal/driver/testdata/go.crc32.cpu → pkg/driver/testdata/go.crc32.cpu View File


internal/driver/testdata/go.nomappings.crash → pkg/driver/testdata/go.nomappings.crash View File


internal/driver/testdata/pprof.contention.cum.files.dot → pkg/driver/testdata/pprof.contention.cum.files.dot View File


internal/driver/testdata/pprof.contention.flat.addresses.dot.focus.ignore → pkg/driver/testdata/pprof.contention.flat.addresses.dot.focus.ignore View File


internal/driver/testdata/pprof.cpu.addresses.traces → pkg/driver/testdata/pprof.cpu.addresses.traces View File


internal/driver/testdata/pprof.cpu.call_tree.callgrind → pkg/driver/testdata/pprof.cpu.call_tree.callgrind View File


internal/driver/testdata/pprof.cpu.callgrind → pkg/driver/testdata/pprof.cpu.callgrind View File


internal/driver/testdata/pprof.cpu.comments → pkg/driver/testdata/pprof.cpu.comments View File


internal/driver/testdata/pprof.cpu.cum.lines.text.focus.hide → pkg/driver/testdata/pprof.cpu.cum.lines.text.focus.hide View File


internal/driver/testdata/pprof.cpu.cum.lines.text.hide → pkg/driver/testdata/pprof.cpu.cum.lines.text.hide View File


internal/driver/testdata/pprof.cpu.cum.lines.text.show → pkg/driver/testdata/pprof.cpu.cum.lines.text.show View File


internal/driver/testdata/pprof.cpu.cum.lines.topproto.hide → pkg/driver/testdata/pprof.cpu.cum.lines.topproto.hide View File


internal/driver/testdata/pprof.cpu.cum.lines.tree.show_from → pkg/driver/testdata/pprof.cpu.cum.lines.tree.show_from View File


internal/driver/testdata/pprof.cpu.flat.addresses.disasm → pkg/driver/testdata/pprof.cpu.flat.addresses.disasm View File


internal/driver/testdata/pprof.cpu.flat.addresses.noinlines.text → pkg/driver/testdata/pprof.cpu.flat.addresses.noinlines.text View File


internal/driver/testdata/pprof.cpu.flat.addresses.weblist → pkg/driver/testdata/pprof.cpu.flat.addresses.weblist View File


internal/driver/testdata/pprof.cpu.flat.filefunctions.noinlines.text → pkg/driver/testdata/pprof.cpu.flat.filefunctions.noinlines.text View File


internal/driver/testdata/pprof.cpu.flat.functions.call_tree.dot → pkg/driver/testdata/pprof.cpu.flat.functions.call_tree.dot View File


internal/driver/testdata/pprof.cpu.flat.functions.dot → pkg/driver/testdata/pprof.cpu.flat.functions.dot View File


internal/driver/testdata/pprof.cpu.flat.functions.noinlines.text → pkg/driver/testdata/pprof.cpu.flat.functions.noinlines.text View File


internal/driver/testdata/pprof.cpu.flat.functions.text → pkg/driver/testdata/pprof.cpu.flat.functions.text View File


internal/driver/testdata/pprof.cpu.lines.topproto → pkg/driver/testdata/pprof.cpu.lines.topproto View File


internal/driver/testdata/pprof.cpu.peek → pkg/driver/testdata/pprof.cpu.peek View File


internal/driver/testdata/pprof.cpu.tags → pkg/driver/testdata/pprof.cpu.tags View File


internal/driver/testdata/pprof.cpu.tags.focus.ignore → pkg/driver/testdata/pprof.cpu.tags.focus.ignore View File


internal/driver/testdata/pprof.cpu.traces → pkg/driver/testdata/pprof.cpu.traces View File


internal/driver/testdata/pprof.cpusmall.flat.addresses.tree → pkg/driver/testdata/pprof.cpusmall.flat.addresses.tree View File


internal/driver/testdata/pprof.heap.callgrind → pkg/driver/testdata/pprof.heap.callgrind View File


internal/driver/testdata/pprof.heap.comments → pkg/driver/testdata/pprof.heap.comments View File


internal/driver/testdata/pprof.heap.cum.lines.tree.focus → pkg/driver/testdata/pprof.heap.cum.lines.tree.focus View File


internal/driver/testdata/pprof.heap.cum.relative_percentages.tree.focus → pkg/driver/testdata/pprof.heap.cum.relative_percentages.tree.focus View File


internal/driver/testdata/pprof.heap.flat.files.seconds.text → pkg/driver/testdata/pprof.heap.flat.files.seconds.text View File


internal/driver/testdata/pprof.heap.flat.files.text → pkg/driver/testdata/pprof.heap.flat.files.text View File


internal/driver/testdata/pprof.heap.flat.files.text.focus → pkg/driver/testdata/pprof.heap.flat.files.text.focus View File


internal/driver/testdata/pprof.heap.flat.inuse_objects.text → pkg/driver/testdata/pprof.heap.flat.inuse_objects.text View File


internal/driver/testdata/pprof.heap.flat.inuse_space.dot.focus → pkg/driver/testdata/pprof.heap.flat.inuse_space.dot.focus View File


internal/driver/testdata/pprof.heap.flat.inuse_space.dot.focus.ignore → pkg/driver/testdata/pprof.heap.flat.inuse_space.dot.focus.ignore View File


internal/driver/testdata/pprof.heap.flat.lines.dot.focus → pkg/driver/testdata/pprof.heap.flat.lines.dot.focus View File


internal/driver/testdata/pprof.heap.tags → pkg/driver/testdata/pprof.heap.tags View File


internal/driver/testdata/pprof.heap.tags.unit → pkg/driver/testdata/pprof.heap.tags.unit View File


internal/driver/testdata/pprof.heap_alloc.flat.alloc_objects.text → pkg/driver/testdata/pprof.heap_alloc.flat.alloc_objects.text View File


internal/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot → pkg/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot View File


internal/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot.focus → pkg/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot.focus View File


internal/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot.hide → pkg/driver/testdata/pprof.heap_alloc.flat.alloc_space.dot.hide View File


internal/driver/testdata/pprof.heap_request.tags.focus → pkg/driver/testdata/pprof.heap_request.tags.focus View File


internal/driver/testdata/pprof.heap_sizetags.dot → pkg/driver/testdata/pprof.heap_sizetags.dot View File


internal/driver/testdata/pprof.heap_tags.traces → pkg/driver/testdata/pprof.heap_tags.traces View File


internal/driver/testdata/pprof.long_name_funcs.dot → pkg/driver/testdata/pprof.long_name_funcs.dot View File


internal/driver/testdata/pprof.long_name_funcs.text → pkg/driver/testdata/pprof.long_name_funcs.text View File


internal/driver/testdata/pprof.unknown.flat.functions.call_tree.text → pkg/driver/testdata/pprof.unknown.flat.functions.call_tree.text View File


internal/driver/webhtml.go → pkg/driver/webhtml.go View File

312
     </div>
312
     </div>
313
     <div class="submenu">
313
     <div class="submenu">
314
       <a title="{{.Help.top}}"  href="./top" id="topbtn">Top</a>
314
       <a title="{{.Help.top}}"  href="./top" id="topbtn">Top</a>
315
-      <a title="{{.Help.graph}}" href="./" id="graphbtn">Graph</a>
315
+      <a title="{{.Help.graph}}" href="./dot" id="graphbtn">Graph</a>
316
       <a title="{{.Help.flamegraph}}" href="./flamegraph" id="flamegraph">Flame Graph</a>
316
       <a title="{{.Help.flamegraph}}" href="./flamegraph" id="flamegraph">Flame Graph</a>
317
       <a title="{{.Help.peek}}" href="./peek" id="peek">Peek</a>
317
       <a title="{{.Help.peek}}" href="./peek" id="peek">Peek</a>
318
       <a title="{{.Help.list}}" href="./source" id="list">Source</a>
318
       <a title="{{.Help.list}}" href="./source" id="list">Source</a>

internal/driver/webui.go → pkg/driver/webui.go View File

27
 	"strings"
27
 	"strings"
28
 	"time"
28
 	"time"
29
 
29
 
30
-	"github.com/google/pprof/internal/graph"
31
-	"github.com/google/pprof/internal/plugin"
32
-	"github.com/google/pprof/internal/report"
30
+	"github.com/google/pprof/pkg/graph"
31
+	"github.com/google/pprof/pkg/plugin"
32
+	"github.com/google/pprof/pkg/report"
33
 	"github.com/google/pprof/profile"
33
 	"github.com/google/pprof/profile"
34
 )
34
 )
35
 
35
 
281
 
281
 
282
 	html := &bytes.Buffer{}
282
 	html := &bytes.Buffer{}
283
 	if err := ui.templates.ExecuteTemplate(html, tmpl, data); err != nil {
283
 	if err := ui.templates.ExecuteTemplate(html, tmpl, data); err != nil {
284
-		http.Error(w, "internal template error", http.StatusInternalServerError)
284
+		http.Error(w, "pkg template error", http.StatusInternalServerError)
285
 		ui.options.UI.PrintErr(err)
285
 		ui.options.UI.PrintErr(err)
286
 		return
286
 		return
287
 	}
287
 	}

internal/driver/webui_test.go → pkg/driver/webui_test.go View File


Some files were not shown because too many files changed in this diff