CPU Profile not parseable by pprof
See original GitHub issueLatest pprof can not parse the output of the com.twitter.jvm.CpuProfile class, most likely because CpuProfile produces a legacy profile that became unsupported when pprof was reimplemented in Go.
Actual Behavior
With pprof from “go get -u github.com/google/pprof” at a74ae6fb3cd7047c79272e3ea0814b08154a2d3c and running on Mac OS El Capitan, I produced a profile from my server that looks like that following:
--- symbol
binary=com.yext.profileservice.ProfileServer
0x0000000000000001 com.yext.rpc.RpcServer$Worker.run(RpcServer.java:356)
0x0000000000000002 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
0x0000000000000003 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
...
---
--- profile
^@^@^@^@^@^@^@^@^C^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^A^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^A^@^@^@^@^@^@^@^F^@^@^@^@^@^@^@^A^@^@^@^@^@^@^@^B^@^@^@^@
...
Full file here: https://github.com/robfig/testprofile/blob/master/legacy_profile
Trying to feed that to pprof is unsuccessful
$ pprof profile
legacy_profile: parsing profile: unrecognized profile format
pprof: failed to fetch any source profiles
Expected behavior
I expected pprof to accept the profile.
I believe you can reproduce using any profile produced by this class with latest pprof.
Any advice would be much appreciated. I’m afraid that fixing this requires updating to use the protobuf profile format though.
Thanks very much, Rob
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
fwiw, they didn’t want this dependency in Go, either, and just wrote manual code to encode the profiles. it’s not too bad.
Ref: https://go.googlesource.com/go/+/master/src/runtime/pprof/proto.go