-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8357650: ThreadSnapshot to take snapshot of thread for thread dumps #25425
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
Conversation
|
👋 Welcome back amenkov! A progress list of the required criteria for merging this PR into |
|
@alexmenkov This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 27 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@alexmenkov The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
|
/label remove core-libs |
Webrevs
|
|
@alexmenkov |
|
/contributor add alexmenkov |
|
@alexmenkov Syntax:
User names can only be used for users in the census associated with this repository. For other contributors you need to supply the full name and email address. |
|
@alexmenkov |
|
/contributor add @alexmenkov |
|
@alexmenkov |
stefank
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few drive-by questions:
-
Did you consider putting this implementation in another file, say threadServices.hpp or even its own file? I'm asking because javaClasses seems to have become a dumping ground for code that calls from Java code into the JVM. It would be nice if we could put features into files that are named after the feature.
-
Did you consider to put these OopHandle storages in something else than Universe::vm_globals()? We have, for example, ThreadService::_thread_service_storage.
Alex can correct me but I think it started out here because of java_lang_Thread::async_get_stack_trace/GetStackTraceClosure. It has gone through a number of iterations and you are probably right that it would be better off in threadService or its own source file now.
That OopStorage is maintained in threadService.cpp so would be an option if the code moves. |
My concern about threadServices and _thread_service_storage was it's initialized conditionally. But now I see that they are always initialized. I'll try to move the stuff to threadServices.hpp/.cpp |
|
dholmes-ora
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial drive-by comments ...
Co-authored-by: David Holmes <62092539+dholmes-ora@users.noreply.github.com>
|
Alex, thank you for the updates! It is getting better. :) |
sspitsyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alex, thank you for the updates!
Looks good now.
|
Just to be clear, the ifdef JVMTI means Thread.dump_to_file not work in a build configuration using - --enable-jvm-feature-jvmti=no ? |
The dependency on JvmtiVTMSTransitionDisabler is needed for now but maybe in the future this could be separated from JVMTI for other cases where transitions needs to be disabled. Minimal VM disables management and jvmti, and is really only practical if you run jlink to create a run-time image with a small subset of the modules. So no jdk.management and no HotSpotDiagnosticMXBean. It's possible of course that someone configures with +management and -jvmti, in which case the HotSpotDiagnosticMXBean.dumpThreads will throw NPE. It should throw UOE (the method is specified to allow this), which means JVM_CreateThreadSnapshot or ThreadSnapshot.of(Thread) should throw. |
|
Thanks Alan, and thanks Alex! |
|
/integrate |
|
Going to push as commit 406f1bc.
Your commit was automatically rebased without conflicts. |
|
@alexmenkov Pushed as commit 406f1bc. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This is first (hotspot) part of the update for
HotSpotDiagnosticMXBean.dumpThreadsandjcmd Thread.dump_to_fileto include lock information in thread dumps (JDK-8356870).The update has been split into parts to simplify reviewing.
The fix contains an implementation of
jdk.internal.vm.ThreadSnapshotclass to gather required information about a thread.Second (dependent) part includes changes in
HotSpotDiagnosticMXBean.dumpThreads/jcmd Thread.dump_to_file, spec updates and tests for the functionality.Testing: new
HotSpotDiagnosticMXBean.dumpThreads/jcmd Thread.dump_to_filefunctionality was tested in loom repo;sanity tier1 (this fix only)
Progress
Issue
Reviewers
Contributors
<alanb@openjdk.org><amenkov@openjdk.org>Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25425/head:pull/25425$ git checkout pull/25425Update a local copy of the PR:
$ git checkout pull/25425$ git pull https://git.openjdk.org/jdk.git pull/25425/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25425View PR using the GUI difftool:
$ git pr show -t 25425Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25425.diff
Using Webrev
Link to Webrev Comment