-
Notifications
You must be signed in to change notification settings - Fork 720
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
Disallow thread enable/disable JVMTI_EVENT_SAMPLED_OBJECT_ALLOC #6042
Conversation
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.
More formatting than content, which I strongly dislike.
Should we update the new JVMTI test to test this case instead of relying on jtreg? |
Modified the test to check the thread enable case, also relax @gacholio please have another look. |
...tional/cmdLineTests/jvmtitests/src/com/ibm/jvmti/tests/samplingObjectAllocation/soae001.java
Outdated
Show resolved
Hide resolved
jenkins test sanity plinux jdk11 |
Test fails:
|
@gacholio the test should be good now, please launch another PR build to verify. |
jenkins test sanity zlinux jdk11 |
Failed again, looking at it. |
JVMTI_EVENT_SAMPLED_OBJECT_ALLOC is enabled or disabled globally to match RI behavior; Throws JVMTI_ERROR_ILLEGAL_ARGUMENT if there is an attempt to thread enable/disable; Modified the test to check the thread enable case; Minor code format refactoring. Signed-off-by: Jason Feng <fengj@ca.ibm.com>
The test failed even though the harness printed
This is due to the
Changed @gacholio please launch another PR build, thanks. |
Disallow thread enable/disable JVMTI_EVENT_SAMPLED_OBJECT_ALLOC
JVMTI_EVENT_SAMPLED_OBJECT_ALLOC
is enabled or disabled globally to match RI behaviour.Throws
JVMTI_ERROR_ILLEGAL_ARGUMENT
if there is an attempt to thread enable/disable.Note: this is to address a
JTReg Test Failure - serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorEventsForTwoThreadsTest.java
:With this PR, the test has following output:
which is same as
RI
.Additional note: this test (and the name HeapMonitorEventsForTwoThreadsTest.java) is misleading, the failure messages are identical for first and second thread [1]. It might give an impression that the
SetEventNotificationMode()
failed at second thread but indeed failed at first thread and the second thread serves no purpose from my perspective.RI
only allowsJVMTI_EVENT_SAMPLED_OBJECT_ALLOC
to be enabled or disabled globally thoughJVMTI
specification doesn't includeSampled Object Allocation
in the list of events that cannot be controlled at the thread level.OpenJ9
matchesRI
behaviours.[1] https://github.com/ibmruntimes/openj9-openjdk-jdk11/blob/2a60f1f273a2c29b411ec9c4d9263d8ff5434529/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c#L762-L773
[2] https://docs.oracle.com/en/java/javase/12/docs/specs/jvmti.html#SetEventNotificationMode
Reviewer: @DanHeidinga
FYI: @gacholio
Signed-off-by: Jason Feng fengj@ca.ibm.com