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

proposal: runtime: Expose goid and gopc in GoroutineProfile #59663

Open
vaind opened this issue Apr 17, 2023 · 2 comments
Open

proposal: runtime: Expose goid and gopc in GoroutineProfile #59663

vaind opened this issue Apr 17, 2023 · 2 comments
Labels
Milestone

Comments

@vaind
Copy link

vaind commented Apr 17, 2023

While investigating runtime.GoroutineProfile() for profiling (sampling), I've noticed the resulting StackRecord is missing any way to identify a Goroutine across collected samples. Actual copy of goid and gopc from g could happen in saveg() to StackRecord, but I'm not sure that's the best idea, considering, StackRecord is also used in a couple of other places where it wouldn't make sense to add these fields. Also, it wouldn't be a generic StackRecord then...

@seankhliao
Copy link
Member

cc @golang/runtime

@vaind
Copy link
Author

vaind commented Nov 20, 2023

Hey, is there something I can do to help get this happen? I'm looking for an alternative to calling runtime.stack(..., true) to get stack traces for all goroutines periodically because that is quite CPU heavy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Incoming
Development

No branches or pull requests

3 participants