Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/pprof: network symbol fetch not working #9199

Closed
gopherbot opened this issue Dec 3, 2014 · 5 comments
Closed

cmd/pprof: network symbol fetch not working #9199

gopherbot opened this issue Dec 3, 2014 · 5 comments
Assignees
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Dec 3, 2014

by toffaletti:

Examples using profiles fetched from net/http/pprof.

inuse_objects:

(pprof) top
354070 of 354070 total (  100%)
      flat  flat%   sum%        cum   cum%
    354070   100%   100%     354070   100% 

cpu profile:

(pprof) top
9.06s of 9.06s total (  100%)
      flat  flat%   sum%        cum   cum%
     9.06s   100%   100%      9.06s   100%  


This was previously working with 1.4beta1 and 1.3.1.
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Dec 3, 2014

Comment 1:

I suspect this will simply be closed as unfortunate, but I haven't follow the pprof
changes closely enough to be sure.

Labels changed: added repo-main, release-go1.4maybe.

Owner changed to @rsc.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 3, 2014

Comment 2:

The profile format has not changed, so it should all work. And it does with profiles
written to disk:
g% go1.3 test -c hash/crc32
g% ./crc32.test -test.bench=. -test.cpuprofile=x.prof
PASS
BenchmarkCrc32KB      500000          3438 ns/op     297.80 MB/s
g% go tool pprof crc32.test x.prof
Entering interactive mode (type "help" for commands)
(pprof) top
1.62s of 1.62s total (  100%)
      flat  flat%   sum%        cum   cum%
     1.44s 88.89% 88.89%      1.44s 88.89%  hash/crc32.update
     0.15s  9.26% 98.15%      0.15s  9.26%  runtime.usleep
     0.02s  1.23% 99.38%      0.02s  1.23%  hash/crc32.(*digest).Sum
     0.01s  0.62%   100%      1.47s 90.74%  hash/crc32.BenchmarkCrc32KB
         0     0%   100%      0.15s  9.26%  System
         0     0%   100%      1.44s 88.89%  hash/crc32.(*digest).Write
         0     0%   100%      1.44s 88.89%  hash/crc32.Update
         0     0%   100%      1.47s 90.74%  runtime.gosched0
         0     0%   100%      1.47s 90.74%  testing.(*B).launch
         0     0%   100%      1.47s 90.74%  testing.(*B).runN
(pprof) 
Heap profiles also work:
g% go1.3 test -c encoding/json
g% (cd ~/go1.3/src/pkg/encoding/json; ~/json.test -test.bench=.
-test.memprofile=$HOME/x.prof)
PASS
BenchmarkCodeEncoder          50      24843046 ns/op      78.11 MB/s
BenchmarkCodeMarshal          50      28137133 ns/op      68.96 MB/s
BenchmarkCodeDecoder          10     117676221 ns/op      16.49 MB/s
BenchmarkCodeUnmarshal        20     109212665 ns/op      17.77 MB/s
BenchmarkCodeUnmarshalReuse       20     111197678 ns/op
BenchmarkUnmarshalString     2000000           897 ns/op
BenchmarkUnmarshalFloat64    5000000           698 ns/op
BenchmarkUnmarshalInt64  5000000           639 ns/op
BenchmarkSkipValue        50      23336935 ns/op      83.33 MB/s
BenchmarkEncoderEncode   1000000          1042 ns/op         219 B/op          2 allocs/op
g% go tool pprof json.test x.prof
Entering interactive mode (type "help" for commands)
(pprof) top10
9070.36kB of 9070.36kB total (  100%)
Dropped 51 nodes (cum <= 45.35kB)
Showing top 10 nodes out of 36 (cum >= 1536.11kB)
      flat  flat%   sum%        cum   cum%
 6508.99kB 71.76% 71.76%  6508.99kB 71.76%  bytes.makeSlice
 1025.27kB 11.30% 83.06%  1025.27kB 11.30%  _rt0_go
 1024.08kB 11.29% 94.35%  1024.08kB 11.29%  reflect.unsafe_New
  512.03kB  5.65%   100%   512.03kB  5.65%  encoding/json.(*decodeState).literalStore
         0     0%   100%  2086.21kB 23.00%  bytes.(*Buffer).ReadFrom
         0     0%   100%  2260.91kB 24.93%  bytes.(*Buffer).Write
         0     0%   100%  2161.87kB 23.83%  bytes.(*Buffer).WriteByte
         0     0%   100%  4422.78kB 48.76%  bytes.(*Buffer).grow
         0     0%   100%  4422.78kB 48.76%  encoding/json.(*arrayEncoder).encode
         0     0%   100%  1536.11kB 16.94%  encoding/json.(*decodeState).array
