RFR: 8370203 - Add jcmd AOT.end_recording diagnostic command [v7]

Kevin Walls kevinw at openjdk.org
Tue Nov 25 13:16:15 UTC 2025


On Tue, 25 Nov 2025 01:01:19 GMT, Mat Carter <macarte 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:
>> 
>> - AOT.end_recording is unsupported when VM flags -XX:AOTMode=record or -XX:AOTCacheOutput=<file> are missing
>> - Recording has already ended.
>> - Error: Failed to end recording.
>> - Recording ended successfully.
>> 
>> 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.
>> - Recording has already ended.
>> 
>> Passes tier1 on linux (x64) and windows (x64)
>
> Mat Carter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Check exit value in tests

test/hotspot/jtreg/runtime/cds/appcds/aotCache/DiagnosticCommandMBeanTest.java line 152:

> 150:                 System.out.println("Failed to stop recording");
> 151:             }
> 152:         } catch (MBeanException e) {

Can we catch Exception here generally, and print the stacktrace so we can see what happened if there are failures?

Then print the "Exception occurred!" so it's seen by the caller and the test fails.

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

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


More information about the serviceability-dev mailing list