-
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
Closed
Closed
Draft: Test/shen oc #26376
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
3da9f89
Testing ObjectCount event with Shenandoah collector
pf0n ec5ad1a
Created ObjectCount event tests for G1Full and ParallelOld
pf0n 354deee
Initiated GC for ObjectCount testing
pf0n 359caff
Removed unnecessary duplicate calls to ObjectCountEventVerifier in Ob…
pf0n adea2fc
ObjectCount event test with g1 full
pf0n c535645
Separated ObjectCount and ObjectCountAfterGC
pf0n a135b2d
Minimize code duplication by adding templates to ObjectCountEvent sender
pf0n 4826229
ObjectCount data will be emitted if ObjectCountAfterGC is sending data
pf0n 00b15d6
Delete src/hotspot/share/gc/shared/objectCountAfterGCEventSender.cpp
pf0n 461b71c
Delete src/hotspot/share/gc/shared/objectCountAfterGCEventSender.hpp
pf0n 33aa1da
Delete src/hotspot/share/gc/shared/objectCountEventSender.cpp
pf0n cb368f6
Delete src/hotspot/share/gc/shared/objectCountEventSender.hpp
pf0n 3d05ece
Added object counting to Shenandoah
pf0n 523ec03
Merge branch 'test/shen-oc' of https://github.com/pf0n/jdk into test/…
pf0n 82bb883
Templates for ObjectCountEventSenderClosure
pf0n 405e0d9
Updated file for objectCountEventSenderTemplate.hpp
pf0n d1a1e6b
Updated header gaurds for objectCountEventSenderTemplate.hpp
pf0n a868e9b
Removed whitespace changes
pf0n 16eee14
Attempt to fix assert error
pf0n e4747f2
Removed iostream in objectCountEventSenderTemplate
pf0n 0a9c094
Add template for the method that reports object count and updated res…
pf0n b88dce2
Reverting back to old commit
pf0n 5f912be
Uncommented report_object_count_after_gc
pf0n 08fc38c
Added KlassInfoTable to ObjectCount class
pf0n 4c02ed1
Restored objectCountEventSender
pf0n 520f534
Efficient implementation of ObjectCountAfterGC
pf0n b3b5706
New closure for object counting
pf0n File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "gc/shared/gcId.hpp" | ||
#include "gc/shared/objectCountClosure.hpp" | ||
#include "jfr/jfrEvents.hpp" | ||
#include "memory/heapInspection.hpp" | ||
#include "utilities/macros.hpp" | ||
#include "utilities/ticks.hpp" | ||
|
||
class KlassInfoEntry; | ||
class Klass; | ||
|
||
KlassInfoTable ObjectCountClosure::cit(false); | ||
|
||
void ObjectCountClosure::reset_table() { | ||
if (!check_table_exists()) { | ||
return; | ||
} | ||
cit.~KlassInfoTable(); | ||
::new((void*)&cit) KlassInfoTable(false); | ||
} | ||
|
||
bool ObjectCountClosure::check_table_exists() { | ||
return !cit.allocation_failed(); | ||
} | ||
|
||
bool ObjectCountClosure::record_object(oop o) { | ||
if (!check_table_exists()) { | ||
return false; | ||
} | ||
cit.record_instance(o); | ||
return true; | ||
} | ||
|
||
KlassInfoTable* ObjectCountClosure::get_table() { | ||
return check_table_exists() ? &cit : nullptr; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#ifndef SHARE_GC_SHARED_OBJECTCOUNTCLOSURE_HPP | ||
#define SHARE_GC_SHARED_OBJECTCOUNTCLOSURE_HPP | ||
|
||
#include "gc/shared/gcId.hpp" | ||
#include "gc/shared/objectCountEventSender.hpp" | ||
#include "jfr/jfrEvents.hpp" | ||
#include "memory/heapInspection.hpp" | ||
#include "utilities/macros.hpp" | ||
#include "utilities/ticks.hpp" | ||
|
||
class KlassInfoEntry; | ||
class Klass; | ||
|
||
class ObjectCountClosure : public ObjectCountEventSender { | ||
static KlassInfoTable cit; | ||
|
||
public: | ||
static bool check_table_exists(); | ||
static bool record_object(oop o); | ||
static KlassInfoTable* get_table(); | ||
static void reset_table(); | ||
}; | ||
|
||
#endif // SHARE_GC_SHARED_OBJECTCOUNTCLOSURE_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
src/hotspot/share/gc/shared/objectCountEventSenderTemplate.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
// #ifndef SHARE_GC_SHARED_OBJECTCOUNTEVENTSENDERTEMPLATE_HPP | ||
// #define SHARE_GC_SHARED_OBJECTCOUNTEVENTSENDERTEMPLATE_HPP | ||
|
||
// #include "gc/shared/gcId.hpp" | ||
// #include "jfr/jfrEvents.hpp" | ||
// #include "memory/heapInspection.hpp" | ||
// #include "utilities/macros.hpp" | ||
// #include "utilities/ticks.hpp" | ||
// #if INCLUDE_SERVICES | ||
|
||
// class KlassInfoEntry; | ||
// class Klass; | ||
|
||
// template <typename Event> | ||
// class ObjectCountEventSenderTemplate : public AllStatic { | ||
// static bool _should_send_requestable_event; | ||
// static KlassInfoTable cit; | ||
|
||
// template <typename T> | ||
// static void send_event_if_enabled(Klass* klass, jlong count, julong size, const Ticks& timestamp); | ||
|
||
// public: | ||
// static bool check_table_exists(); | ||
// static KlassInfoTable* get_table(); | ||
// static void reset_table(); | ||
|
||
|
||
Check failure on line 27 in src/hotspot/share/gc/shared/objectCountEventSenderTemplate.hpp
|
||
// static void enable_requestable_event(); | ||
// static void disable_requestable_event(); | ||
// static bool record_object_instance(oop o); | ||
|
||
// static void send(const KlassInfoEntry* entry, const Ticks& timestamp); | ||
// static bool should_send_event(); | ||
// }; | ||
|
||
// typedef ObjectCountEventSenderTemplate<EventObjectCount> ObjectCountEventSender; | ||
// typedef ObjectCountEventSenderTemplate<EventObjectCountAfterGC> ObjectCountAfterGCEventSender; | ||
|
||
// template <typename Event> | ||
// bool ObjectCountEventSenderTemplate<Event>::should_send_event() { | ||
// #if INCLUDE_JFR | ||
// return _should_send_requestable_event || Event::is_enabled(); | ||
// #else | ||
// return false; | ||
// #endif // INCLUDE_JFR | ||
// } | ||
|
||
// template <typename Event> | ||
// bool ObjectCountEventSenderTemplate<Event>::_should_send_requestable_event = false; | ||
|
||
// template <typename Event> | ||
// KlassInfoTable ObjectCountEventSenderTemplate<Event>::cit(false); | ||
|
||
// template <typename Event> | ||
// void ObjectCountEventSenderTemplate<Event>::reset_table() { | ||
// cit.~KlassInfoTable(); | ||
// ::new((void*)&cit) KlassInfoTable(false); | ||
// } | ||
|
||
|
||
// template <typename Event> | ||
// bool ObjectCountEventSenderTemplate<Event>::check_table_exists() { | ||
// return !cit.allocation_failed(); | ||
// } | ||
|
||
// template <typename Event> | ||
// bool ObjectCountEventSenderTemplate<Event>::record_object_instance(oop o) { | ||
// if (!check_table_exists()) { | ||
// return false; | ||
Check failure on line 69 in src/hotspot/share/gc/shared/objectCountEventSenderTemplate.hpp
|
||
// } | ||
// cit.record_instance(o); | ||
// return true; | ||
// } | ||
|
||
// template <typename Event> | ||
// KlassInfoTable* ObjectCountEventSenderTemplate<Event>::get_table() { | ||
// return &cit; | ||
// } | ||
|
||
|
||
// template <typename Event> | ||
// void ObjectCountEventSenderTemplate<Event>::enable_requestable_event() { | ||
// _should_send_requestable_event = true; | ||
// } | ||
|
||
|
||
// template <typename Event> | ||
// void ObjectCountEventSenderTemplate<Event>::disable_requestable_event() { | ||
// _should_send_requestable_event = false; | ||
// } | ||
|
||
// template <typename Event> | ||
// template <typename T> | ||
// void ObjectCountEventSenderTemplate<Event>::send_event_if_enabled(Klass* klass, jlong count, julong size, const Ticks& timestamp) { | ||
// T event(UNTIMED); | ||
// if (event.should_commit()) { | ||
// event.set_starttime(timestamp); | ||
// event.set_endtime(timestamp); | ||
// event.set_gcId(GCId::current()); | ||
// event.set_objectClass(klass); | ||
// event.set_count(count); | ||
// event.set_totalSize(size); | ||
// event.commit(); | ||
// } | ||
// } | ||
|
||
// template <typename Event> | ||
// void ObjectCountEventSenderTemplate<Event>::send(const KlassInfoEntry* entry, const Ticks& timestamp) { | ||
// Klass* klass = entry->klass(); | ||
// jlong count = entry->count(); | ||
// julong total_size = entry->words() * BytesPerWord; | ||
|
||
// 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()) { | ||
// send_event_if_enabled<EventObjectCount>(klass, count, total_size, timestamp); | ||
// } | ||
// } | ||
// #endif // INCLUDE_SERVICES | ||
|
||
// #endif // SHARE_GC_SHARED_OBJECTCOUNTEVENTSENDERTEMPLATE_HPP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).
Uh oh!
There was an error while loading. Please reload this page.
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 thereport_object_count_after_gc
method (might rename it, since it sounds misleading when the ObjectCount event calls this method) to be a template method.I'll create a closure that does the class info table as I mark objects like discussed in yesterday's meeting.
I'll make sure to send events concurrently with the application.