< prev index next >

src/hotspot/share/gc/g1/g1GCPhaseTimes.hpp

Print this page


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_GC_G1_G1GCPHASETIMES_HPP
  26 #define SHARE_GC_G1_G1GCPHASETIMES_HPP
  27 
  28 #include "gc/shared/referenceProcessorPhaseTimes.hpp"
  29 #include "gc/shared/weakProcessorPhaseTimes.hpp"
  30 #include "jfr/jfrEvents.hpp"
  31 #include "logging/logLevel.hpp"
  32 #include "memory/allocation.hpp"
  33 #include "utilities/macros.hpp"
  34 
  35 class LineBuffer;
  36 class G1ParScanThreadState;
  37 class STWGCTimer;
  38 
  39 template <class T> class WorkerDataArray;
  40 
  41 class G1GCPhaseTimes : public CHeapObj<mtGC> {
  42   uint _max_gc_threads;
  43   jlong _gc_start_counter;
  44   double _gc_pause_time_ms;
  45 
  46  public:
  47   enum GCParPhases {
  48     GCWorkerStart,
  49     ExtRootScan,
  50     ThreadRoots,


 438   }
 439 
 440   ReferenceProcessorPhaseTimes* ref_phase_times() { return &_ref_phase_times; }
 441 
 442   WeakProcessorPhaseTimes* weak_phase_times() { return &_weak_phase_times; }
 443 };
 444 
 445 class G1EvacPhaseWithTrimTimeTracker : public StackObj {
 446   G1ParScanThreadState* _pss;
 447   Ticks _start;
 448 
 449   Tickspan& _total_time;
 450   Tickspan& _trim_time;
 451 
 452   bool _stopped;
 453 public:
 454   G1EvacPhaseWithTrimTimeTracker(G1ParScanThreadState* pss, Tickspan& total_time, Tickspan& trim_time);
 455   ~G1EvacPhaseWithTrimTimeTracker();
 456 
 457   void stop();
 458 };
 459 
 460 class G1GCParPhaseTimesTracker : public CHeapObj<mtGC> {
 461 protected:
 462   Ticks _start_time;
 463   G1GCPhaseTimes::GCParPhases _phase;
 464   G1GCPhaseTimes* _phase_times;
 465   uint _worker_id;
 466   EventGCPhaseParallel _event;
 467   bool _must_record;
 468 
 469 public:
 470   G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id, bool must_record = true);
 471   virtual ~G1GCParPhaseTimesTracker();
 472 };
 473 
 474 class G1EvacPhaseTimesTracker : public G1GCParPhaseTimesTracker {
 475   Tickspan _total_time;
 476   Tickspan _trim_time;
 477 
 478   G1EvacPhaseWithTrimTimeTracker _trim_tracker;
 479 public:
 480   G1EvacPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1ParScanThreadState* pss, G1GCPhaseTimes::GCParPhases phase, uint worker_id);
 481   virtual ~G1EvacPhaseTimesTracker();
 482 };
 483 
 484 #endif // SHARE_GC_G1_G1GCPHASETIMES_HPP


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_GC_G1_G1GCPHASETIMES_HPP
  26 #define SHARE_GC_G1_G1GCPHASETIMES_HPP
  27 
  28 #include "gc/shared/referenceProcessorPhaseTimes.hpp"
  29 #include "gc/shared/weakProcessorPhaseTimes.hpp"

  30 #include "logging/logLevel.hpp"
  31 #include "memory/allocation.hpp"
  32 #include "utilities/macros.hpp"
  33 
  34 class LineBuffer;
  35 class G1ParScanThreadState;
  36 class STWGCTimer;
  37 
  38 template <class T> class WorkerDataArray;
  39 
  40 class G1GCPhaseTimes : public CHeapObj<mtGC> {
  41   uint _max_gc_threads;
  42   jlong _gc_start_counter;
  43   double _gc_pause_time_ms;
  44 
  45  public:
  46   enum GCParPhases {
  47     GCWorkerStart,
  48     ExtRootScan,
  49     ThreadRoots,


 437   }
 438 
 439   ReferenceProcessorPhaseTimes* ref_phase_times() { return &_ref_phase_times; }
 440 
 441   WeakProcessorPhaseTimes* weak_phase_times() { return &_weak_phase_times; }
 442 };
 443 
 444 class G1EvacPhaseWithTrimTimeTracker : public StackObj {
 445   G1ParScanThreadState* _pss;
 446   Ticks _start;
 447 
 448   Tickspan& _total_time;
 449   Tickspan& _trim_time;
 450 
 451   bool _stopped;
 452 public:
 453   G1EvacPhaseWithTrimTimeTracker(G1ParScanThreadState* pss, Tickspan& total_time, Tickspan& trim_time);
 454   ~G1EvacPhaseWithTrimTimeTracker();
 455 
 456   void stop();
























 457 };
 458 
 459 #endif // SHARE_GC_G1_G1GCPHASETIMES_HPP
< prev index next >