mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8068394: Trace event for concurrent GC phases
Add concurrent phase events for CMS and G1 Reviewed-by: brutisso, stefank
This commit is contained in:
parent
a22ed33318
commit
93bd48e615
10 changed files with 203 additions and 100 deletions
|
@ -90,6 +90,20 @@ void ConcurrentMarkThread::delay_to_keep_mmu(G1CollectorPolicy* g1_policy, bool
|
|||
os::sleep(this, sleep_time_ms, false);
|
||||
}
|
||||
}
|
||||
|
||||
class GCConcPhaseTimer : StackObj {
|
||||
ConcurrentMark* _cm;
|
||||
|
||||
public:
|
||||
GCConcPhaseTimer(ConcurrentMark* cm, const char* title) : _cm(cm) {
|
||||
_cm->register_concurrent_phase_start(title);
|
||||
}
|
||||
|
||||
~GCConcPhaseTimer() {
|
||||
_cm->register_concurrent_phase_end();
|
||||
}
|
||||
};
|
||||
|
||||
void ConcurrentMarkThread::run() {
|
||||
initialize_in_thread();
|
||||
wait_for_universe_init();
|
||||
|
@ -127,6 +141,7 @@ void ConcurrentMarkThread::run_service() {
|
|||
// correctness issue.
|
||||
|
||||
if (!cm()->has_aborted()) {
|
||||
GCConcPhaseTimer(_cm, "Concurrent Root Region Scanning");
|
||||
_cm->scanRootRegions();
|
||||
}
|
||||
|
||||
|
@ -140,6 +155,7 @@ void ConcurrentMarkThread::run_service() {
|
|||
do {
|
||||
iter++;
|
||||
if (!cm()->has_aborted()) {
|
||||
GCConcPhaseTimer(_cm, "Concurrent Mark");
|
||||
_cm->markFromRoots();
|
||||
}
|
||||
|
||||
|
@ -194,6 +210,7 @@ void ConcurrentMarkThread::run_service() {
|
|||
// reclaimed by cleanup.
|
||||
|
||||
GCTraceConcTime(Info, gc) tt("Concurrent Cleanup");
|
||||
GCConcPhaseTimer(_cm, "Concurrent Cleanup");
|
||||
|
||||
// Now do the concurrent cleanup operation.
|
||||
_cm->completeCleanup();
|
||||
|
@ -250,6 +267,7 @@ void ConcurrentMarkThread::run_service() {
|
|||
// We may have aborted just before the remark. Do not bother clearing the
|
||||
// bitmap then, as it has been done during mark abort.
|
||||
if (!cm()->has_aborted()) {
|
||||
GCConcPhaseTimer(_cm, "Concurrent Bitmap Clearing");
|
||||
_cm->clearNextBitmap();
|
||||
} else {
|
||||
assert(!G1VerifyBitmaps || _cm->nextMarkBitmapIsClear(), "Next mark bitmap must be clear");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue