101 102 double _external_accounted_time_ms; 103 104 double _recorded_young_cset_choice_time_ms; 105 double _recorded_non_young_cset_choice_time_ms; 106 107 double _recorded_redirty_logged_cards_time_ms; 108 109 double _recorded_young_free_cset_time_ms; 110 double _recorded_non_young_free_cset_time_ms; 111 112 double _cur_fast_reclaim_humongous_time_ms; 113 double _cur_fast_reclaim_humongous_register_time_ms; 114 size_t _cur_fast_reclaim_humongous_total; 115 size_t _cur_fast_reclaim_humongous_candidates; 116 size_t _cur_fast_reclaim_humongous_reclaimed; 117 118 double _cur_verify_before_time_ms; 119 double _cur_verify_after_time_ms; 120 121 // Helper methods for detailed logging 122 double info_line(const char* str, double value); 123 void debug_line(const char* str, double value); 124 void trace_line(const char* str, double value); 125 void trace_line(const char* str, size_t value); 126 void trace_phase_tasks(const char* indent, G1GCPhaseTimes::GCParPhases phase_id); 127 void trace_phase_counts(const char* indent, G1GCPhaseTimes::GCParPhases phase_id); 128 void debug_phase(G1GCPhaseTimes::GCParPhases phase_id); 129 void trace_phase(G1GCPhaseTimes::GCParPhases phase_id); 130 void trace_phase_no_sum(G1GCPhaseTimes::GCParPhases phase_id); 131 132 void note_gc_end(); 133 134 public: 135 G1GCPhaseTimes(uint max_gc_threads); 136 void note_gc_start(uint active_gc_threads); 137 void print(); 138 139 // record the time a phase took in seconds 140 void record_time_secs(GCParPhases phase, uint worker_i, double secs); 141 142 // add a number of seconds to a phase 143 void add_time_secs(GCParPhases phase, uint worker_i, double secs); 144 145 void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count); 146 147 // return the average time for a phase in milliseconds 148 double average_time_ms(GCParPhases phase); 149 150 size_t sum_thread_work_items(GCParPhases phase); 151 152 private: 153 double get_time_ms(GCParPhases phase, uint worker_i); 154 double sum_time_ms(GCParPhases phase); 155 double min_time_ms(GCParPhases phase); 156 double max_time_ms(GCParPhases phase); 157 size_t get_thread_work_item(GCParPhases phase, uint worker_i); 158 double average_thread_work_items(GCParPhases phase); 159 size_t min_thread_work_items(GCParPhases phase); 160 size_t max_thread_work_items(GCParPhases phase); 161 162 public: 163 164 void record_clear_ct_time(double ms) { 165 _cur_clear_ct_time_ms = ms; 166 } 167 168 void record_expand_heap_time(double ms) { 169 _cur_expand_heap_time_ms = ms; 170 } 171 172 void record_par_time(double ms) { 173 _cur_collection_par_time_ms = ms; 174 } 175 176 void record_code_root_fixup_time(double ms) { 177 _cur_collection_code_root_fixup_time_ms = ms; 178 } 179 180 void record_strong_code_root_purge_time(double ms) { | 101 102 double _external_accounted_time_ms; 103 104 double _recorded_young_cset_choice_time_ms; 105 double _recorded_non_young_cset_choice_time_ms; 106 107 double _recorded_redirty_logged_cards_time_ms; 108 109 double _recorded_young_free_cset_time_ms; 110 double _recorded_non_young_free_cset_time_ms; 111 112 double _cur_fast_reclaim_humongous_time_ms; 113 double _cur_fast_reclaim_humongous_register_time_ms; 114 size_t _cur_fast_reclaim_humongous_total; 115 size_t _cur_fast_reclaim_humongous_candidates; 116 size_t _cur_fast_reclaim_humongous_reclaimed; 117 118 double _cur_verify_before_time_ms; 119 double _cur_verify_after_time_ms; 120 121 void note_gc_end(); 122 123 template <class T> 124 void details(T* phase, const char* indent); 125 void log_phase(WorkerDataArray<double>* phase, uint indent, outputStream* out, bool print_sum); 126 void debug_phase(WorkerDataArray<double>* phase); 127 void trace_phase(WorkerDataArray<double>* phase, bool print_sum = true); 128 129 public: 130 G1GCPhaseTimes(uint max_gc_threads); 131 void note_gc_start(uint active_gc_threads); 132 void print(); 133 134 // record the time a phase took in seconds 135 void record_time_secs(GCParPhases phase, uint worker_i, double secs); 136 137 // add a number of seconds to a phase 138 void add_time_secs(GCParPhases phase, uint worker_i, double secs); 139 140 void record_thread_work_item(GCParPhases phase, uint worker_i, size_t count); 141 142 // return the average time for a phase in milliseconds 143 double average_time_ms(GCParPhases phase); 144 145 size_t sum_thread_work_items(GCParPhases phase); 146 147 public: 148 149 void record_clear_ct_time(double ms) { 150 _cur_clear_ct_time_ms = ms; 151 } 152 153 void record_expand_heap_time(double ms) { 154 _cur_expand_heap_time_ms = ms; 155 } 156 157 void record_par_time(double ms) { 158 _cur_collection_par_time_ms = ms; 159 } 160 161 void record_code_root_fixup_time(double ms) { 162 _cur_collection_code_root_fixup_time_ms = ms; 163 } 164 165 void record_strong_code_root_purge_time(double ms) { |