RFR: 8337199: Add jcmd Thread.vthread_scheduler and Thread.vthread_pollers diagnostic commands

Chen Liang liach at openjdk.org
Thu Nov 28 10:25:18 UTC 2024


On Wed, 27 Nov 2024 15:59:17 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> Adds `jcmd <pid> Thread.vthread_scheduler` to print the virtual thread scheduler and `jcmd <pid> Thread.vthread_pollers` to print the I/O pollers that support virtual threads doing blocking network I/O operations.
> 
> This is a subset of the diagnostics that we've had in the loom repo for a long time. @larry-cable proposed a PR recently ([pull/22121](https://github.com/openjdk/jdk/pull/22121)) to bring a version of same into main line but it was based on an older proposal. This new PR supplants that effort.
> 
> The jtreg failure handler is updated to execute Thread.vthread_scheduler, useful capture when a test fails or times out.

test/hotspot/jtreg/serviceability/dcmd/thread/VThreadCommandsTest.java line 2:

> 1: /*
> 2:  * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.

Suggestion:

 * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.

test/hotspot/jtreg/serviceability/dcmd/thread/VThreadCommandsTest.java line 62:

> 60:     @Test
> 61:     void testVThreadScheduler() {
> 62:         // ensure default scheduler are timeout schedulers are initialized

Suggestion:

        // ensure default scheduler and timeout schedulers are initialized

test/hotspot/jtreg/serviceability/dcmd/thread/VThreadCommandsTest.java line 96:

> 94:                 .shouldContain("Read I/O pollers:")
> 95:                 .shouldContain("Write I/O pollers:")
> 96:                 .shouldContain("[0] sun.nio.ch");

Suggestion:

                .shouldContain("[0] sun.nio.ch.");

As unlikely as this is, I recommend always use a trailing separator for package names - there are corner cases like `java.lang.ref` vs `java.lang.reflect`

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22414#discussion_r1861358889
PR Review Comment: https://git.openjdk.org/jdk/pull/22414#discussion_r1861358950
PR Review Comment: https://git.openjdk.org/jdk/pull/22414#discussion_r1861359883


More information about the serviceability-dev mailing list