I am investigating a dead lock issue (not ANR) in my Android app. When my app detected a potential dead lock, it prints out stack trace of all live threads using Thread.getAllStackTraces(). But this stack trace info doesn't include waiting and blocked information. I want to programmatically get stack trace with waiting and blocked info like below. Is there a way to do that?
"main" prio=5 tid=1 WAIT
| group="main" sCount=1 dsCount=0 obj=0x418ccea0 self=0x417c7388
| sysTid=13183 nice=-11 sched=0/0 cgrp=apps handle=1074684244
| state=S schedstat=( 0 0 0 ) utm=7 stm=5 core=3
at java.lang.Object.wait(Native Method)
- waiting on <0x42aeb7a8> (a com.myapp.SomeModule)
at java.lang.Object.wait(Object.java:364)
at com.myapp.SomeModule.doSomething(SomeModule.java:45)