Comments (4)
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
from memray.
Each thread has a string name
Can you clarify which string name you're referring to, @gibsondan ?
from memray.
@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 py-spy dump
or the flamegraph produced by py-spy record
:
Thread 41 (idle): "schedule_daemon_worker_7"
from memray.
We do have access to the name set through pthread_setname_np
, but we don't have access to the name set using threading.Thread.name
, and setting the name on a Python Thread
object doesn't automatically cause pthread_setname_np
to be called with the same name (or even a leading prefix of it).
That said, it would be interesting to try to collect the name
attribute set on a threading.Thread
... I wonder if we're able to...
from memray.
Related Issues (20)
- %%memray_flamegraph magic options HOT 3
- Make the `%%memray_flamegraph` IPython magic use aggregated capture files
- is memray support profiling c version of python package like pillow? HOT 2
- continous profiling of memray HOT 1
- could i use follow-fork in api?
- the really meaning of --native HOT 1
- Accurate report? HOT 24
- `memray run` overwrites `sys.argv[0]` even when `-I` or `-P` is used
- A crash in `memray flamegraph` (Python 3.12.0, macOS, native mode) HOT 4
- empty flamegraph/summary with large memray dump HOT 15
- Move the runner into a separate package with minimal dependencies HOT 5
- Ctrl-Z in "memray tree" doesn't work HOT 2
- Memray not reporting memory leak as expected HOT 18
- Heap size does not change after function call.
- Track virtual memory HOT 1
- How to visualize huge bin file (over 2TB CPU Memory) HOT 3
- Ability to write to a pipe from `memray.Tracker` HOT 2
- Making memray third-party allocator-aware HOT 24
- How to profile gunicorn workers?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from memray.