-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8343741: SA jstack --mixed should print information about VM locks #22171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c302f91
fix
lmesnik 93229db
added short sleep into the loop.
lmesnik 0fb641c
make test more robust
lmesnik 55f0682
Update src/hotspot/share/runtime/vmOperations.hpp
lmesnik 2f1e3d7
added printing of native id, renamed variables
lmesnik 056ec87
tests using osthread fixed
lmesnik 0fbafab
fixed spaces
lmesnik b85daff
Updates after Chris feeback
lmesnik 4ed1d57
lock changed and flagless requires removed
lmesnik 015546b
updated time between attempts
lmesnik 39b374f
SA test doesn't work with ZGC
lmesnik cc39753
Update src/hotspot/share/runtime/mutex.cpp
lmesnik dae3d86
Update src/hotspot/share/runtime/mutex.hpp
lmesnik e0290f7
fixed decl
lmesnik 8b2266c
Update src/hotspot/share/runtime/vmStructs.cpp
lmesnik 186beb0
Update src/hotspot/share/runtime/mutex.cpp
lmesnik 45c712b
added \ to the line
lmesnik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Mutex.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| /* | ||
| * Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. | ||
| * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
| * | ||
| * This code is free software; you can redistribute it and/or modify it | ||
| * under the terms of the GNU General Public License version 2 only, as | ||
| * published by the Free Software Foundation. | ||
| * | ||
| * This code is distributed in the hope that it will be useful, but WITHOUT | ||
| * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
| * version 2 for more details (a copy is included in the LICENSE file that | ||
| * accompanied this code). | ||
| * | ||
| * You should have received a copy of the GNU General Public License version | ||
| * 2 along with this work; if not, write to the Free Software Foundation, | ||
| * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
| * | ||
| * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
| * or visit www.oracle.com if you need additional information or have any | ||
| * questions. | ||
| * | ||
| */ | ||
|
|
||
| package sun.jvm.hotspot.runtime; | ||
|
|
||
| import sun.jvm.hotspot.debugger.Address; | ||
| import sun.jvm.hotspot.types.AddressField; | ||
| import sun.jvm.hotspot.types.Type; | ||
| import sun.jvm.hotspot.types.TypeDataBase; | ||
| import sun.jvm.hotspot.types.WrongTypeException; | ||
| import sun.jvm.hotspot.utilities.*; | ||
|
|
||
| public class Mutex extends VMObject { | ||
| private static long nameFieldOffset; | ||
| private static long ownerFieldOffset; | ||
|
|
||
| private static AddressField mutex_array; | ||
| private static int maxNum; | ||
lmesnik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| private static final long addrSize = VM.getVM().getAddressSize(); | ||
|
|
||
| static { | ||
| VM.registerVMInitializedObserver(new Observer() { | ||
| public void update(Observable o, Object data) { | ||
| initialize(VM.getVM().getTypeDataBase()); | ||
| } | ||
| }); | ||
| } | ||
|
|
||
| private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { | ||
| Type type = db.lookupType("Mutex"); | ||
|
|
||
| sun.jvm.hotspot.types.Field nameField = type.getField("_name"); | ||
| nameFieldOffset = nameField.getOffset(); | ||
| sun.jvm.hotspot.types.Field ownerField = type.getField("_owner"); | ||
| ownerFieldOffset = ownerField.getOffset(); | ||
|
|
||
| mutex_array = type.getAddressField("_mutex_array"); | ||
| maxNum = type.getCIntegerField("_num_mutex").getJInt(); | ||
| } | ||
|
|
||
| public Mutex(Address addr) { | ||
| super(addr); | ||
| } | ||
|
|
||
| public String name() { return CStringUtilities.getString(addr.getAddressAt(nameFieldOffset)); } | ||
|
|
||
| public Address owner() { return addr.getAddressAt(ownerFieldOffset); } | ||
lmesnik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public static Address at(int i) { return mutex_array.getValue().getAddressAt(i * addrSize); } | ||
|
|
||
| public static int maxNum() { return maxNum; } | ||
|
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.