< prev index next >

src/hotspot/share/gc/shenandoah/shenandoahPhaseTimings.cpp

Print this page
rev 57242 : imported patch 8235341-workerdataarray-cleanup


 121 void ShenandoahPhaseTimings::print_summary_sd(outputStream* out, const char* str, const HdrSeq* seq) const {
 122   out->print_cr("%-27s = %8.2lf s (a = %8.0lf us) (n = " INT32_FORMAT_W(5) ") (lvls, us = %8.0lf, %8.0lf, %8.0lf, %8.0lf, %8.0lf)",
 123           str,
 124           seq->sum(),
 125           seq->avg() * 1000000.0,
 126           seq->num(),
 127           seq->percentile(0)  * 1000000.0,
 128           seq->percentile(25) * 1000000.0,
 129           seq->percentile(50) * 1000000.0,
 130           seq->percentile(75) * 1000000.0,
 131           seq->maximum() * 1000000.0
 132   );
 133 }
 134 
 135 ShenandoahWorkerTimings::ShenandoahWorkerTimings(uint max_gc_threads) :
 136         _max_gc_threads(max_gc_threads)
 137 {
 138   assert(max_gc_threads > 0, "Must have some GC threads");
 139 
 140 #define GC_PAR_PHASE_DECLARE_WORKER_DATA(type, title) \
 141   _gc_par_phases[ShenandoahPhaseTimings::type] = new WorkerDataArray<double>(max_gc_threads, title);
 142   // Root scanning phases
 143   SHENANDOAH_GC_PAR_PHASE_DO(GC_PAR_PHASE_DECLARE_WORKER_DATA)
 144 #undef GC_PAR_PHASE_DECLARE_WORKER_DATA
 145 }
 146 
 147 // record the time a phase took in seconds
 148 void ShenandoahWorkerTimings::record_time_secs(ShenandoahPhaseTimings::GCParPhases phase, uint worker_i, double secs) {
 149   _gc_par_phases[phase]->set(worker_i, secs);
 150 }
 151 
 152 double ShenandoahWorkerTimings::average(uint i) const {
 153   return _gc_par_phases[i]->average();
 154 }
 155 
 156 void ShenandoahWorkerTimings::reset(uint i) {
 157   _gc_par_phases[i]->reset();
 158 }
 159 
 160 void ShenandoahWorkerTimings::print() const {
 161   for (uint i = 0; i < ShenandoahPhaseTimings::GCParPhasesSentinel; i++) {
 162     _gc_par_phases[i]->print_summary_on(tty);
 163   }
 164 }
 165 
 166 
 167 ShenandoahTerminationTimings::ShenandoahTerminationTimings(uint max_gc_threads) {
 168   _gc_termination_phase = new WorkerDataArray<double>(max_gc_threads, "Task Termination (ms):");
 169 }
 170 
 171 void ShenandoahTerminationTimings::record_time_secs(uint worker_id, double secs) {
 172   if (_gc_termination_phase->get(worker_id) == WorkerDataArray<double>::uninitialized()) {
 173     _gc_termination_phase->set(worker_id, secs);
 174   } else {
 175     // worker may re-enter termination phase
 176     _gc_termination_phase->add(worker_id, secs);
 177   }
 178 }
 179 
 180 void ShenandoahTerminationTimings::print() const {
 181   _gc_termination_phase->print_summary_on(tty);
 182 }
 183 
 184 double ShenandoahTerminationTimings::average() const {
 185   return _gc_termination_phase->average();
 186 }
 187 
 188 void ShenandoahTerminationTimings::reset() {


 121 void ShenandoahPhaseTimings::print_summary_sd(outputStream* out, const char* str, const HdrSeq* seq) const {
 122   out->print_cr("%-27s = %8.2lf s (a = %8.0lf us) (n = " INT32_FORMAT_W(5) ") (lvls, us = %8.0lf, %8.0lf, %8.0lf, %8.0lf, %8.0lf)",
 123           str,
 124           seq->sum(),
 125           seq->avg() * 1000000.0,
 126           seq->num(),
 127           seq->percentile(0)  * 1000000.0,
 128           seq->percentile(25) * 1000000.0,
 129           seq->percentile(50) * 1000000.0,
 130           seq->percentile(75) * 1000000.0,
 131           seq->maximum() * 1000000.0
 132   );
 133 }
 134 
 135 ShenandoahWorkerTimings::ShenandoahWorkerTimings(uint max_gc_threads) :
 136         _max_gc_threads(max_gc_threads)
 137 {
 138   assert(max_gc_threads > 0, "Must have some GC threads");
 139 
 140 #define GC_PAR_PHASE_DECLARE_WORKER_DATA(type, title) \
 141   _gc_par_phases[ShenandoahPhaseTimings::type] = new WorkerDataArray<double>(title, max_gc_threads);
 142   // Root scanning phases
 143   SHENANDOAH_GC_PAR_PHASE_DO(GC_PAR_PHASE_DECLARE_WORKER_DATA)
 144 #undef GC_PAR_PHASE_DECLARE_WORKER_DATA
 145 }
 146 
 147 // record the time a phase took in seconds
 148 void ShenandoahWorkerTimings::record_time_secs(ShenandoahPhaseTimings::GCParPhases phase, uint worker_i, double secs) {
 149   _gc_par_phases[phase]->set(worker_i, secs);
 150 }
 151 
 152 double ShenandoahWorkerTimings::average(uint i) const {
 153   return _gc_par_phases[i]->average();
 154 }
 155 
 156 void ShenandoahWorkerTimings::reset(uint i) {
 157   _gc_par_phases[i]->reset();
 158 }
 159 
 160 void ShenandoahWorkerTimings::print() const {
 161   for (uint i = 0; i < ShenandoahPhaseTimings::GCParPhasesSentinel; i++) {
 162     _gc_par_phases[i]->print_summary_on(tty);
 163   }
 164 }
 165 
 166 
 167 ShenandoahTerminationTimings::ShenandoahTerminationTimings(uint max_gc_threads) {
 168   _gc_termination_phase = new WorkerDataArray<double>("Task Termination (ms):", max_gc_threads);
 169 }
 170 
 171 void ShenandoahTerminationTimings::record_time_secs(uint worker_id, double secs) {
 172   if (_gc_termination_phase->get(worker_id) == WorkerDataArray<double>::uninitialized()) {
 173     _gc_termination_phase->set(worker_id, secs);
 174   } else {
 175     // worker may re-enter termination phase
 176     _gc_termination_phase->add(worker_id, secs);
 177   }
 178 }
 179 
 180 void ShenandoahTerminationTimings::print() const {
 181   _gc_termination_phase->print_summary_on(tty);
 182 }
 183 
 184 double ShenandoahTerminationTimings::average() const {
 185   return _gc_termination_phase->average();
 186 }
 187 
 188 void ShenandoahTerminationTimings::reset() {
< prev index next >