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

Backport of GR-52454: Include signal exit handlers in the image build if JFR #3

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

roberttoyonaga
Copy link
Contributor

I'm backporting this change so that JFR is able to dump recordings by default if apps are stopped with SIGINT. This is important because without it users must manually specify a recording duration to create dump (or wait until the program finishes on its own). Previously --install-exit-handlers had to be specified at build time to get the same behaviour.

This should be a low risk because the change only lessens the strictness of the check whether to install exist signal handlers. This only changes the default behaviour when using JFR.

Tested with mx native-unittest: passed
Also tested manually with:

mx native-image  --enable-monitoring=jfr -m jdk.httpserver
./jdk.httpserver -XX:StartFlightRecording=filename=rec.jfr 
SIGINT
jfr summary  rec.jfr

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 22, 2024
@roberttoyonaga
Copy link
Contributor Author

It seems like truffle issues are causing failures in:

  • GraalVM Gate / /compiler style,fullbuild,test JDK21
  • GraalVM Gate / /truffle JDK21

@zakkak
Copy link
Contributor

zakkak commented Aug 20, 2024

This is a backport of oracle/graal#8498

Copy link
Contributor

@zakkak zakkak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @roberttoyonaga,

Can you please use git cherry-pick -x for the backport and update the PR?

Thank you.

@@ -34,7 +34,7 @@
public class SubstrateExitHandlerFeature implements InternalFeature {
@Override
public void beforeAnalysis(BeforeAnalysisAccess access) {
if (SubstrateOptions.InstallExitHandlers.getValue()) {
if (SubstrateOptions.InstallExitHandlers.getValue() || VMInspectionOptions.hasJfrSupport()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume || VMInspectionOptions.hasNativeMemoryTrackingSupport() is intentionally missing due to not being present in graalvm 23.1 (for JDK 21)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's right, the native memory tracking feature isn't available yet in graalVM for JDK21.

@roberttoyonaga
Copy link
Contributor Author

Thanks for the review @zakkak ! I've redone it using cherry-pick -x

@zakkak
Copy link
Contributor

zakkak commented Aug 20, 2024

Style issues fix in #7

Copy link
Contributor

@zakkak zakkak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @roberttoyonaga!

For future reference please note that it's OK to squash such trivial commits fixing incompatibilities when cherry-picking.

@zakkak zakkak self-assigned this Aug 28, 2024
@zakkak zakkak merged commit e83311b into graalvm:master Aug 28, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants