524 }
525
526 void G1EvacPhaseWithTrimTimeTracker::stop() {
527 assert(!_stopped, "Should only be called once");
528 _total_time += (Ticks::now() - _start) - _pss->trim_ticks();
529 _trim_time += _pss->trim_ticks();
530 _pss->reset_trim_ticks();
531 _stopped = true;
532 }
533
534 G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
535 _start_time(), _phase(phase), _phase_times(phase_times), _worker_id(worker_id), _event() {
536 if (_phase_times != NULL) {
537 _start_time = Ticks::now();
538 }
539 }
540
541 G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() {
542 if (_phase_times != NULL) {
543 _phase_times->record_time_secs(_phase, _worker_id, (Ticks::now() - _start_time).seconds());
544 _event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_phase));
545 }
546 }
547
548 G1EvacPhaseTimesTracker::G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times,
549 G1ParScanThreadState* pss,
550 G1GCPhaseTimes::GCParPhases phase,
551 uint worker_id) :
552 G1GCParPhaseTimesTracker(phase_times, phase, worker_id),
553 _total_time(),
554 _trim_time(),
555 _trim_tracker(pss, _total_time, _trim_time) {
556 }
557
558 G1EvacPhaseTimesTracker::~G1EvacPhaseTimesTracker() {
559 if (_phase_times != NULL) {
560 // Explicitly stop the trim tracker since it's not yet destructed.
561 _trim_tracker.stop();
562 // Exclude trim time by increasing the start time.
563 _start_time += _trim_time;
564 _phase_times->record_or_add_objcopy_time_secs(_worker_id, _trim_time.seconds());
|
524 }
525
526 void G1EvacPhaseWithTrimTimeTracker::stop() {
527 assert(!_stopped, "Should only be called once");
528 _total_time += (Ticks::now() - _start) - _pss->trim_ticks();
529 _trim_time += _pss->trim_ticks();
530 _pss->reset_trim_ticks();
531 _stopped = true;
532 }
533
534 G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
535 _start_time(), _phase(phase), _phase_times(phase_times), _worker_id(worker_id), _event() {
536 if (_phase_times != NULL) {
537 _start_time = Ticks::now();
538 }
539 }
540
541 G1GCParPhaseTimesTracker::~G1GCParPhaseTimesTracker() {
542 if (_phase_times != NULL) {
543 _phase_times->record_time_secs(_phase, _worker_id, (Ticks::now() - _start_time).seconds());
544 JFR_ONLY(_event.commit(GCId::current(), _worker_id, G1GCPhaseTimes::phase_name(_phase));)
545 }
546 }
547
548 G1EvacPhaseTimesTracker::G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times,
549 G1ParScanThreadState* pss,
550 G1GCPhaseTimes::GCParPhases phase,
551 uint worker_id) :
552 G1GCParPhaseTimesTracker(phase_times, phase, worker_id),
553 _total_time(),
554 _trim_time(),
555 _trim_tracker(pss, _total_time, _trim_time) {
556 }
557
558 G1EvacPhaseTimesTracker::~G1EvacPhaseTimesTracker() {
559 if (_phase_times != NULL) {
560 // Explicitly stop the trim tracker since it's not yet destructed.
561 _trim_tracker.stop();
562 // Exclude trim time by increasing the start time.
563 _start_time += _trim_time;
564 _phase_times->record_or_add_objcopy_time_secs(_worker_id, _trim_time.seconds());
|