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

JFR: Java Monitor Enter #21014

Open
tajila opened this issue Jan 24, 2025 · 1 comment
Open

JFR: Java Monitor Enter #21014

tajila opened this issue Jan 24, 2025 · 1 comment

Comments

@tajila
Copy link
Contributor

tajila commented Jan 24, 2025

Add support for the JavaMonitor[Wait|Enter] event:

JavaMonitorEnter fields
- startTime
- duration
- eventThread
- stackTrace
- monitorClass
- previousOwner
- address

In objectMonitorEnterBlocking the J9HOOK_VM_MONITOR_CONTENDED_ENTERED will be used to trigger the event. New fields will need to be added to capture the monitorClass, address and previous owner.

MonitorClass - can be determine with J9OBJECT_CLAZZ(object)
Address - addr of object
PreviousOwner - If not inflated, can be determined by reading lwEA and clearing the locking bits (OBJECT_HEADER_LOCK_RESERVED, etc.). If inflated, can be determined by `((J9ThreadMonitor*)monitor)->owner)

@tajila
Copy link
Contributor Author

tajila commented Jan 24, 2025

@adpopescu Please take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant