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
Add JVMTI VirtualThread Mount and Unmount Events #16501
Add JVMTI VirtualThread Mount and Unmount Events #16501
Conversation
@babsingh requesting you to please review it. |
The copyright dates in all files will change to
|
|
From @dipak-bagadiyaAfter executing the test case:
The below error is seen:
Potential fixWe have to modify |
|
e90196f
to
48d7330
Compare
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.
- The title needs to change:
Add JVMTI VirtualThread Mount and Unmount Events
- In the PR, there should only be one commit just with the
Mount
andUnmount
changes. - The second commit is from JVMTI Extension Functions: GetVirtualThread and GetCarrierThread #16518. It should not be part of this PR. Locally, it can be cherry-picked for testing.
- The commit should have a body with more details about the code changes.
- See my local branch: https://github.com/babsingh/openj9/commits/jvmti_extension_funcs_all. The first commit only has the
GetVirtualThread
andGetCarrierThread
changes, and the second commit has the changes for theMount
andUnmount
events. - The new changes should be enabled for JDK19+. See the usage of
#if JAVA_SPEC_VERSION >= 19
in JVMTI Extension Functions: GetVirtualThread and GetCarrierThread #16518. This mostly applies to code. Macros such as#define COM_IBM_GET_VIRTUAL_THREAD ...
do not need to be ifdef'ed; they can stay defined all the time.
Note: This is a first review pass. I will review it again after the current feedback is addressed.
ba822d5
to
94969e6
Compare
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.
Second review pass.
8577f12
to
d3c96a5
Compare
jenkins test sanity zlinux jdk19 |
jenkins compile win jdk8,jdk19 |
This PR LGTM. @gacholio Can you please review this PR for any VM access issues? |
I see no VM access problems (the JVMTI event code is designed to be tolerant of whatever state VM access is in). |
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Updated tests across JDK19+ extension repos to use
For this PR's commit, reverted the numbering for extension events in the top commit of https://github.com/babsingh/openj9/commits/jvmti_extension_funcs. See the changes to runtime/oti/jvmtiInternal.h. @dipak-bagadiya Can you please apply the above runtime/oti/jvmtiInternal.h changes to this PR, and also verify the new test changes? |
f969307
to
4c250a4
Compare
Is Assuming the answer is yes, please document this in the hook declarations. |
@babsingh added the changes of "runtime/oti/jvmtiInternal.h" to this PR and verified the test with the updated test module. |
|
Please do. |
JVMTI VirtualThreadMount and VirtualThreadUnMount events are part of the JVMTI Extension API which is not covered by the JVMTI documentation. The following JVMTI extension events are implemented: -VirtualThreadmount: Trigger/Hook the Virtual thread mount event -VirtualThreadUnmount: Trigger/Hook the Virtual thread unmount event Fixes: eclipse-openj9#16167 Signed-off-by: Dipak Bagadiya dipak.bagadiya@ibm.com
4c250a4
to
326b9e1
Compare
@gacholio added currentThread->threadObject at the point of hook declarations in j9vm.hdf |
jenkins test sanity zlinux jdk19 |
jenkins compile win jdk8 |
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Currently, extension event numbers are hard-coded in the tests. This is invalid since the extension event numbers can vary between implementations. Instead, GetExtensionEvents should be used to derive the extension event numbers. Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16167 Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
The below tests successfully pass with the implementation of VirtualThread[M|Unm]ount and Get[Virtual|Carrier]Thread: - BreakpointInYieldTest.java - NullAsCurrentThreadTest.java - VThreadUnsupportedTest.java - GetStackTraceSuspendedStressTest.java - RawMonitorTest.java Related: eclipse-openj9/openj9#16501 Related: eclipse-openj9/openj9#16518 Signed-off-by: Dipak Bagadiya <dipak.bagadiya@ibm.com>
JVMTI VirtualThreadMount and VirtualThreadUnMount events are part of
the JVMTI Extension API which is not covered by the JVMTI
documentation.
The following JVMTI extension events are implemented:
-VirtualThreadmount: Trigger/Hook the Virtual thread mount event
-VirtualThreadUnmount: Trigger/Hook the Virtual thread unmount event
Related: #16167
Signed-off-by: Dipak Bagadiya dipak.bagadiya@ibm.com