8140508: Add utility method for logging phases to G1CollectorPolicy

Reviewed-by: mgerdin, tschatzl
This commit is contained in:
Erik Helin 2015-10-30 10:15:06 +01:00
parent 4930637288
commit d8b7d0ecd4
5 changed files with 11 additions and 3 deletions

View file

@ -3735,8 +3735,7 @@ void G1CollectedHeap::log_gc_footer(double pause_time_sec) {
gclog_or_tty->print(" (to-space exhausted)"); gclog_or_tty->print(" (to-space exhausted)");
} }
gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec); gclog_or_tty->print_cr(", %3.7f secs]", pause_time_sec);
g1_policy()->phase_times()->note_gc_end(); g1_policy()->print_phases(pause_time_sec);
g1_policy()->phase_times()->print(pause_time_sec);
g1_policy()->print_detailed_heap_transition(); g1_policy()->print_detailed_heap_transition();
} else { } else {
if (evacuation_failed()) { if (evacuation_failed()) {

View file

@ -1271,6 +1271,10 @@ void G1CollectorPolicy::print_detailed_heap_transition(bool full) const {
gclog_or_tty->cr(); gclog_or_tty->cr();
} }
void G1CollectorPolicy::print_phases(double pause_time_sec) {
phase_times()->print(pause_time_sec);
}
void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time, void G1CollectorPolicy::adjust_concurrent_refinement(double update_rs_time,
double update_rs_processed_buffers, double update_rs_processed_buffers,
double goal_ms) { double goal_ms) {

View file

@ -593,6 +593,8 @@ public:
void print_heap_transition() const; void print_heap_transition() const;
void print_detailed_heap_transition(bool full = false) const; void print_detailed_heap_transition(bool full = false) const;
virtual void print_phases(double pause_time_sec);
void record_stop_world_start(); void record_stop_world_start();
void record_concurrent_pause(); void record_concurrent_pause();

View file

@ -362,6 +362,8 @@ class G1GCParPhasePrinter : public StackObj {
}; };
void G1GCPhaseTimes::print(double pause_time_sec) { void G1GCPhaseTimes::print(double pause_time_sec) {
note_gc_end();
G1GCParPhasePrinter par_phase_printer(this); G1GCParPhasePrinter par_phase_printer(this);
if (_root_region_scan_wait_time_ms > 0.0) { if (_root_region_scan_wait_time_ms > 0.0) {

View file

@ -121,10 +121,11 @@ class G1GCPhaseTimes : public CHeapObj<mtGC> {
void print_stats(int level, const char* str, size_t value); void print_stats(int level, const char* str, size_t value);
void print_stats(int level, const char* str, double value, uint workers); void print_stats(int level, const char* str, double value, uint workers);
void note_gc_end();
public: public:
G1GCPhaseTimes(uint max_gc_threads); G1GCPhaseTimes(uint max_gc_threads);
void note_gc_start(uint active_gc_threads, bool mark_in_progress); void note_gc_start(uint active_gc_threads, bool mark_in_progress);
void note_gc_end();
void print(double pause_time_sec); void print(double pause_time_sec);
// record the time a phase took in seconds // record the time a phase took in seconds