-
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
runtime/pprof: no API to access deep stacktraces with MemProfileRecord and BlockProfileRecord #67941
Comments
Similar Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
It is probably possible to hack around the limitations by linking into |
I worked on the patch for adding deep stack traces. FWIW I initially tried to make deep stack traces available via the public API, see v35 of my CL. The problem is that there are various go1compat challenges in doing this, so we'll need a proposal that either manages to solve the problem without compat issues, or build consensus for accepting a minor amount of compat issues. Specifically:
|
We have a similar issue in with Google's internal peakheap profile implementation. As the name suggest, the peakheap profile keeps track of high-water-mark heap profiles. I was considering filing a proposal to add peakheap profiles to the runtime, but I didn't have enough time to think it through. Given that I am not the only one with such a problem, I am favoring the idea of exporting the larger stacks via a runtime API now. Regarding the go1compat challenges: Do we have to change the existing API or could there be a v2 API (e.g. in a new package, say runtime/profile). |
cc @golang/runtime |
I believe this is a duplicate of #43669. |
@rsc I think there's some overlap, but this is really about a specific unresolved part of #43669. Meanwhile, #43669 is now mostly resolved, since as of https://go.dev/cl/572396, deep stacks are available everywhere except the runtime APIs mentioned in this issue. I think maybe we should close #43669 in favor of this issue? |
Sure, if you think #43669 is done, then feel free to close it. Personally, I would say that the API to access the deep stack traces is runtime/pprof, and we just deprecate the old MemProfileRecord, BlockProfileRecord structs. |
I assume we will have to link into new pprof_memPrifileInternal and co. if we want deep stacktraces? I am not missing anything, right? |
Go version
go version devel go1.23-b788e91bad Tue Jun 11 18:08:44 2024 +0000 linux/amd64
Output of
go env
in your module/workspace:What did you do?
I compare stacks from
runtime.MemProfile
andruntime/pprof.WriteHeapProfile
https://go.dev/play/p/7iUI7DdMI3r?v=gotip
What did you see happen?
I see the
MemprofileRecord
stacks are truncated at 32 depth and pprof stacks has proper deep stacks.What did you expect to see?
I expected
MemprofileRecord.Stack()
to return a slice with correct deep stack.The text was updated successfully, but these errors were encountered: