[crac] RFR: 8375044: [CRaC] Structured engine options info [v6]
Timofei Pushkin
tpushkin at openjdk.org
Thu Jan 22 07:26:02 UTC 2026
On Tue, 20 Jan 2026 16:24:20 GMT, Radim Vansa <rvansa at openjdk.org> wrote:
>> Currently the engine documents all exposed options through the description extension; this has some downsides:
>>
>> * when the JVM wants to change engine option default, -XX:CRaCEngineOptions=help would print wrong value
>> * options completely controlled by JVM (such as image_location) are reported, too
>> * options documentation format is fully up to the engine (and it would be more complicated to reflow lines in the output)
>>
>> The solution is exposing options info in a more structured manner.
>>
>> As an extra feature we can use -XX:CRaCEngineOptions=help=foo to limit help to only those containing 'foo' in the name.
>
> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix long line
src/hotspot/share/runtime/crac_engine.cpp line 234:
> 232: }
> 233:
> 234: CracEngine::CracEngine(): _options(nullptr) {
Redundant with `_options = nullptr` in the header.
Suggestion:
CracEngine::CracEngine() {
src/hotspot/share/runtime/crac_engine.hpp line 90:
> 88: crlib_image_score_t *_image_score_api = nullptr;
> 89:
> 90: crlib_conf_option_t *_options;
Suggestion:
crlib_conf_option_t *_options = nullptr;
src/java.base/share/native/libcrexec/crexec.cpp line 187:
> 185: OPT(image_location, const char *, nullptr, CRLIB_OPTION_FLAG_CHECKPOINT | CRLIB_OPTION_FLAG_RESTORE, "path", "no default", \
> 186: "path to a directory with checkpoint/restore files.") \
> 187: OPT(exec_location, const char *, nullptr, CRLIB_OPTION_FLAG_CHECKPOINT | CRLIB_OPTION_FLAG_RESTORE, "path", "no default", \
Nitpick: by using `"no default"` we don't follow our own recommendation from the API to "use empty string" when there's no default. I'm not sure which version is better.
I suggested making this nullable to have uniformity across engines (it would be up to the JVM to choose how to present this), but maybe it's indeed better to leave this up to engine devs.
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/286#discussion_r2715634408
PR Review Comment: https://git.openjdk.org/crac/pull/286#discussion_r2715632314
PR Review Comment: https://git.openjdk.org/crac/pull/286#discussion_r2715607405
More information about the crac-dev
mailing list