--- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp Thu Dec 10 23:02:31 2015 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp Thu Dec 10 14:57:55 2015 +0100
@@ -52,7 +52,7 @@
for (uint i = 0; i < n_workers(); i++) {
_cset_rs_update_cl[i] = NULL;
}
- if (G1SummarizeRSetStats) {
+ if (log_is_enabled(Trace, gc, remset)) {
_prev_period_summary.initialize(this);
}
// Initialize the card queue set used to hold cards containing
@@ -109,17 +109,6 @@
}
}
-void ScanRSClosure::printCard(HeapRegion* card_region, size_t card_index,
- HeapWord* card_start) {
- gclog_or_tty->print_cr("T %u Region [" PTR_FORMAT ", " PTR_FORMAT ") "
- "RS names card " SIZE_FORMAT_HEX ": "
- "[" PTR_FORMAT ", " PTR_FORMAT ")",
- _worker_i,
- p2i(card_region->bottom()), p2i(card_region->end()),
- card_index,
- p2i(card_start), p2i(card_start + G1BlockOffsetSharedArray::N_words));
-}
-
void ScanRSClosure::scan_strong_code_roots(HeapRegion* r) {
double scan_start = os::elapsedTime();
r->strong_code_roots_do(_code_root_cl);
@@ -152,10 +141,6 @@
}
if (current_card < jump_to_card) continue;
HeapWord* card_start = _g1h->bot_shared()->address_for_index(card_index);
-#if 0
- gclog_or_tty->print("Rem set iteration yielded card [" PTR_FORMAT ", " PTR_FORMAT ").\n",
- card_start, card_start + CardTableModRefBS::card_size_in_words);
-#endif
HeapRegion* card_region = _g1h->heap_region_containing(card_start);
_cards++;
@@ -526,31 +511,36 @@
return has_refs_into_cset;
}
-void G1RemSet::print_periodic_summary_info(const char* header) {
- G1RemSetSummary current;
- current.initialize(this);
+void G1RemSet::print_periodic_summary_info(const char* header, uint period_count) {
+ if ((G1SummarizeRSetStatsPeriod > 0) && log_is_enabled(Trace, gc, remset) &&
+ (period_count % G1SummarizeRSetStatsPeriod == 0)) {
+
+ if (!_prev_period_summary.initialized()) {
+ _prev_period_summary.initialize(this);
+ }
- _prev_period_summary.subtract_from(¤t);
- print_summary_info(&_prev_period_summary, header);
+ G1RemSetSummary current;
+ current.initialize(this);
+ _prev_period_summary.subtract_from(¤t);
- _prev_period_summary.set(¤t);
+ LogHandle(gc, remset) log;
+ log.trace("%s", header);
+ ResourceMark rm;
+ _prev_period_summary.print_on(log.trace_stream());
+
+ _prev_period_summary.set(¤t);
+ }
}
void G1RemSet::print_summary_info() {
- G1RemSetSummary current;
- current.initialize(this);
-
- print_summary_info(¤t, " Cumulative RS summary");
-}
-
-void G1RemSet::print_summary_info(G1RemSetSummary * summary, const char * header) {
- assert(summary != NULL, "just checking");
-
- if (header != NULL) {
- gclog_or_tty->print_cr("%s", header);
+ LogHandle(gc, remset, exit) log;
+ if (log.is_trace()) {
+ log.trace(" Cumulative RS summary");
+ G1RemSetSummary current;
+ current.initialize(this);
+ ResourceMark rm;
+ current.print_on(log.trace_stream());
}
-
- summary->print_on(gclog_or_tty);
}
void G1RemSet::prepare_for_verify() {