RFR: 8280131: jcmd reports "Module jdk.jfr not found." when "jdk.management.jfr" is missing
Alan Bateman
alanb at openjdk.org
Wed Oct 19 13:21:58 UTC 2022
On Mon, 17 Oct 2022 09:25:57 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
> Could I have a review of a PR that ensures JFR can be used when only the jdk.jfr module is present in an image.
>
> The behavior is similar to how -javaagent adds the java.instrument module and "jcmd PID ManagementAgent.status" loads the jdk.management.agent module.
>
> TestJfrJavaBase.java is replaced with TestModularImage.java. The former test could not be used since the jdk.jfr module is now added to the module graph when -XX:StartFlightRecording is specified.
>
> Testing: tier1-3 + test/jdk/jdk/jfr
>
> Thanks
> Erik
src/hotspot/share/jfr/dcmd/jfrDcmds.cpp line 69:
> 67: }
> 68:
> 69: static bool invalid_state(outputStream* out, TRAPS) {
The changes look okay to me except that "invalid_state" isn't a clear name for function that tries to ensure that the jdk.jfr module is loaded. Up to you, but I think it would be clear if it were renamed load_jfr that returns disabled when disabled or the jdk.jfr module cannot be loaded.
-------------
PR: https://git.openjdk.org/jdk/pull/10723
More information about the hotspot-dev
mailing list