67 if (!_policy->is_at_shutdown()) {
68 _timing_data[phase]._secs.add(time);
69 }
70 }
71
72 void ShenandoahPhaseTimings::record_workers_start(Phase phase) {
73 for (uint i = 0; i < GCParPhasesSentinel; i++) {
74 _worker_times->reset(i);
75 }
76 }
77
78 void ShenandoahPhaseTimings::record_workers_end(Phase phase) {
79 if (_policy->is_at_shutdown()) {
80 // Do not record the past-shutdown events
81 return;
82 }
83
84 guarantee(phase == init_evac ||
85 phase == scan_roots ||
86 phase == update_roots ||
87 phase == final_update_refs_roots ||
88 phase == full_gc_roots ||
89 phase == degen_gc_update_roots ||
90 phase == _num_phases,
91 "only in these phases we can add per-thread phase times");
92 if (phase != _num_phases) {
93 // Merge _phase_time to counters below the given phase.
94 for (uint i = 0; i < GCParPhasesSentinel; i++) {
95 double t = _worker_times->average(i);
96 _timing_data[phase + i + 1]._secs.add(t);
97 }
98 }
99 }
100
101 void ShenandoahPhaseTimings::print_on(outputStream* out) const {
102 out->cr();
103 out->print_cr("GC STATISTICS:");
104 out->print_cr(" \"(G)\" (gross) pauses include VM time: time to notify and block threads, do the pre-");
105 out->print_cr(" and post-safepoint housekeeping. Use -XX:+PrintSafepointStatistics to dissect.");
106 out->print_cr(" \"(N)\" (net) pauses are the times spent in the actual GC code.");
|
67 if (!_policy->is_at_shutdown()) {
68 _timing_data[phase]._secs.add(time);
69 }
70 }
71
72 void ShenandoahPhaseTimings::record_workers_start(Phase phase) {
73 for (uint i = 0; i < GCParPhasesSentinel; i++) {
74 _worker_times->reset(i);
75 }
76 }
77
78 void ShenandoahPhaseTimings::record_workers_end(Phase phase) {
79 if (_policy->is_at_shutdown()) {
80 // Do not record the past-shutdown events
81 return;
82 }
83
84 guarantee(phase == init_evac ||
85 phase == scan_roots ||
86 phase == update_roots ||
87 phase == init_traversal_gc_work ||
88 phase == init_weak_traversal_gc_work ||
89 phase == final_traversal_gc_work ||
90 phase == final_traversal_update_roots ||
91 phase == final_update_refs_roots ||
92 phase == full_gc_roots ||
93 phase == degen_gc_update_roots ||
94 phase == _num_phases,
95 "only in these phases we can add per-thread phase times");
96 if (phase != _num_phases) {
97 // Merge _phase_time to counters below the given phase.
98 for (uint i = 0; i < GCParPhasesSentinel; i++) {
99 double t = _worker_times->average(i);
100 _timing_data[phase + i + 1]._secs.add(t);
101 }
102 }
103 }
104
105 void ShenandoahPhaseTimings::print_on(outputStream* out) const {
106 out->cr();
107 out->print_cr("GC STATISTICS:");
108 out->print_cr(" \"(G)\" (gross) pauses include VM time: time to notify and block threads, do the pre-");
109 out->print_cr(" and post-safepoint housekeeping. Use -XX:+PrintSafepointStatistics to dissect.");
110 out->print_cr(" \"(N)\" (net) pauses are the times spent in the actual GC code.");
|