Go: cmd/pprof: go tool pprof starts the prof without binary

Created on 15 May 2015  ·  8Comments  ·  Source: golang/go

go version go1.4.1 linux/amd64

go tool pprof cpu.prof
Entering interactive mode (type "help" for commands)
(pprof) top
10.29s of 10.29s total (  100%)
      flat  flat%   sum%        cum   cum%
    10.29s   100%   100%     10.29s   100%  

where i should have typed this

go tool pprof mybinary cpu.prof

I did fail to read the help correctly so it is my own fault - but it gave me no indication i did anything wrong.
ref: https://groups.google.com/forum/#!topic/Golang-Nuts/dd9QwwGdt34

FrozenDueToAge

Most helpful comment

This keeps tripping people up (see #14324 for instance). Is it possible for pprof to give an error, or at least a warning, if it detects this bad usage? (i.e. no binary and the profile doesn't contain the necessary symbols itself to be useful.)

All 8 comments

Note: Only Googlers can work on this, because pprof in go 1.5 is just a copy of internal source according to https://github.com/golang/go/blob/master/src/cmd/pprof/README

Not true. Hack on Go's version at will. We'll deal with synchronizing with Google's version occasionally in batches.

Starting a pprof without the binary is still helpful if the profile contains symbol info like when fetched via the net/http/pprof endpoint.

This keeps tripping people up (see #14324 for instance). Is it possible for pprof to give an error, or at least a warning, if it detects this bad usage? (i.e. no binary and the profile doesn't contain the necessary symbols itself to be useful.)

CL https://golang.org/cl/23323 mentions this issue.

@rakyll my report we discussed was a duplicate, here is the one you might want to track :)

From the 1.9 release notes ( https://golang.org/doc/go1.9#go-tool-pprof )

Profiles produced by the runtime/pprof package now include symbol information, so they can be viewed in go tool pprof without the binary that produced the profile.

I think this can be closed.

Yay.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

natefinch picture natefinch  ·  3Comments

myitcv picture myitcv  ·  3Comments

longzhizhi picture longzhizhi  ·  3Comments

mingrammer picture mingrammer  ·  3Comments

jayhuang75 picture jayhuang75  ·  3Comments