8287771: Remove useless G1 After GC summary refinement and sampling thread times

Reviewed-by: tschatzl, kbarrett
This commit is contained in:
tqxia 2022-06-20 12:58:26 +00:00 committed by Thomas Schatzl
parent 5cdb4b1960
commit 406cf611d9
6 changed files with 22 additions and 16 deletions

View File

@ -2803,7 +2803,9 @@ bool G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_
G1HeapPrinterMark::G1HeapPrinterMark(G1CollectedHeap* g1h) : _g1h(g1h), _heap_transition(g1h) {
// This summary needs to be printed before incrementing total collections.
_g1h->rem_set()->print_periodic_summary_info("Before GC RS summary", _g1h->total_collections());
_g1h->rem_set()->print_periodic_summary_info("Before GC RS summary",
_g1h->total_collections(),
true /* show_thread_times */);
_g1h->print_heap_before_gc();
_g1h->print_heap_regions();
}
@ -2812,7 +2814,9 @@ G1HeapPrinterMark::~G1HeapPrinterMark() {
_g1h->policy()->print_age_table();
_g1h->rem_set()->print_coarsen_stats();
// We are at the end of the GC. Total collections has already been increased.
_g1h->rem_set()->print_periodic_summary_info("After GC RS summary", _g1h->total_collections() - 1);
_g1h->rem_set()->print_periodic_summary_info("After GC RS summary",
_g1h->total_collections() - 1,
false /* show_thread_times */);
_heap_transition.print();
_g1h->print_heap_regions();

View File

@ -1763,7 +1763,7 @@ void G1RemSet::enqueue_for_reprocessing(CardValue* card_ptr) {
dcqs.enqueue_completed_buffer(BufferNode::make_node_from_buffer(buffer, index));
}
void G1RemSet::print_periodic_summary_info(const char* header, uint period_count) {
void G1RemSet::print_periodic_summary_info(const char* header, uint period_count, bool show_thread_times) {
if ((G1SummarizeRSetStatsPeriod > 0) && log_is_enabled(Trace, gc, remset) &&
(period_count % G1SummarizeRSetStatsPeriod == 0)) {
@ -1774,7 +1774,7 @@ void G1RemSet::print_periodic_summary_info(const char* header, uint period_count
log.trace("%s", header);
ResourceMark rm;
LogStream ls(log.trace());
_prev_period_summary.print_on(&ls);
_prev_period_summary.print_on(&ls, show_thread_times);
_prev_period_summary.set(&current);
}
@ -1787,7 +1787,7 @@ void G1RemSet::print_summary_info() {
G1RemSetSummary current;
ResourceMark rm;
LogStream ls(log.trace());
current.print_on(&ls);
current.print_on(&ls, true /* show_thread_times*/);
}
}

View File

@ -146,7 +146,7 @@ public:
void print_summary_info();
// Print accumulated summary info from the last time called.
void print_periodic_summary_info(const char* header, uint period_count);
void print_periodic_summary_info(const char* header, uint period_count, bool show_thread_times);
// Rebuilds the remembered set by scanning from bottom to TARS for all regions
// using the given workers.

View File

@ -321,15 +321,17 @@ public:
}
};
void G1RemSetSummary::print_on(outputStream* out) {
out->print_cr(" Concurrent refinement threads times (s)");
out->print(" ");
for (uint i = 0; i < _num_vtimes; i++) {
out->print(" %5.2f", rs_thread_vtime(i));
void G1RemSetSummary::print_on(outputStream* out, bool show_thread_times) {
if (show_thread_times) {
out->print_cr(" Concurrent refinement threads times (s)");
out->print(" ");
for (uint i = 0; i < _num_vtimes; i++) {
out->print(" %5.2f", rs_thread_vtime(i));
}
out->cr();
out->print_cr(" Sampling task time (ms)");
out->print_cr(" %5.3f", sampling_task_vtime() * MILLIUNITS);
}
out->cr();
out->print_cr(" Sampling task time (ms)");
out->print_cr(" %5.3f", sampling_task_vtime() * MILLIUNITS);
HRRSStatsIter blk;
G1CollectedHeap::heap()->heap_region_iterate(&blk);

View File

@ -57,7 +57,7 @@ public:
// subtract all counters from the other summary, and set them in the current
void subtract_from(G1RemSetSummary* other);
void print_on(outputStream* out);
void print_on(outputStream* out, bool show_thread_times);
double rs_thread_vtime(uint thread) const;

View File

@ -109,7 +109,7 @@ public class TestRemsetLoggingTools {
}
public static void expectRSetSummaries(String result, int expectedCumulative, int expectedPeriodic) throws Exception {
int actualTotal = result.split("Concurrent refinement threads times").length - 1;
int actualTotal = result.split("Current rem set statistics").length - 1;
int actualCumulative = result.split("Cumulative RS summary").length - 1;
if (expectedCumulative != actualCumulative) {