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

Thomas Stuefe stuefe at openjdk.org
Tue Jun 4 09:03:18 UTC 2024


On Tue, 4 Jun 2024 07:25:41 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 two additional commits since the last revision:
> 
>  - Cleanup test
>    
>    - Stop virtualthread
>    - Remove unneeded imports
>    - Remove modules that are not needed
>  - Fix copyright year

src/hotspot/share/runtime/threads.cpp line 1334:

> 1332:         if (thread_oop != nullptr) {
> 1333:           if (p->is_vthread_mounted()) {
> 1334:             oop vt = p->vthread();

const

src/hotspot/share/runtime/threads.cpp line 1335:

> 1333:           if (p->is_vthread_mounted()) {
> 1334:             oop vt = p->vthread();
> 1335:             assert(vt != nullptr, "");

Please provide a valid assert string.

src/hotspot/share/runtime/threads.cpp line 1336:

> 1334:             oop vt = p->vthread();
> 1335:             assert(vt != nullptr, "");
> 1336:             st->print_cr("   \tMounted virtual thread #" INT64_FORMAT, (int64_t)java_lang_Thread::thread_id(vt));

Please no manual indentation, see remarks above.

src/hotspot/share/runtime/threads.cpp line 1337:

> 1335:             assert(vt != nullptr, "");
> 1336:             st->print_cr("   \tMounted virtual thread #" INT64_FORMAT, (int64_t)java_lang_Thread::thread_id(vt));
> 1337:             st->inc();

Use streamIndentor, please

test/hotspot/jtreg/serviceability/dcmd/thread/PrintVirtualThreadTest.java line 52:

> 50:         output.shouldMatch(".*at " + Pattern.quote(DummyRunnable.class.getName()) + "\\.run.*");
> 51:         output.shouldMatch(".*at " + Pattern.quote(DummyRunnable.class.getName()) + "\\.compute.*");
> 52:         shouldFinish.compareAndSet(false, true);

Why not just set?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19482#discussion_r1625622959
PR Review Comment: https://git.openjdk.org/jdk/pull/19482#discussion_r1625623415
PR Review Comment: https://git.openjdk.org/jdk/pull/19482#discussion_r1625624052
PR Review Comment: https://git.openjdk.org/jdk/pull/19482#discussion_r1625622718
PR Review Comment: https://git.openjdk.org/jdk/pull/19482#discussion_r1625634146


More information about the serviceability-dev mailing list