Premain options for triggering end of training

Mat Carter Matthew.Carter at microsoft.com
Tue Nov 26 19:47:35 UTC 2024


The following three options have been integrated into premain to assist with the recording of
training data.  What parts make it to tip (and in what format) will be based on feedback from
 training workflows as developers explore Leyden.

Command line option: -XX:AOTEndTrainingOnMethodEntry=[methods][,count]
- methods: comma separated list of methods specified in a similar manner to -XX:CompileOnly
- count: trigger end of training after ‘count’ tracked methods invoked (total, not per method)

JCmd option:  jcmd AOT.end_training
- ends training

API option (don’t panic: System was simply the easiest point to integrate support for
experimentation):

void System.AOTEndTraining()
bool System.AOTIsTraining()
- returns true if a training run and the recording of training data has not yet stopped

Ending training does not terminate the application; it simply stops recording and dumps
out the data for creating the AOT cache.

If none of the methods are used (or the ‘count’ was not met) then the application will stop
recording data when the application terminates.

This work is based on the enhancement request in JBS [1]; the PR is [2] and commit is [3]

Cheers
Mat

[1] https://bugs.openjdk.org/browse/JDK-8335358
[2] https://github.com/openjdk/leyden/pull/21#issuecomment-2495140178
[3] https://github.com/openjdk/leyden/commit/6e6030b917f1dfcd4ea7c6207ce0626bf5452c3f
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <https://mail.openjdk.org/pipermail/leyden-dev/attachments/20241126/9647b5c5/signature.asc>


More information about the leyden-dev mailing list