< prev index next >

src/share/vm/gc/shared/gcTrace.cpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:


   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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc_implementation/shared/copyFailedInfo.hpp"
  27 #include "gc_implementation/shared/gcHeapSummary.hpp"
  28 #include "gc_implementation/shared/gcId.hpp"
  29 #include "gc_implementation/shared/gcTimer.hpp"
  30 #include "gc_implementation/shared/gcTrace.hpp"
  31 #include "gc_implementation/shared/objectCountEventSender.hpp"

  32 #include "memory/heapInspection.hpp"
  33 #include "memory/referenceProcessorStats.hpp"
  34 #include "memory/resourceArea.hpp"
  35 #include "runtime/os.hpp"
  36 #include "utilities/globalDefinitions.hpp"
  37 #include "utilities/macros.hpp"
  38 #include "utilities/ticks.inline.hpp"
  39 #if INCLUDE_ALL_GCS
  40 #include "gc_implementation/g1/evacuationInfo.hpp"
  41 #endif
  42 
  43 #define assert_unset_gc_id() assert(_shared_gc_info.gc_id().is_undefined(), "GC already started?")
  44 #define assert_set_gc_id() assert(!_shared_gc_info.gc_id().is_undefined(), "GC not started?")
  45 
  46 void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
  47   assert_unset_gc_id();
  48 
  49   GCId gc_id = GCId::create();
  50   _shared_gc_info.set_gc_id(gc_id);
  51   _shared_gc_info.set_cause(cause);
  52   _shared_gc_info.set_start_timestamp(timestamp);
  53 }
  54 
  55 void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
  56   assert_unset_gc_id();
  57 
  58   report_gc_start_impl(cause, timestamp);
  59 }
  60 




   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  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "gc/shared/copyFailedInfo.hpp"
  27 #include "gc/shared/gcHeapSummary.hpp"
  28 #include "gc/shared/gcId.hpp"
  29 #include "gc/shared/gcTimer.hpp"
  30 #include "gc/shared/gcTrace.hpp"
  31 #include "gc/shared/objectCountEventSender.hpp"
  32 #include "gc/shared/referenceProcessorStats.hpp"
  33 #include "memory/heapInspection.hpp"

  34 #include "memory/resourceArea.hpp"
  35 #include "runtime/os.hpp"
  36 #include "utilities/globalDefinitions.hpp"
  37 #include "utilities/macros.hpp"
  38 #include "utilities/ticks.inline.hpp"
  39 #if INCLUDE_ALL_GCS
  40 #include "gc/g1/evacuationInfo.hpp"
  41 #endif
  42 
  43 #define assert_unset_gc_id() assert(_shared_gc_info.gc_id().is_undefined(), "GC already started?")
  44 #define assert_set_gc_id() assert(!_shared_gc_info.gc_id().is_undefined(), "GC not started?")
  45 
  46 void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
  47   assert_unset_gc_id();
  48 
  49   GCId gc_id = GCId::create();
  50   _shared_gc_info.set_gc_id(gc_id);
  51   _shared_gc_info.set_cause(cause);
  52   _shared_gc_info.set_start_timestamp(timestamp);
  53 }
  54 
  55 void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
  56   assert_unset_gc_id();
  57 
  58   report_gc_start_impl(cause, timestamp);
  59 }
  60 


< prev index next >