@@ -1583,7 +1583,6 @@ criuCheckpointJVMImpl(JNIEnv *env,
1583
1583
I_32 syslogBufferSize = 0 ;
1584
1584
UDATA oldVMState = VM_VMHelpers::setVMState (currentThread, J9VMSTATE_CRIU_SUPPORT_CHECKPOINT_PHASE_START);
1585
1585
UDATA notSafeToCheckpoint = 0 ;
1586
- UDATA criuRestorePid = 0 ;
1587
1586
U_32 intGhostFileLimit = 0 ;
1588
1587
IDATA criuDumpReturnCode = 0 ;
1589
1588
bool restoreFailure = false ;
@@ -1885,19 +1884,21 @@ criuCheckpointJVMImpl(JNIEnv *env,
1885
1884
}
1886
1885
1887
1886
if (hasDumpSucceeded) {
1888
- /* Calculate restore time excluding `criu restore ...` for MXBean API. */
1889
- criuRestorePid = j9sysinfo_get_ppid ();
1890
- systemReturnCode = j9sysinfo_get_process_start_time (criuRestorePid, &restoreNanoUTCTime);
1891
- if (0 != systemReturnCode) {
1892
- currentExceptionClass = vm->checkpointState .criuSystemRestoreExceptionClass ;
1893
- nlsMsgFormat = j9nls_lookup_message (
1894
- J9NLS_DO_NOT_PRINT_MESSAGE_TAG | J9NLS_DO_NOT_APPEND_NEWLINE,
1895
- J9NLS_VM_CRIU_J9_GET_PROCESS_START_TIME_FAILURE,
1896
- NULL );
1897
- restoreFailure = true ;
1887
+ /* Calculate restore time for CRaC MXBean API. */
1888
+ if (J9_ARE_ALL_BITS_SET (vm->checkpointState .flags , J9VM_CRAC_IS_CHECKPOINT_ENABLED)) {
1889
+ UDATA cracRestorePid = j9sysinfo_get_ppid ();
1890
+ systemReturnCode = j9sysinfo_get_process_start_time (cracRestorePid, &restoreNanoUTCTime);
1891
+ if (0 != systemReturnCode) {
1892
+ currentExceptionClass = vm->checkpointState .criuSystemRestoreExceptionClass ;
1893
+ nlsMsgFormat = j9nls_lookup_message (
1894
+ J9NLS_DO_NOT_PRINT_MESSAGE_TAG | J9NLS_DO_NOT_APPEND_NEWLINE,
1895
+ J9NLS_VM_CRIU_J9_GET_PROCESS_START_TIME_FAILURE,
1896
+ NULL );
1897
+ restoreFailure = true ;
1898
+ }
1899
+ vm->checkpointState .processRestoreStartTimeInNanoseconds = (I_64)restoreNanoUTCTime;
1900
+ Trc_VM_criu_process_restore_start_after_dump (currentThread, cracRestorePid, vm->checkpointState .processRestoreStartTimeInNanoseconds );
1898
1901
}
1899
- vm->checkpointState .processRestoreStartTimeInNanoseconds = (I_64)restoreNanoUTCTime;
1900
- Trc_VM_criu_process_restore_start_after_dump (currentThread, criuRestorePid, vm->checkpointState .processRestoreStartTimeInNanoseconds );
1901
1902
1902
1903
/* Load restore arguments from restore file or env vars. */
1903
1904
switch (loadRestoreArguments (currentThread, optionsFileChars, envFileChars)) {
0 commit comments