RFR: 8330846: Add stacks of mounted virtual threads to the HotSpot thread dump [v10]
Inigo Mediavilla Saiz
duke at openjdk.org
Tue Jun 4 16:11:38 UTC 2024
On Tue, 4 Jun 2024 13:31:50 GMT, Inigo Mediavilla Saiz <duke at openjdk.org> wrote:
>> Print the stack traces of mounted virtual threads when calling `jcmd <pid> Thread.print`.
>
> Inigo Mediavilla Saiz has updated the pull request incrementally with one additional commit since the last revision:
>
> Incorporate @tstuefe's remarks
Current status:
I'm leaving the PR without additional indentation for the Vthread stack on purpose because I plan to add a new PR to include @tstuefe's changes (unless those changes get merged very quickly)
@AlanBateman I've included the vthread's name in the output as per your suggestion.
This what the output looks like at the moment:
"ForkJoinPool-1-worker-1" #21 [28163] daemon prio=5 os_prio=31 cpu=7320.43ms elapsed=7.39s tid=0x000000012d02f210 [0x0000000171b31000]
Carrying virtual thread #20
Thread: 0x000000012d02f210 [0x6e03] State: _at_safepoint _at_poll_safepoint 1
JavaThread state: _thread_blocked
at jdk.internal.vm.Continuation.run(java.base at 23-internal/Continuation.java:248)
at java.lang.VirtualThread.runContinuation(java.base at 23-internal/VirtualThread.java:245)
at java.lang.VirtualThread$$Lambda/0x000003c001046740.run(java.base at 23-internal/Unknown Source)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(java.base at 23-internal/ForkJoinTask.java:1726)
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(java.base at 23-internal/ForkJoinTask.java:1717)
at java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(java.base at 23-internal/ForkJoinTask.java:1641)
at java.util.concurrent.ForkJoinTask.doExec(java.base at 23-internal/ForkJoinTask.java:507)
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(java.base at 23-internal/ForkJoinPool.java:1489)
at java.util.concurrent.ForkJoinPool.scan(java.base at 23-internal/ForkJoinPool.java:2071)
at java.util.concurrent.ForkJoinPool.runWorker(java.base at 23-internal/ForkJoinPool.java:2033)
at java.util.concurrent.ForkJoinWorkerThread.run(java.base at 23-internal/ForkJoinWorkerThread.java:189)
Mounted virtual thread "Dummy Vthread" #20
at Main$FunkyLambda.compute(Main.java:38)
at Main$FunkyLambda.computeFunkyName(Main.java:31)
at Main$$Lambda/0x000003c001000c50.run(Unknown Source)
at java.lang.Thread.runWith(java.base at 23-internal/Thread.java:1588)
at java.lang.VirtualThread.run(java.base at 23-internal/VirtualThread.java:329)
at java.lang.VirtualThread$VThreadContinuation$1.run(java.base at 23-internal/VirtualThread.java:209)
at jdk.internal.vm.Continuation.enter0(java.base at 23-internal/Continuation.java:320)
at jdk.internal.vm.Continuation.enter(java.base at 23-internal/Continuation.java:312)
-------------
PR Comment: https://git.openjdk.org/jdk/pull/19482#issuecomment-2147589255
More information about the serviceability-dev
mailing list