RFR: 8316735: Print LockStack in hs_err files
Martin Doerr
mdoerr at openjdk.org
Mon Sep 25 10:54:25 UTC 2023
On Mon, 25 Sep 2023 01:15:07 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Example output:
>>
>> Lock stack of current Java thread (top to bottom):
>> LockStack[1]: nsk.share.jdi.EventHandler
>> {0x00000000bcc28198} - klass: 'nsk/share/jdi/EventHandler'
>> - ---- fields (total size 5 words):
>> - private volatile 'wasInterrupted' 'Z' @12 false (0x00)
>> - private 'debuggee' 'Lnsk/share/jdi/Debugee;' @16 a 'nsk/share/jdi/LocalLaunchedDebugee'{0x00000000bcc08c18} (0xbcc08c18)
>> - private 'log' 'Lnsk/share/Log;' @20 a 'nsk/share/Log'{0x00000000bcc08cb0} (0xbcc08cb0)
>> - private 'vm' 'Lcom/sun/jdi/VirtualMachine;' @24 a 'com/sun/tools/jdi/VirtualMachineImpl'{0x00000000bccb3d60} (0xbccb3d60)
>> - private 'requestManager' 'Lcom/sun/jdi/request/EventRequestManager;' @28 a 'com/sun/tools/jdi/EventRequestManagerImpl'{0x00000000bccb56f8} (0xbccb56f8)
>> - private 'listenThread' 'Ljava/lang/Thread;' @32 a 'java/lang/Thread'{0x00000000bcc280e8} (0xbcc280e8)
>> LockStack[0]: java.util.Collections$SynchronizedRandomAccessList
>> {0x00000000bcb163e8} - klass: 'java/util/Collections$SynchronizedRandomAccessList'
>> - ---- fields (total size 3 words):
>> - final 'c' 'Ljava/util/Collection;' @12 a 'java/util/Vector'{0x00000000bcb16400} (0xbcb16400)
>> - final 'mutex' 'Ljava/lang/Object;' @16 a 'java/util/Collections$SynchronizedRandomAccessList'{0x00000000bcb163e8} (0xbcb163e8)
>> - final 'list' 'Ljava/util/List;' @20 a 'java/util/Vector'{0x00000000bcb16400} (0xbcb16400)
>
> src/hotspot/share/runtime/lockStack.hpp line 33:
>
>> 31: #include "utilities/sizes.hpp"
>> 32:
>> 33: class JavaThread;
>
> Seems an unrelated change.
This is a minor cleanup of the prototypes. lockStack.hpp uses `JavaThread*`, not `Thread*`. Do you prefer not to touch it in this PR?
> src/hotspot/share/utilities/vmError.cpp line 1173:
>
>> 1171: st->print_cr("Objects fast locked by this thread (top to bottom):");
>> 1172: JavaThread::cast(_thread)->lock_stack().print_on(st);
>> 1173:
>
> I would have expected this to be printed along with the other current thread info.
>
> "fast locked" is not terminology we are using for this any more IIUC. I would suggest just saying this is the lock stack for the thread.
I had put it at the end of the "T H R E A D" section. It's moved a bit up, now. Changed wording and added newline.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15884#discussion_r1335719014
PR Review Comment: https://git.openjdk.org/jdk/pull/15884#discussion_r1335719826
More information about the hotspot-dev
mailing list