I want to instrument a large Python project to be able to debug production issues that look like this:
23321 07:49:57.925037 futex(0x23b2c20, FUTEX_WAIT_PRIVATE, 0, NULL <unfinished ...>
23321 07:50:12.435793 <... futex resumed> ) = 0
Here, a thread waited 14.4 seconds on some lock (or condition variable).
I don't know for sure if that lock was created in Python code or in some 3rd party C extension, but Python is statistically a good guess.
By the time I attached strace
, this futex was already created. I suspect it was created during application start-up.
I'd like to poke threading.Lock()
and threading.Condition()
objects and find out their underlying futex id's.
At the very least I'd log these id's, so that later, if I have to strace a running application, I can resolve futex calls I see to something logical.