-Djdk.tracePinnedThreads
-Djdk.tracePinnedThreads=short
-Djdk.tracePinnedThreads=full
Thread dumps
For now, traditional thread dumps do not include virtual threads. If the thread dump is taken when a virtual thread is mounted then its stack will be shown in the stack trace of its carrier thread.
The current prototype has an alternative thread dump that includes all platform threads plus all virtual threads started Twith a thread Executor (Executors.newVirtualThreadExector or Executors.newThreadExector). The thread dump is generated to a file in JSON format. The thread dump can be generated programmatically with ThreadMXBean or with the jcmd tool
jcmd <pid> Thread.dump_to_json_file <file>