Skip to content

Commit

Permalink
[GR-51360] Module jdk.jfr not found, required by org.graalvm.polyglot.
Browse files Browse the repository at this point in the history
PullRequest: graal/16667
  • Loading branch information
tzezula committed Jan 23, 2024
2 parents bb2f3b5 + 7a3c035 commit cb0f826
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 0 additions & 6 deletions sdk/mx.sdk/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,12 +739,6 @@ class UniversalDetector {
"org.graalvm.word",
"org.graalvm.nativeimage",
"org.graalvm.collections",
# needed for dynamically loading Truffle
"java.sql",
"java.management",
"jdk.unsupported",
"jdk.management",
"jdk.jfr",
],
"exports" : [
"org.graalvm.home",
Expand Down
1 change: 1 addition & 0 deletions truffle/mx.truffle/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,7 @@
"java.logging",
"java.management",
"static jdk.internal.vm.ci", # JVMCI module is not on the boot layer if not enabled
"static jdk.jfr", # JFR is not included in the J9 JVM
],
"exports" : [
# Qualified exports
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@
public final class ProviderImpl implements EventFactory.Provider {
@Override
public EventFactory getEventFactory() {
return FlightRecorder.isAvailable() ? new EventFactoryImpl() : null;
return hasJFRModule() && supportsJFR() ? new EventFactoryImpl() : null;
}

private static boolean hasJFRModule() {
return ModuleLayer.boot().findModule("jdk.jfr").isPresent();
}

private static boolean supportsJFR() {
return FlightRecorder.isAvailable();
}
}

0 comments on commit cb0f826

Please sign in to comment.