(pprof)
However, I can confirm that the network handlers don't work:
g% godoc -http=:6060&
[1] 33130
g% go tool pprof http://localhost:6060/debug/pprof/heap 
Fetching profile from http://localhost:6060/debug/pprof/heap
Saved profile in
/Users/rsc/pprof/pprof.localhost:6060.inuse_objects.inuse_space.003.pb.gz
Entering interactive mode (type "help" for commands)
(pprof) top10
2.14MB of 2.14MB total (  100%)
      flat  flat%   sum%        cum   cum%
    2.14MB   100%   100%     2.14MB   100%  
But if you do the fetch yourself, they do:
g% hget http://localhost:6060/debug/pprof/heap >x.prof
g% go tool pprof $(which godoc) x.prof
Entering interactive mode (type "help" for commands)
(pprof) top10
2186.87kB of 2186.87kB total (  100%)
Dropped 68 nodes (cum <= 10.93kB)
Showing top 10 nodes out of 16 (cum >= 650.62kB)
      flat  flat%   sum%        cum   cum%
 1024.11kB 46.83% 46.83%  1024.11kB 46.83%  go/doc.clean
  650.62kB 29.75% 76.58%   650.62kB 29.75%  bytes.makeSlice
  512.14kB 23.42%   100%   512.14kB 23.42%  mcommoninit
         0     0%   100%   650.62kB 29.75%  bytes.(*Buffer).ReadFrom
         0     0%   100%  1024.11kB 46.83%  go/doc.Synopsis
         0     0%   100%   650.62kB 29.75%  golang.org/x/tools/godoc.(*Corpus).refreshMetadataLoop
         0     0%   100%   650.62kB 29.75%  golang.org/x/tools/godoc.(*Corpus).updateMetadata
         0     0%   100%  1024.11kB 46.83%  golang.org/x/tools/godoc.(*treeBuilder).newDirTree
         0     0%   100%  1024.11kB 46.83%  golang.org/x/tools/godoc.func·002
         0     0%   100%   650.62kB 29.75%  golang.org/x/tools/godoc.func·024
(pprof) 
Worse, that was with Go 1.4 godoc, not Go 1.3 godoc. The problem is Go 1.4 pprof is
clearly not able to fetch symbols remotely, from anyone. Will fix.

Labels changed: added release-go1.4, removed release-go1.4maybe.

Status changed to Accepted.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Dec 3, 2014

Comment 3:

CL https://golang.org/cl/183080043 mentions this issue.
@rsc
Copy link
Contributor

@rsc rsc commented Dec 3, 2014

Comment 4:

This issue was closed by revision 9f04a62.

Status changed to Fixed.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 3, 2014

Comment 5:

This issue was closed by revision a8374fb64418.

@gopherbot gopherbot added fixed labels Dec 3, 2014
@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
rsc added a commit that referenced this issue May 11, 2015
…ofiles

««« CL 183080043 / b663cc7e6c15
cmd/pprof: fix symbol resolution for remote profiles

Fixes #9199.

LGTM=iant
R=golang-codereviews, iant
CC=austin, golang-codereviews, minux
https://golang.org/cl/183080043
»»»

TBR=iant
CC=golang-codereviews
https://golang.org/cl/176680043
@golang golang locked and limited conversation to collaborators Jun 25, 2016
wheatman added a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
…ofiles

««« CL 183080043 / b663cc7e6c15
cmd/pprof: fix symbol resolution for remote profiles

Fixes golang#9199.

LGTM=iant
R=golang-codereviews, iant
CC=austin, golang-codereviews, minux
https://golang.org/cl/183080043
»»»

TBR=iant
CC=golang-codereviews
https://golang.org/cl/176680043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
…ofiles

««« CL 183080043 / b663cc7e6c15
cmd/pprof: fix symbol resolution for remote profiles

Fixes golang#9199.

LGTM=iant
R=golang-codereviews, iant
CC=austin, golang-codereviews, minux
https://golang.org/cl/183080043
»»»

TBR=iant
CC=golang-codereviews
https://golang.org/cl/176680043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
…ofiles

««« CL 183080043 / b663cc7e6c15
cmd/pprof: fix symbol resolution for remote profiles

Fixes golang#9199.

LGTM=iant
R=golang-codereviews, iant
CC=austin, golang-codereviews, minux
https://golang.org/cl/183080043
»»»

TBR=iant
CC=golang-codereviews
https://golang.org/cl/176680043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 20, 2018
…ofiles

««« CL 183080043 / b663cc7e6c15
cmd/pprof: fix symbol resolution for remote profiles

Fixes golang#9199.

LGTM=iant
R=golang-codereviews, iant
CC=austin, golang-codereviews, minux
https://golang.org/cl/183080043
»»»

TBR=iant
CC=golang-codereviews
https://golang.org/cl/176680043
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
…ofiles

««« CL 183080043 / b663cc7e6c15
cmd/pprof: fix symbol resolution for remote profiles

Fixes golang#9199.

LGTM=iant
R=golang-codereviews, iant
CC=austin, golang-codereviews, minux
https://golang.org/cl/183080043
»»»

TBR=iant
CC=golang-codereviews
https://golang.org/cl/176680043
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.