-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: forces choice between "inuse" and "alloc" heap profiles #16892
Comments
/cc @rauls5382 |
I agree this is a problem. Earlier versions of pprof would select between alloc/inuse before saving the profile on a proto. That was later changed to save all the data in the proto. go tool pprof is based on an older version of pprof, which does not have that fix. At some point we will refresh the tool to use the new version. I already have that in my queue under #16184 In the meantime, I recommend using the standalone pprof to collect the profiles. |
Closing as dupe of #16184 |
@rauls5382, we are probably not going to sync upstream pprof into pprof for Go 1.8 - too late. But we may still get to generating the binary pprof format by default from Go's profile handlers. Was the bug that discarded data in the legacy->binary conversion or was it still in binary->binary saving? If it's just in legacy->binary, then we can ignore it assuming we get direct binary generation working. If it's in the binary->binary saving too then we might want to grab that specific change. Thanks. |
Let's call this a dup of #17764. It looks like the initial checkin to github.com/google/pprof has a very different copy of profile/legacy_profile.go, so I can't find out when the fix in question was committed or what it was. That said, let's just work on getting the binary form generated, which will solve this problem. |
Hello! I've got a bug with
go tool pprof
's proto format that forces a choice between "inuse" and "alloc" modes (assuming "inuse" by default), which means I've got to capture two separate profiles or use the standalone google/pprof tool.What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?darwin/amd64, though I've also observed this on linux/amd64.
What did you do?
First, I run a trivial http server with pprof enabled. Then I point
go tool pprof
at it, asking the command to save a gzipped-protobuf-formatted heap profile. I then try to read that profile in various modes: inuse_space and alloc_spaceWhat did you expect to see?
I expected a single saved heap profile to be readable in all four modes (inuse_space, inuse_objects, alloc_space, alloc_objects). I expected this because the other pprof tool can do this, and because the text file served from /debug/pprof/heap can be interpreted in all four modes.
What did you see instead?
A heap profile saved with
go tool pprof -proto -inuse_space -output ./file http://...
cannot be read withgo tool pprof -alloc_space ./file
, and vice versa.main.go:
test.sh:
The text was updated successfully, but these errors were encountered: