RFR: 8348347: Cleanup JavaThread subclass support in SA [v2]

Serguei Spitsyn sspitsyn at openjdk.org
Tue Feb 11 23:53:12 UTC 2025


On Tue, 11 Feb 2025 23:16:04 GMT, Chris Plummer <cjplummer at openjdk.org> wrote:

>> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/JavaThread.java line 54:
>> 
>>> 52:   private static long oopPtrSize;
>>> 53: 
>>> 54:   // For accessing platform dependent functionality
>> 
>> Nit: It is better to have dot at the end of comment.
>
> It's consistent with other comments in the file.

Okay.

>> src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/ThreadStackTrace.java line 51:
>> 
>>> 49:         if (!thread.isJavaThread()) {
>>> 50:             return;
>>> 51:         }
>> 
>> Q: I wonder why is `!thread.isHiddenFromExternalView()` not used here. Have we always dumped the hidden from external view threads?
>
> It's only used by the code below, which has already done the check:
> 
>            if (threadObj != null && !thread.isExiting() && !thread.isHiddenFromExternalView()) {
> 
>                 // dump thread stack trace
>                 ThreadStackTrace st = new ThreadStackTrace(thread);
>                 st.dumpStack(-1);
>                 numThreads++;

I see it now. Thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23456#discussion_r1951750825
PR Review Comment: https://git.openjdk.org/jdk/pull/23456#discussion_r1951764063


More information about the serviceability-dev mailing list