Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(0.49) Recent JFR fixes #20649

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions jcl/src/java.base/share/classes/java/lang/System.java
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,10 @@ private static void ensureProperties(boolean isInitialization) {
/*[ENDIF] CRIU_SUPPORT */

/*[IF JFR_SUPPORT]*/
/* Enables openj9 JFR tests. */
initializedProperties.put("org.eclipse.openj9.jfr.isJFREnabled", "true"); //$NON-NLS-1$ //$NON-NLS-2$
/* TODO disable JFR JCL APIs until JFR natives are implemented. */
initializedProperties.put("jfr.unsupported.vm", "true"); //$NON-NLS-1$ //$NON-NLS-2$
/*[ENDIF] JFR_SUPPORT */

String[] list = getPropertyList();
Expand Down
9 changes: 9 additions & 0 deletions runtime/vm/JFRConstantPoolTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,15 @@ VM_JFRConstantPoolTypes::addThreadGroupEntry(j9object_t threadGroup)
entry->parentIndex = addThreadGroupEntry(J9VMJAVALANGTHREADGROUP_PARENT(_currentThread, threadGroup));
if (isResultNotOKay()) goto done;

/* Check again to see if the Threadgroup was added recursively. */
entry = (ThreadGroupEntry *) hashTableFind(_threadGroupTable, entry);
if (NULL != entry) {
index = entry->index;
goto done;
} else {
entry = &entryBuffer;
}

entry->name = copyStringToJ9UTF8WithMemAlloc(_currentThread, J9VMJAVALANGTHREADGROUP_NAME(_currentThread, threadGroup), J9_STR_NONE, "", 0, NULL, 0);

entry->index = _threadGroupCount;
Expand Down
2 changes: 2 additions & 0 deletions runtime/vm/jfr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -979,9 +979,11 @@ jfrSamplingThreadProc(void *entryArg)
while (J9JFR_SAMPLER_STATE_STOP != vm->jfrSamplerState) {
J9SignalAsyncEvent(vm, NULL, vm->jfrAsyncKey);
if (0 == (count % 100)) { // 1 second
omrthread_monitor_exit(vm->jfrSamplerMutex);
internalAcquireVMAccess(currentThread);
jfrCPULoad(currentThread);
internalReleaseVMAccess(currentThread);
omrthread_monitor_enter(vm->jfrSamplerMutex);
if (0 == (count % 1000)) { // 10 seconds
J9SignalAsyncEvent(vm, NULL, vm->jfrThreadCPULoadAsyncKey);
}
Expand Down