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

feature request: Global greenlet trace function #310

Open
godlygeek opened this issue Aug 7, 2022 · 0 comments
Open

feature request: Global greenlet trace function #310

godlygeek opened this issue Aug 7, 2022 · 0 comments

Comments

@godlygeek
Copy link

I'm one of the maintainers of the Memray memory profiler. We recently got a bug report that's essentially a feature request in disguise: to support greenlet.

We've been researching what it would take for us to be able to support greenlet, and we think it's almost reasonable for us to support it, but there's one piece missing. Specifically, if someone uses the Memray API to start tracing in an application that has already spawned some threads, we have no way to call the (thread-specific) greenlet.settrace() function in each of the existing threads, which can lead to allocations being attributed to the wrong stack.

It would be very helpful if greenlet could either a) provide a way to install a global trace function that's called from every thread (or possibly every thread where no thread-local trace function has been installed), or b) provide a way to set the thread-local trace function on all existing threads. (Presumably (a) is much more reasonable to implement than (b), but either would work for our needs.)

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

No branches or pull requests

1 participant