RFR: 8330846: Add stacks of mounted virtual threads to the HotSpot thread dump [v6]

Inigo Mediavilla Saiz duke at openjdk.org
Mon Jun 3 13:31:16 UTC 2024


On Mon, 3 Jun 2024 13:13:55 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Inigo Mediavilla Saiz has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add indentation for virtual thread stack
>
> I don't think showing the frames of the mounted virtual thread before the carrier thread frames is the best way to show this. For one thing, it appears immediately after the carrier's thread name/details and state. So I think Ron's suggestion to clearly label it as the mounted virtual thread after the carrier stack trace would be good to try.

Thanks @AlanBateman and @pron ! Based on your comments I've added https://github.com/openjdk/jdk/pull/19482/commits/9acbf29da37c4f6c143a150635a09c711300a4c7. 

That provides the following output:


"ForkJoinPool-1-worker-1" #21 [27907] daemon prio=5 os_prio=31 cpu=29561.73ms elapsed=29.71s tid=0x0000000147089c10  [0x000000017178d000]
   Carrying virtual thread #20
Thread: 0x0000000147089c10  [0x6d03] 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/0x0000300001046740.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 #20
		at Main$FunkyLambda.compute(Main.java:38)
		at Main$FunkyLambda.computeFunkyName(Main.java:31)
		at Main$$Lambda/0x0000300001000c50.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-2145205780


More information about the serviceability-dev mailing list