On Mon, 3 Jun 2024 11:22:12 GMT, Inigo Mediavilla Saiz <d...@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: > > - Update > test/hotspot/jtreg/serviceability/dcmd/thread/PrintVirtualThreadTest.java > > Co-authored-by: Andrey Turbanov <turban...@gmail.com> > - Use JavaThread::print_vthread_stack_on Sorry, I don't know what I did wrong last week, but when I tried to rely on `print_vthread_stack_on` I was getting compilation errors. In any case, it seems to be working now with https://github.com/openjdk/jdk/pull/19482/commits/59b18db4833cc5b7a9c3a79e707efeb13ce84f86. Thanks for insisting, and sorry for the confusion. > > I also find the duplication of the stack printing code unfortunate. It > > would be nice to reuse`JavaThread::print_vthread_stack_on`. I don't > > understand why it cannot be const? > > Just what I was about to query :) I'm not sure what the const issue is. > Printing a stack certainly should not modify anything. ------------- PR Comment: https://git.openjdk.org/jdk/pull/19482#issuecomment-2144945530