-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Update JFR Native Image Support for compatibility with JDK 17 #3726
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
@christianhaeubl Hi Christian! I started this PR with the intent to let the changes be reviewed sooner rather than later. There is still some work to do for closing chunks properly in 17, but otherwise it compiles and runs without error. |
Hello Zhengyu Gu, thanks for contributing a PR to our project! We use the Oracle Contributor Agreement to make the copyright of contributions clear. We don't have a record of you having signed this yet, based on your email address zgu -(at)- redhat -(dot)- com. You can sign it at that link. If you think you've already signed it, please comment below and we'll check. |
Zhengyu Gu has signed the Oracle Contributor Agreement (based on email address zgu -(at)- redhat -(dot)- com) so can contribute to this repository. |
Just noting in a comment here: the current issue is that the jdk.jfr.internal.ShutdownHook to support dumponexit is not running in the image for 17, but is for 11. It's not touched directly by us though, so continuing to investigate. |
Issue described here is resolved now. |
Note this still needs |
substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/HiddenClassSupport.java
Outdated
Show resolved
Hide resolved
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.
Thanks for working on the JFR support for JDK17. I added a few comments, suggestions, and questions.
substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_JVM.java
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/Target_jdk_jfr_internal_JVM.java
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/SubstrateJVM.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/SubstrateJVM.java
Show resolved
Hide resolved
@@ -107,15 +121,175 @@ private static void initRecording() { | |||
Boolean dumpOnExit = parseBoolean(args, JfrStartArgument.DumpOnExit); | |||
Boolean pathToGcRoots = parseBoolean(args, JfrStartArgument.PathToGCRoots); | |||
|
|||
Target_jdk_jfr_internal_dcmd_DCmdStart dcmdStart = new Target_jdk_jfr_internal_dcmd_DCmdStart(); |
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.
What is the reason for copying the DCmdStart
implementation here? Copying code like that typically creates major issues in the long run.
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.
DCmdStart and surrounding functionality was heavily modified in OpenJDK here: openjdk/jdk@f716711#diff-437f27c74f0b6eb69196ae8b8a27d398a188da4809c6c755ec8eae771e3f4b94R64
I don't know how to support both method signatures of DcmdStart.execute
from 11 and 17 so I decided to follow the execution manually instead.
Specifically
public String[] execute(String name, String[] settings, Long delay, Long duration, Boolean disk, String path, Long maxAge, Long maxSize, Long flush, Boolean dumpOnExit, Boolean pathToGcRoots) throws DCmdException {
to
@Override
public void execute(ArgumentParser parser) throws DCmdException {
I can revisit this.
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.
If you see any chance of simplifying that, please open a new PR. This PR was merged to master in the meanwhile.
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.
@christianhaeubl Okay. I will create a new issue specifically for DcmdStart support and look at that. Thanks for reviewing and merging this.
I have an attempt similar to HiddenClassSupport but the changes are quite substantial to support the two quite different APIs :|
substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/logging/JfrLogConfiguration.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/logging/JfrLogConfiguration.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.jfr/src/com/oracle/svm/jfr/JfrTypeRepository.java
Outdated
Show resolved
Hide resolved
.../com.oracle.svm.core.jdk15/src/com/oracle/svm/core/jdk15/HiddenClassSupportJDK15OrLater.java
Outdated
Show resolved
Hide resolved
.../com.oracle.svm.core.jdk15/src/com/oracle/svm/core/jdk15/HiddenClassSupportJDK15OrLater.java
Outdated
Show resolved
Hide resolved
@jiekang: what is the error message that you get without |
|
@jiekan: thanks for the error message, I will try to debug that tomorrow. |
@jiekang: regarding the issue that Let me know if I should push the fix to your branch. |
@christianhaeubl Please feel free to push the fix to this branch. I also do not mind having it merged in a separate PR and I can rebase this one easily enough. Whichever is ideal for you works for me. Thank you for investigating and fixing this. |
@jiekang : I pushed my fix to your branch. |
Closes #3538