This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Gabriele Tornetta
Recipients Gabriele Tornetta
Date 2021-04-17.09:18:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org>
In-reply-to
Content
I would like to propose adding the native_id field to the PyThreadState structure to store the result of PyThread_get_thread_native_id. On some systems, like Linux, it is not easy to retrieve this information from outside of the Python interpreter process.

Tools like Austin (https://github.com/P403n1x87/austin) could benefit from this for CPU time sampling. Currently, if one wants to retrieve the TID from a PyThreadState instance is to regard thread_id as a pointer to a struct pthread structure, loop over all the Python threads to find the one that has the PID for TID and infer the offset of the tid field within struct pthread, which is not ideal.
History
Date User Action Args
2021-04-17 09:18:44Gabriele Tornettasetrecipients: + Gabriele Tornetta
2021-04-17 09:18:44Gabriele Tornettasetmessageid: <1618651124.52.0.543120021636.issue43879@roundup.psfhosted.org>
2021-04-17 09:18:44Gabriele Tornettalinkissue43879 messages
2021-04-17 09:18:44Gabriele Tornettacreate