We have a problem in our software. We have a mutex accessed by multiple threads. It looks like some thread has locked this mutex and others are blocked on it.
Is there a way to use dtrace script to capture the thread that has blocked it? I'm new to dtrace. Couldn't find anything in this regard.
Tried using plockstat$1:::mutex-acquire
However, how do I get the threadId of the locking thread. If I use tid variable in printf, it keeps printing tons of thread info for a blocked access as well. What I need is a way to determine for sure which thread has got hold of the mutex.
Any pointers in this regard would be very helpful.
i use truss to find this stuff.. i also use prex..
I have developed an application that will read prex and tell ya what is being called...
when you run truss on the process use truss -aef -v all -r all -w all -p <pid>
this will show you threads and everythign.. there are other flags.. this is the most basic stuff i use..
u can add D for delta and some other stuff...
you will see the calls to mutex lock called and by what thread...
u can then use pstack on the process to see what functions each thread is in..