RFR: 8280131: jcmd reports "Module jdk.jfr not found." when "jdk.management.jfr" is missing
Erik Gahlin
egahlin at openjdk.org
Wed Oct 19 14:26:07 UTC 2022
On Wed, 19 Oct 2022 13:18:21 GMT, Alan Bateman <alanb 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.
I agree. I have a large refactoring of jfrDcmd.cpp coming up. I will clean up names and logic in that PR.
-------------
PR: https://git.openjdk.org/jdk/pull/10723
More information about the hotspot-dev
mailing list