This commit is contained in:
Jesper Wilhelmsson 2014-10-14 20:35:45 +00:00
commit 1055ae0436
5 changed files with 26 additions and 29 deletions

View File

@ -4098,7 +4098,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
_hrm.verify_optional();
verify_region_sets_optional();
TASKQUEUE_STATS_ONLY(if (ParallelGCVerbose) print_taskqueue_stats());
TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) print_taskqueue_stats());
TASKQUEUE_STATS_ONLY(reset_taskqueue_stats());
print_heap_after_gc();
@ -4668,7 +4668,7 @@ public:
_g1h->g1_policy()->record_thread_age_table(pss.age_table());
_g1h->update_surviving_young_words(pss.surviving_young_words()+1);
if (ParallelGCVerbose) {
if (PrintTerminationStats) {
MutexLocker x(stats_lock());
pss.print_termination_stats(worker_id);
}
@ -5762,7 +5762,7 @@ void G1CollectedHeap::evacuate_collection_set(EvacuationInfo& evacuation_info) {
if (G1CollectedHeap::use_parallel_gc_threads()) {
// The individual threads will set their evac-failure closures.
if (ParallelGCVerbose) G1ParScanThreadState::print_termination_stats_hdr();
if (PrintTerminationStats) G1ParScanThreadState::print_termination_stats_hdr();
// These tasks use ShareHeap::_process_strong_tasks
assert(UseDynamicNumberOfGCThreads ||
workers()->active_workers() == workers()->total_workers(),

View File

@ -1065,10 +1065,8 @@ void ParNewGeneration::collect(bool full,
gch->print_heap_change(gch_prev_used);
}
if (PrintGCDetails && ParallelGCVerbose) {
TASKQUEUE_STATS_ONLY(thread_state_set.print_termination_stats());
TASKQUEUE_STATS_ONLY(thread_state_set.print_taskqueue_stats());
}
TASKQUEUE_STATS_ONLY(if (PrintTerminationStats) thread_state_set.print_termination_stats());
TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) thread_state_set.print_taskqueue_stats());
if (UseAdaptiveSizePolicy) {
size_policy->minor_collection_end(gch->gc_cause());

View File

@ -91,7 +91,7 @@ void PSPromotionManager::pre_scavenge() {
bool PSPromotionManager::post_scavenge(YoungGCTracer& gc_tracer) {
bool promotion_failure_occurred = false;
TASKQUEUE_STATS_ONLY(if (PrintGCDetails && ParallelGCVerbose) print_stats());
TASKQUEUE_STATS_ONLY(if (PrintTaskqueue) print_taskqueue_stats());
for (uint i = 0; i < ParallelGCThreads + 1; i++) {
PSPromotionManager* manager = manager_array(i);
assert(manager->claimed_stack_depth()->is_empty(), "should be empty");
@ -106,16 +106,9 @@ bool PSPromotionManager::post_scavenge(YoungGCTracer& gc_tracer) {
#if TASKQUEUE_STATS
void
PSPromotionManager::print_taskqueue_stats(uint i) const {
tty->print("%3u ", i);
_claimed_stack_depth.stats.print();
tty->cr();
}
void
PSPromotionManager::print_local_stats(uint i) const {
PSPromotionManager::print_local_stats(outputStream* const out, uint i) const {
#define FMT " " SIZE_FORMAT_W(10)
tty->print_cr("%3u" FMT FMT FMT FMT, i, _masked_pushes, _masked_steals,
out->print_cr("%3u" FMT FMT FMT FMT, i, _masked_pushes, _masked_steals,
_arrays_chunked, _array_chunks_processed);
#undef FMT
}
@ -127,20 +120,24 @@ static const char* const pm_stats_hdr[] = {
};
void
PSPromotionManager::print_stats() {
tty->print_cr("== GC Tasks Stats, GC %3d",
PSPromotionManager::print_taskqueue_stats(outputStream* const out) {
out->print_cr("== GC Tasks Stats, GC %3d",
Universe::heap()->total_collections());
tty->print("thr "); TaskQueueStats::print_header(1); tty->cr();
tty->print("--- "); TaskQueueStats::print_header(2); tty->cr();
TaskQueueStats totals;
out->print("thr "); TaskQueueStats::print_header(1, out); out->cr();
out->print("--- "); TaskQueueStats::print_header(2, out); out->cr();
for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
manager_array(i)->print_taskqueue_stats(i);
TaskQueueStats& next = manager_array(i)->_claimed_stack_depth.stats;
out->print("%3d ", i); next.print(out); out->cr();
totals += next;
}
out->print("tot "); totals.print(out); out->cr();
const uint hlines = sizeof(pm_stats_hdr) / sizeof(pm_stats_hdr[0]);
for (uint i = 0; i < hlines; ++i) tty->print_cr("%s", pm_stats_hdr[i]);
for (uint i = 0; i < hlines; ++i) out->print_cr("%s", pm_stats_hdr[i]);
for (uint i = 0; i < ParallelGCThreads + 1; ++i) {
manager_array(i)->print_local_stats(i);
manager_array(i)->print_local_stats(out, i);
}
}

View File

@ -68,9 +68,8 @@ class PSPromotionManager VALUE_OBJ_CLASS_SPEC {
size_t _arrays_chunked;
size_t _array_chunks_processed;
void print_taskqueue_stats(uint i) const;
void print_local_stats(uint i) const;
static void print_stats();
void print_local_stats(outputStream* const out, uint i) const;
static void print_taskqueue_stats(outputStream* const out = gclog_or_tty);
void reset_stats();
#endif // TASKQUEUE_STATS

View File

@ -1533,8 +1533,11 @@ class CommandLineFlags {
product(bool, UseParNewGC, false, \
"Use parallel threads in the new generation") \
\
product(bool, ParallelGCVerbose, false, \
"Verbose output for parallel gc") \
product(bool, PrintTaskqueue, false, \
"Print taskqueue statistics for parallel collectors") \
\
product(bool, PrintTerminationStats, false, \
"Print termination statistics for parallel collectors") \
\
product(uintx, ParallelGCBufferWastePct, 10, \
"Wasted fraction of parallel allocation buffer") \