RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command

Mat Carter macarte at openjdk.org
Tue Oct 28 17:02:27 UTC 2025


On Tue, 28 Oct 2025 09:45:29 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Add jcmd AOT.end_recording diagnostic command.  When this command is issued, a targeted JVM that is currently recording AOT information will stop recording.  Existing functionality is preserved: when stopped the JVM will create the required artifacts based on the execution mode.  Conveniently as the application running on the JVM has not stopped (as was previously the only way to stop recording), the application will resume execution after the artifacts have been generated.
>> 
>> The command will report back to the user one of the following messages depending on the state of the JVM:
>> 
>> - Error! Not a recording run
>> - Error! Not recording
>> - Recording ended successfully
>> - Error! Failed to end recording
>> 
>> It follows that issues the command to a JVM that is recording, twice in succession, should (baring internal errors) would produce the following two responses:
>> 
>> - Recording ended successfully
>> - Error! Not recording
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> src/hotspot/share/services/diagnosticCommand.cpp line 1009:
> 
>> 1007:   }
>> 1008: 
>> 1009:   output()->print_cr("Error! Failed to end recording");
> 
> Is there an error recorded or anything further that could be included for the error case?

There is not, currently, the aotMetaspace method throws an exception if something goes wrong.  I added this line in case the flow in aotMetaspace changes.  The logic here is that if we asked the recording to stop, but it's still recording then we report to the user that 'we failed to stop the recording'

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/27965#discussion_r2470350546


More information about the hotspot-runtime-dev mailing list