1
0
mirror of https://github.com/golang/go synced 2024-11-14 07:10:21 -07:00

runtime/pprof: write heap statistics to heap profile always

This is a duplicate of CL 9491.
That CL broke the build due to pprof shortcomings
and was reverted in CL 9565.

CL 9623 fixed pprof, so this can go in again.

Fixes #10659.

Change-Id: If470fc90b3db2ade1d161b4417abd2f5c6c330b8
Reviewed-on: https://go-review.googlesource.com/10212
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Josh Bleecher Snyder 2015-05-18 19:38:56 +00:00
parent 19354b9dc8
commit 79986e24e0
2 changed files with 25 additions and 26 deletions

View File

@ -66,6 +66,7 @@ reflect: add ArrayOf (https://golang.org/cl/4111)
reflect: add FuncOf (https://golang.org/cl/1996) reflect: add FuncOf (https://golang.org/cl/1996)
runtime, syscall: use SYSCALL instruction on FreeBSD (Go 1.5 now requires FreeBSD 8-STABLE+) (https://golang.org/cl/3020) runtime, syscall: use SYSCALL instruction on FreeBSD (Go 1.5 now requires FreeBSD 8-STABLE+) (https://golang.org/cl/3020)
runtime, syscall: use get_random_bytes syscall for NaCl (Go 1.5 now requires NaCl SDK pepper-39 or above) (https://golang.org/cl/1755) runtime, syscall: use get_random_bytes syscall for NaCl (Go 1.5 now requires NaCl SDK pepper-39 or above) (https://golang.org/cl/1755)
runtime/pprof: memory profiles include overall memory statistics by default (https://golang.org/cl/9491)
strings: add Compare(x, y string) int, for symmetry with bytes.Compare (https://golang.org/cl/2828) strings: add Compare(x, y string) int, for symmetry with bytes.Compare (https://golang.org/cl/2828)
syscall: Add Foreground and Pgid to SysProcAttr (https://golang.org/cl/5130) syscall: Add Foreground and Pgid to SysProcAttr (https://golang.org/cl/5130)
syscall: add missing Syscall9 for darwin/amd64 (https://golang.org/cl/6555) syscall: add missing Syscall9 for darwin/amd64 (https://golang.org/cl/6555)

View File

@ -442,7 +442,6 @@ func writeHeap(w io.Writer, debug int) error {
// Print memstats information too. // Print memstats information too.
// Pprof will ignore, but useful for people // Pprof will ignore, but useful for people
if debug > 0 {
s := new(runtime.MemStats) s := new(runtime.MemStats)
runtime.ReadMemStats(s) runtime.ReadMemStats(s)
fmt.Fprintf(w, "\n# runtime.MemStats\n") fmt.Fprintf(w, "\n# runtime.MemStats\n")
@ -470,7 +469,6 @@ func writeHeap(w io.Writer, debug int) error {
fmt.Fprintf(w, "# NumGC = %d\n", s.NumGC) fmt.Fprintf(w, "# NumGC = %d\n", s.NumGC)
fmt.Fprintf(w, "# EnableGC = %v\n", s.EnableGC) fmt.Fprintf(w, "# EnableGC = %v\n", s.EnableGC)
fmt.Fprintf(w, "# DebugGC = %v\n", s.DebugGC) fmt.Fprintf(w, "# DebugGC = %v\n", s.DebugGC)
}
if tw != nil { if tw != nil {
tw.Flush() tw.Flush()