< prev index next >

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

Print this page
*** 1,7 ***
--- 1,8 ---
  /*
   * Copyright (c) 2017, 2021, Red Hat, Inc. All rights reserved.
+  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.

*** 95,10 ***
--- 96,11 ---
  
  bool ShenandoahPhaseTimings::is_worker_phase(Phase phase) {
    assert(phase >= 0 && phase < _num_phases, "Out of bounds");
    switch (phase) {
      case init_evac:
+     case init_scan_rset:
      case finish_mark:
      case purge_weak_par:
      case full_gc_mark:
      case full_gc_update_roots:
      case full_gc_adjust_roots:

*** 110,10 ***
--- 112,11 ---
      case full_gc_purge_weak_par:
      case degen_gc_weakrefs:
      case degen_gc_purge_class_unload:
      case degen_gc_purge_weak_par:
      case heap_iteration_roots:
+     case conc_mark:
      case conc_mark_roots:
      case conc_thread_roots:
      case conc_weak_roots_work:
      case conc_weak_refs:
      case conc_strong_roots:

*** 306,24 ***
      }
    }
  }
  
  ShenandoahWorkerTimingsTracker::ShenandoahWorkerTimingsTracker(ShenandoahPhaseTimings::Phase phase,
!         ShenandoahPhaseTimings::ParPhase par_phase, uint worker_id) :
          _timings(ShenandoahHeap::heap()->phase_timings()),
          _phase(phase), _par_phase(par_phase), _worker_id(worker_id) {
  
!   assert(_timings->worker_data(_phase, _par_phase)->get(_worker_id) == ShenandoahWorkerData::uninitialized(),
           "Should not be set yet: %s", ShenandoahPhaseTimings::phase_name(_timings->worker_par_phase(_phase, _par_phase)));
    _start_time = os::elapsedTime();
  }
  
  ShenandoahWorkerTimingsTracker::~ShenandoahWorkerTimingsTracker() {
!   _timings->worker_data(_phase, _par_phase)->set(_worker_id, os::elapsedTime() - _start_time);
  
    if (ShenandoahPhaseTimings::is_root_work_phase(_phase)) {
      ShenandoahPhaseTimings::Phase root_phase = _phase;
      ShenandoahPhaseTimings::Phase cur_phase = _timings->worker_par_phase(root_phase, _par_phase);
      _event.commit(GCId::current(), _worker_id, ShenandoahPhaseTimings::phase_name(cur_phase));
    }
  }
- 
--- 309,23 ---
      }
    }
  }
  
  ShenandoahWorkerTimingsTracker::ShenandoahWorkerTimingsTracker(ShenandoahPhaseTimings::Phase phase,
!         ShenandoahPhaseTimings::ParPhase par_phase, uint worker_id, bool cumulative) :
          _timings(ShenandoahHeap::heap()->phase_timings()),
          _phase(phase), _par_phase(par_phase), _worker_id(worker_id) {
  
!   assert(_timings->worker_data(_phase, _par_phase)->get(_worker_id) == ShenandoahWorkerData::uninitialized() || cumulative,
           "Should not be set yet: %s", ShenandoahPhaseTimings::phase_name(_timings->worker_par_phase(_phase, _par_phase)));
    _start_time = os::elapsedTime();
  }
  
  ShenandoahWorkerTimingsTracker::~ShenandoahWorkerTimingsTracker() {
!   _timings->worker_data(_phase, _par_phase)->set_or_add(_worker_id, os::elapsedTime() - _start_time);
  
    if (ShenandoahPhaseTimings::is_root_work_phase(_phase)) {
      ShenandoahPhaseTimings::Phase root_phase = _phase;
      ShenandoahPhaseTimings::Phase cur_phase = _timings->worker_par_phase(root_phase, _par_phase);
      _event.commit(GCId::current(), _worker_id, ShenandoahPhaseTimings::phase_name(cur_phase));
    }
  }
< prev index next >