< prev index next >

src/hotspot/share/gc/shared/gcTimer.hpp

Print this page


   1 /*
   2  * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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  *


 149 
 150  protected:
 151   void register_gc_pause_start(const char* name, const Ticks& time = Ticks::now());
 152   void register_gc_pause_end(const Ticks& time = Ticks::now());
 153 };
 154 
 155 class STWGCTimer : public GCTimer {
 156  public:
 157   virtual void register_gc_start(const Ticks& time = Ticks::now());
 158   virtual void register_gc_end(const Ticks& time = Ticks::now());
 159 };
 160 
 161 class ConcurrentGCTimer : public GCTimer {
 162   // ConcurrentGCTimer can't be used if there is an overlap between a pause phase and a concurrent phase.
 163   // _is_concurrent_phase_active is used to find above case.
 164   bool _is_concurrent_phase_active;
 165 
 166  public:
 167   ConcurrentGCTimer(): GCTimer(), _is_concurrent_phase_active(false) {};
 168 
 169   void register_gc_pause_start(const char* name);
 170   void register_gc_pause_end();
 171 
 172   void register_gc_concurrent_start(const char* name, const Ticks& time = Ticks::now());
 173   void register_gc_concurrent_end(const Ticks& time = Ticks::now());
 174 };
 175 
 176 class TimePartitionPhasesIterator {
 177   TimePartitions* _time_partitions;
 178   int _next;
 179 
 180  public:
 181   TimePartitionPhasesIterator(TimePartitions* time_partitions) : _time_partitions(time_partitions), _next(0) { }
 182 
 183   virtual bool has_next();
 184   virtual GCPhase* next();
 185 };
 186 
 187 #endif // SHARE_VM_GC_SHARED_GCTIMER_HPP
   1 /*
   2  * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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  *


 149 
 150  protected:
 151   void register_gc_pause_start(const char* name, const Ticks& time = Ticks::now());
 152   void register_gc_pause_end(const Ticks& time = Ticks::now());
 153 };
 154 
 155 class STWGCTimer : public GCTimer {
 156  public:
 157   virtual void register_gc_start(const Ticks& time = Ticks::now());
 158   virtual void register_gc_end(const Ticks& time = Ticks::now());
 159 };
 160 
 161 class ConcurrentGCTimer : public GCTimer {
 162   // ConcurrentGCTimer can't be used if there is an overlap between a pause phase and a concurrent phase.
 163   // _is_concurrent_phase_active is used to find above case.
 164   bool _is_concurrent_phase_active;
 165 
 166  public:
 167   ConcurrentGCTimer(): GCTimer(), _is_concurrent_phase_active(false) {};
 168 
 169   void register_gc_pause_start(const char* name, const Ticks& time = Ticks::now());
 170   void register_gc_pause_end(const Ticks& time = Ticks::now());
 171 
 172   void register_gc_concurrent_start(const char* name, const Ticks& time = Ticks::now());
 173   void register_gc_concurrent_end(const Ticks& time = Ticks::now());
 174 };
 175 
 176 class TimePartitionPhasesIterator {
 177   TimePartitions* _time_partitions;
 178   int _next;
 179 
 180  public:
 181   TimePartitionPhasesIterator(TimePartitions* time_partitions) : _time_partitions(time_partitions), _next(0) { }
 182 
 183   virtual bool has_next();
 184   virtual GCPhase* next();
 185 };
 186 
 187 #endif // SHARE_VM_GC_SHARED_GCTIMER_HPP
< prev index next >