-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Draft: Test/shen oc #26376
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
base: master
Are you sure you want to change the base?
Draft: Test/shen oc #26376
Conversation
👋 Welcome back ysr! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
|
@ysramakrishna The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
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.
Looks mostly good.
- Left some comments about whitespace etc.
- Other than that, please track down and fix the issue with the incorrect assert definition being caught in the macos and windows builds. This typically happens because the old code did not have an explicit #include. The simplest way to avoid this is to explicitly include the
.hpp
in whichassert()
is defined into the file where you are capturing the wrongassert
macro definition. Contact me tomorrow if you find yourself unable to track this down and correct it as suggested.
Once the builds are clean, I'd go over to doing the semi-efficient implementation of the event gathering for Shenandoah as discussed -- by merging the gathering of the class histogram information with the marking. (Note that this will complete the work for the ObjectCountAfterGC implementation.) Let's get that done first, and reviewed by me in the same way, via a draft PR. Thanks!
} | ||
} | ||
|
||
void GCTracer::report_object_count_after_gc(BoolObjectClosure* is_alive_cl, WorkerThreads* workers) { |
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.
It seems like the only difference between these two methods is the event-sender type passed in the closure. You could make this a template method and pass the event-sender type as a parameter to the template method.
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.
In this case, you want to not do the class info table gathering here all at one point, but as you mark objects. Then once the marking is completed, you would send the events by iterating over the table after marking is completed, but you want to do that outside of a safepoint (after the remark, for the case of Shenandoah).
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.
I'll remove the other report_object_count
method. I just kept it there for right now just to test the functionality of ObjectCount in Shenandoah. I'll change the report_object_count_after_gc
method (might rename it, since it sounds misleading when the ObjectCount event calls this method) to be a template method.
you want to not do the class info table gathering here all at one point, but as you mark objects
I'll create a closure that does the class info table as I mark objects like discussed in yesterday's meeting.
you want to do that outside of a safepoint
I'll make sure to send events concurrently with the application.
|
||
send_event_if_enabled<Event>(klass, count, total_size, timestamp); | ||
// If sending ObjectCountAfterGCEvent, check if ObjectCount is enabled and send event data to ObjectCount | ||
if (std::is_same<Event, EventObjectCountAfterGC>::value && ObjectCountEventSender::should_send_event()) { |
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.
This is kind of clever. Also state that if this method is called specifically for ObjectCount then this avoids sending two events for each class entry.
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.
Also state that if this method is called specifically for ObjectCount then this avoids sending two events for each class entry
So I should just add an extra comment for this?
send_event_if_enabled<Event>(klass, count, total_size, timestamp);
// If sending ObjectCountAfterGCEvent, check if ObjectCount is enabled and send event data to ObjectCount
// If sending ObjectCountEvent, do not send send ObjectCountAfterGCEvent
if (std::is_same<Event, EventObjectCountAfterGC>::value && ObjectCountEventSender::should_send_event()) {
@@ -197,7 +197,7 @@ public class EventNames { | |||
public static final String ResidentSetSize = PREFIX + "ResidentSetSize"; | |||
|
|||
// JDK | |||
public static final String FileForce = PREFIX + "FileForce"; |
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.
Looks like just a whitespace change. The change is correct, but we avoid making whitespace only changes to files that don't otherwise have any other changes. I'd back this out.
// public static String getEventDesc(RecordedEvent event) { | ||
// final String path = event.getEventType().getName(); | ||
// if (!isGcEvent(event)) { | ||
// return path; | ||
// } | ||
// if (event_garbage_collection.equals(path)) { | ||
// String name = Events.assertField(event, "name").getValue(); | ||
// String cause = Events.assertField(event, "cause").getValue(); | ||
// return String.format("path=%s, gcId=%d, endTime=%d, name=%s, cause=%s, | ||
// startTime=%d", | ||
// path, getGcId(event), event.getEndTime(), name, cause, event.getStartTime()); | ||
// } else { | ||
// return String.format("path=%s, gcId=%d, endTime=%d", path, getGcId(event), | ||
// event.getEndTime()); | ||
// } | ||
// } |
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.
This looks whitespace only changes that are semantically no-ops. Back this out as it clutters the diffs.
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.
All changes in this file, other than the change at line 77 are whitespace only changes. Please back out all of the other changes. You might have to fix your IDE.
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.
Later on, you should think about how you can do this without duplicating so much code. For now it can be placed on the backburner.
Essentially, you want to check for all collectors that when either ObjectCountAfterGC or ObjectCount are enabled then following a GC, you see both events. This can be done by the existing test checking for the existence of both events.
For the ObjectCount case, we want to check that the event is present periodically, and can be checked by the new tests which do not induce an explicit GC like the existing ObjectCountAfterGC tests do.
For now it's OK to leave this as is.
This is a draft created for the purpose of looking at diffs and providing comments. Please ignore.
Progress
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/26376/head:pull/26376
$ git checkout pull/26376
Update a local copy of the PR:
$ git checkout pull/26376
$ git pull https://git.openjdk.org/jdk.git pull/26376/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 26376
View PR using the GUI difftool:
$ git pr show -t 26376
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/26376.diff