Skip to content

Commit 410dece

Browse files
authored
Merge pull request #22689 from tajila/jfr2
Defer jfr init after GC structures are initialized
2 parents bac2eb9 + 1615650 commit 410dece

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

runtime/vm/jvminit.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7727,16 +7727,6 @@ protectedInitializeJavaVM(J9PortLibrary* portLibrary, void * userData)
77277727
goto error;
77287728
}
77297729

7730-
#if defined(J9VM_OPT_JFR)
7731-
if (J9_ARE_ANY_BITS_SET(vm->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_JFR_ENABLED)) {
7732-
if (J9_ARE_ANY_BITS_SET(vm->extendedRuntimeFlags3, J9_EXTENDED_RUNTIME3_START_FLIGHT_RECORDING)) {
7733-
if (JNI_OK != initializeJFR(vm, FALSE)) {
7734-
goto error;
7735-
}
7736-
}
7737-
}
7738-
#endif /* defined(J9VM_OPT_JFR) */
7739-
77407730
/* Use this stage to load libraries which need to set up hooks as early as possible */
77417731
if (JNI_OK != runLoadStage(vm, EARLY_LOAD)) {
77427732
goto error;
@@ -7785,6 +7775,16 @@ protectedInitializeJavaVM(J9PortLibrary* portLibrary, void * userData)
77857775
goto error;
77867776
}
77877777

7778+
#if defined(J9VM_OPT_JFR)
7779+
if (J9_ARE_ANY_BITS_SET(vm->extendedRuntimeFlags2, J9_EXTENDED_RUNTIME2_JFR_ENABLED)) {
7780+
if (J9_ARE_ANY_BITS_SET(vm->extendedRuntimeFlags3, J9_EXTENDED_RUNTIME3_START_FLIGHT_RECORDING)) {
7781+
if (JNI_OK != initializeJFR(vm, FALSE)) {
7782+
goto error;
7783+
}
7784+
}
7785+
}
7786+
#endif /* defined(J9VM_OPT_JFR) */
7787+
77887788
if (JNI_OK != (stageRC = runInitializationStage(vm, ALL_VM_ARGS_CONSUMED))) {
77897789
goto error;
77907790
}

0 commit comments

Comments
 (0)