-
Notifications
You must be signed in to change notification settings - Fork 368
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
Include thread name in Memray live tracking view #561
Comments
Thanks for opening an issue @gibsondan! We do have the thread name already collected so it should be fairly simple to pass it through the layers and display it in the TUI |
Can you clarify which string name you're referring to, @gibsondan ? |
@godlygeek when you create a thread in python, you can supply a name: https://docs.python.org/3/library/threading.html#thread-objects (Or a threadpoolexecutor can specify a prefix which is applied to all threads created in that pool) I don't know offhand how that is translated into the operating system internals but I suspect it's through something like this: https://man7.org/linux/man-pages/man3/pthread_setname_np.3.html py-spy, for example, includes these names in its output via commands like
|
We do have access to the name set through That said, it would be interesting to try to collect the |
Is there an existing proposal for this?
Is your feature request related to a problem?
memray attach is incredibly useful - but for multi-threaded applications, once you've determined that a particular thread is the source of a memory issue, figuring out which thread in the application corresponds to that "Thread X of Y" number displayed in the live view is challenging.
Describe the solution you'd like
Each thread has a string name - it would be very useful if the thread name was included alongside the "Thread X of Y" output in the live view.
Alternatives you considered
We can use py-spy to map thread numbers to thread names (I think?) but it would be much more convenient to have that information already available in memray
Thanks for building an amazing tool!
The text was updated successfully, but these errors were encountered: