-
Notifications
You must be signed in to change notification settings - Fork 738
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
Add JFR monitor enter event. #21179
base: master
Are you sure you want to change the base?
Add JFR monitor enter event. #21179
Conversation
002ea10
to
b1f496b
Compare
runtime/oti/j9vm.hdf
Outdated
@@ -229,6 +229,10 @@ typedef UDATA (* lookupNativeAddressCallback)(struct J9VMThread *currentThread, | |||
<struct>J9VMMonitorContendedEnteredEvent</struct> | |||
<data type="struct J9VMThread*" name="currentThread" description="current thread" /> | |||
<data type="omrthread_monitor_t" name="monitor" description="the contended monitor" /> | |||
<data type="I_64" name="startTicks" description="current ticks when wait began" /> | |||
<data type="UDATA" name="monitorAddress" description="object monitor address" /> | |||
<data type="struct J9Class*" name="monitorClass" description="monitor class" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description="object monitor class"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
/* write event type */ | ||
_bufferWriter->writeLEB128(MonitorEnterID); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this extra line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
runtime/oti/j9nonbuilder.h
Outdated
UDATA monitorAddress; | ||
} J9JFRMonitorEntered; | ||
|
||
#define J9JFRMONITORENTERED_STACKTRACE(jfrEvent) ((UDATA*)(((J9JFRMonitorEntered*)(jfrEvent)) + 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
J9JFRMONITORENTERED_STACKTRACE -> J9JFRMONITORENTER_STACKTRACE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The existing name (J9JFRMONITORENTERED_STACKTRACE
) is consistent with #21179 (comment).
Please add a space before each *
in pointer types:
#define J9JFRMONITORENTERED_STACKTRACE(jfrEvent) ((UDATA *)(((J9JFRMonitorEntered *)(jfrEvent)) + 1))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added spaces.
e440cc9
to
2ee0035
Compare
Please update the commit message and the description; they should describe what this will do if merged. |
runtime/vm/ObjectMonitor.cpp
Outdated
bool frameBuilt = saveBlockingEnterObject(currentThread); | ||
ALWAYS_TRIGGER_J9HOOK_VM_MONITOR_CONTENDED_ENTERED(vm->hookInterface, currentThread, monitor); | ||
ALWAYS_TRIGGER_J9HOOK_VM_MONITOR_CONTENDED_ENTERED(vm->hookInterface, currentThread, monitor, startTicks, (UDATA) monitor, ramClass, ownerThread); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't repeat monitor
, removing the duplicate field declaration in j9vm.hdf
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed the duplicate
runtime/vm/jfr.cpp
Outdated
@@ -93,6 +93,9 @@ jfrEventSize(J9JFREvent *jfrEvent) | |||
case J9JFR_EVENT_TYPE_OBJECT_WAIT: | |||
size = sizeof(J9JFRMonitorWaited) + (((J9JFRMonitorWaited*)jfrEvent)->stackTraceSize * sizeof(UDATA)); | |||
break; | |||
case J9JFR_EVENT_TYPE_MONITOR_ENTER: | |||
size = sizeof(J9JFRMonitorEntered) + (((J9JFRMonitorEntered*)jfrEvent)->stackTraceSize * sizeof(UDATA)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space before *
, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
runtime/vm/jfr.cpp
Outdated
static void | ||
jfrVMMonitorEntered(J9HookInterface **hook, UDATA eventNum, void *eventData, void *userData) | ||
{ | ||
J9VMMonitorContendedEnteredEvent *event = (J9VMMonitorContendedEnteredEvent *) eventData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be consistent with casts; there's no space after )
in other casts in this function - there shouldn't be one here either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
runtime/vm/jfr.cpp
Outdated
@@ -867,6 +901,7 @@ tearDownJFR(J9JavaVM *vm) | |||
/* Unregister it anyway even it wasn't registered for initializeJFR(vm, TRUE). */ | |||
(*vmHooks)->J9HookUnregister(vmHooks, J9HOOK_VM_INITIALIZED, jfrVMInitialized, NULL); | |||
(*vmHooks)->J9HookUnregister(vmHooks, J9HOOK_VM_MONITOR_WAITED, jfrVMMonitorWaited, NULL); | |||
(*vmHooks)->J9HookUnregister(vmHooks, J9HOOK_VM_MONITOR_CONTENDED_ENTERED, jfrVMMonitorEntered, NULL ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No space before )
, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
2ee0035
to
6d223ea
Compare
This change adds support for the JFR monitor enter event. Signed-off-by: Adrian Popescu <[email protected]>
6d223ea
to
6496380
Compare
Adding monitor blocked/entered event.