Skip to content
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

[JDK21] Support JvmtiMountTransition Annotation #17520

Closed
babsingh opened this issue Jun 3, 2023 · 3 comments · Fixed by #18016
Closed

[JDK21] Support JvmtiMountTransition Annotation #17520

babsingh opened this issue Jun 3, 2023 · 3 comments · Fixed by #18016

Comments

@babsingh
Copy link
Contributor

babsingh commented Jun 3, 2023

JvmtiMountTransition annotation's description:

  • A method is annotated as "jvmti mount transition" if it starts or ends virtual thread mount state transition (VTMS transition).
  • This annotation is only used for VirtualThread methods, which are skipped during JVMTI inspection.
@babsingh babsingh added this to the Java 21 milestone Jun 3, 2023
@babsingh babsingh changed the title [JDK21] Support JvmtiMountTransition Annotation #17519 [JDK21] Support JvmtiMountTransition Annotation Jun 3, 2023
@thallium
Copy link
Contributor

thallium commented Jun 8, 2023

#16654 implements check for method entry and method exit events. Not sure if that suffices.

@babsingh
Copy link
Contributor Author

babsingh commented Jun 8, 2023

#16654 implements check for method entry and method exit events. Not sure if that suffices.

No, #16654 only disables certain JVMTI events; it does not hide/skip method frames with the JvmtiMountTransition annotation. At some places, the RI skips the method frames with the JvmtiMountTransition annotation while stackwalking in the JVMTI. MethodExitTest, which is currently disabled, utilizes the hide frame feature. Related: #17490.

@babsingh
Copy link
Contributor Author

Work done to support the JvmtiMountTransition annotation:

Pending task from #17855 (comment):

There are stack trace APIs in JVMTI - the depth of frames will now not match (i.e. get a stack trace, find a method at depth 3, then try to use one of the APIs modified here, and fail because the deoth is off due to an annotated method).

Yes. We will need to apply this change to all places where walkStackFrames is used in JVMTI functions. Will address this in a follow up PR.

babsingh added a commit to babsingh/openj9 that referenced this issue Aug 25, 2023
Java methods tagged with the JvmtiMountTransition annotation are
involved in transitioning between carrier to virtual threads, and
vice-versa.

These methods are not part of the thread's scope. So, they should be
skipped during introspection by all the relevant JVMTI functions.

This commit covers the remaining JVMTI functions which need to skip
methods tagged with the JvmtiMountTransition annotation.

Fixes: eclipse-openj9#17520

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants