Visiualvm won’t help you here.
For local development we have a prototype of async stracktraces + jstack —
https://github.com/Kotlin/kotlinx.coroutines/pull/572
But you have not so many options when you are
already deadlocked. Akka, erlang and other reactive systems have similar problem: you can instrument everything to properly trace dependencies, but you cannot do it when problem already happened.
I used to play with JVM serviceability API (openjdk only), but it’s far from complete:
https://github.com/qwwdfsad/coroutines-dump-agent
Maybe (I’m not yet sure) this agent can be a dynamic jstack analogue for coroutines