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

runtime/pprof: -runtime flag support missing #19927

Closed
josharian opened this issue Apr 11, 2017 · 3 comments
Closed

runtime/pprof: -runtime flag support missing #19927

josharian opened this issue Apr 11, 2017 · 3 comments
Milestone

Comments

@josharian
Copy link
Contributor

In Go 1.8, if I wanted to see where in the runtime allocations came from, I could use memory profiling and then run go tool pprof with the -runtime flag. The -runtime flag is absent on tip, and it appears (from trying out the 1.8 pprof tool on the tip profiles) that the data is not being recorded either. This is an impediment to optimizing the runtime.

Perhaps unrelatedly, the 1.8 pprof tool usefully lists the heap profile display modes in its help text:

Sample value selection option (for heap profiles):
  -inuse_space      Display in-use memory size
  -inuse_objects    Display in-use object counts
  -alloc_space      Display allocated memory size
  -alloc_objects    Display allocated object counts

The tip pprof tool does not.

cc @rsc @matloob

@josharian josharian added this to the Go1.9 milestone Apr 11, 2017
@josharian josharian changed the title runtime/pprof: -runtime support missing runtime/pprof: -runtime flag support missing Apr 11, 2017
@rsc
Copy link
Contributor

rsc commented Apr 11, 2017

Pprof has moved responsibility for this filtering into the profile generators, which is where it belongs. (Pprof shouldn't have a list of magic Go runtime symbols in its source code.) Unfortunately, this means we can't support the -runtime flag.

For your own debugging you can change src/runtime/pprof/protomem.go to say hideRuntime := false. I'm not sure whether we should introduce new API to make that possible to trigger without patching.

@josharian
Copy link
Contributor Author

Good to know. Given that this need is mainly for contributors, and it's a single-line patch, I'm ok just patching as needed.

@rsc
Copy link
Contributor

rsc commented Apr 11, 2017

OK, will close for now.

@rsc rsc closed this as completed Apr 11, 2017
@golang golang locked and limited conversation to collaborators Apr 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants