hotspot/src/share/vm/gc/shared/gcTrace.hpp
author brutisso
Wed, 30 Sep 2015 09:07:21 +0200
changeset 33107 77bf0d2069a3
parent 32608 ef2ec6fac731
child 34300 6075c1e0e913
permissions -rw-r--r--
8134953: Make the GC ID available in a central place Reviewed-by: pliden, jmasa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     1
/*
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     4
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     8
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    13
 * accompanied this code).
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    14
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    18
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    21
 * questions.
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    22
 *
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    23
 */
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    24
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
    25
#ifndef SHARE_VM_GC_SHARED_GCTRACE_HPP
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
    26
#define SHARE_VM_GC_SHARED_GCTRACE_HPP
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    27
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
    28
#include "gc/shared/copyFailedInfo.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
    29
#include "gc/shared/gcCause.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
    30
#include "gc/shared/gcId.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
    31
#include "gc/shared/gcName.hpp"
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
    32
#include "gc/shared/gcWhen.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    33
#include "memory/allocation.hpp"
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
    34
#include "memory/metaspace.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    35
#include "memory/referenceType.hpp"
27684
e0391b2bf625 8064581: Move INCLUDE_ALL_GCS include section to the end of the include list
stefank
parents: 25350
diff changeset
    36
#include "utilities/macros.hpp"
e0391b2bf625 8064581: Move INCLUDE_ALL_GCS include section to the end of the include list
stefank
parents: 25350
diff changeset
    37
#include "utilities/ticks.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    38
#if INCLUDE_ALL_GCS
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
    39
#include "gc/g1/g1YCTypes.hpp"
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    40
#endif
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    41
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    42
class EvacuationInfo;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    43
class GCHeapSummary;
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
    44
class MetaspaceChunkFreeListSummary;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    45
class MetaspaceSummary;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    46
class PSHeapSummary;
31344
2316eb7a0358 8025608: GC trace events missing nursery size information
david
parents: 30764
diff changeset
    47
class G1HeapSummary;
32380
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
    48
class G1EvacSummary;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    49
class ReferenceProcessorStats;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    50
class TimePartitions;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    51
class BoolObjectClosure;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    52
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    53
class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    54
 private:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    55
  GCName _name;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    56
  GCCause::Cause _cause;
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    57
  Ticks     _start_timestamp;
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    58
  Ticks     _end_timestamp;
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    59
  Tickspan  _sum_of_pauses;
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    60
  Tickspan  _longest_pause;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    61
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    62
 public:
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    63
  SharedGCInfo(GCName name) :
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    64
    _name(name),
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    65
    _cause(GCCause::_last_gc_cause),
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    66
    _start_timestamp(),
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    67
    _end_timestamp(),
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    68
    _sum_of_pauses(),
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    69
    _longest_pause() {
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    70
  }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    71
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    72
  void set_start_timestamp(const Ticks& timestamp) { _start_timestamp = timestamp; }
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    73
  const Ticks start_timestamp() const { return _start_timestamp; }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    74
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    75
  void set_end_timestamp(const Ticks& timestamp) { _end_timestamp = timestamp; }
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    76
  const Ticks end_timestamp() const { return _end_timestamp; }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    77
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    78
  void set_name(GCName name) { _name = name; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    79
  GCName name() const { return _name; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    80
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    81
  void set_cause(GCCause::Cause cause) { _cause = cause; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    82
  GCCause::Cause cause() const { return _cause; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    83
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    84
  void set_sum_of_pauses(const Tickspan& duration) { _sum_of_pauses = duration; }
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    85
  const Tickspan sum_of_pauses() const { return _sum_of_pauses; }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    86
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    87
  void set_longest_pause(const Tickspan& duration) { _longest_pause = duration; }
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
    88
  const Tickspan longest_pause() const { return _longest_pause; }
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    89
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    90
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    91
class ParallelOldGCInfo VALUE_OBJ_CLASS_SPEC {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    92
  void* _dense_prefix;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    93
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    94
  ParallelOldGCInfo() : _dense_prefix(NULL) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    95
  void report_dense_prefix(void* addr) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    96
    _dense_prefix = addr;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    97
  }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    98
  void* dense_prefix() const { return _dense_prefix; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
    99
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   100
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   101
#if INCLUDE_ALL_GCS
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   102
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   103
class G1YoungGCInfo VALUE_OBJ_CLASS_SPEC {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   104
  G1YCType _type;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   105
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   106
  G1YoungGCInfo() : _type(G1YCTypeEndSentinel) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   107
  void set_type(G1YCType type) {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   108
    _type = type;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   109
  }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   110
  G1YCType type() const { return _type; }
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   111
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   112
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   113
#endif // INCLUDE_ALL_GCS
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   114
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   115
class GCTracer : public ResourceObj {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   116
 protected:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   117
  SharedGCInfo _shared_gc_info;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   118
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   119
 public:
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
   120
  void report_gc_start(GCCause::Cause cause, const Ticks& timestamp);
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
   121
  void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   122
  void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   123
  void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   124
  void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   125
  void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   126
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   127
 protected:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   128
  GCTracer(GCName name) : _shared_gc_info(name) {}
25350
6423a57e5451 8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
brutisso
parents: 23470
diff changeset
   129
  void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
   130
  virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   131
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   132
 private:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   133
  void send_garbage_collection_event() const;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   134
  void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   135
  void send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const;
23470
ff2a7ea4225d 8036703: Add trace event with statistics for the metaspace chunk free lists
ehelin
parents: 21767
diff changeset
   136
  void send_metaspace_chunk_free_list_summary(GCWhen::Type when, Metaspace::MetadataType mdtype, const MetaspaceChunkFreeListSummary& summary) const;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   137
  void send_reference_stats_event(ReferenceType type, size_t count) const;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   138
  void send_phase_events(TimePartitions* time_partitions) const;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   139
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   140
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   141
class YoungGCTracer : public GCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   142
  static const uint UNSET_TENURING_THRESHOLD = (uint) -1;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   143
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   144
  uint _tenuring_threshold;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   145
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   146
 protected:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   147
  YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {}
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
   148
  virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   149
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   150
 public:
28940
c314cf1db3fa 8066566: Refactor ParNewGeneration to contain ParNewTracer
mlarsson
parents: 28024
diff changeset
   151
  void report_promotion_failed(const PromotionFailedInfo& pf_info) const;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   152
  void report_tenuring_threshold(const uint tenuring_threshold);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   153
28024
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   154
  /*
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   155
   * Methods for reporting Promotion in new or outside PLAB Events.
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   156
   *
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   157
   * The object age is always required as it is not certain that the mark word
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   158
   * of the oop can be trusted at this stage.
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   159
   *
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   160
   * obj_size is the size of the promoted object in bytes.
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   161
   *
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   162
   * tenured should be true if the object has been promoted to the old
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   163
   * space during this GC, if the object is copied to survivor space
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   164
   * from young space or survivor space (aging) tenured should be false.
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   165
   *
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   166
   * plab_size is the size of the newly allocated PLAB in bytes.
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   167
   */
32608
ef2ec6fac731 8066443: Add G1 support for promotion event
sfriberg
parents: 32380
diff changeset
   168
  bool should_report_promotion_events() const;
28024
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   169
  bool should_report_promotion_in_new_plab_event() const;
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   170
  bool should_report_promotion_outside_plab_event() const;
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   171
  void report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   172
                                          uint age, bool tenured,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   173
                                          size_t plab_size) const;
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   174
  void report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   175
                                           uint age, bool tenured) const;
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   176
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   177
 private:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   178
  void send_young_gc_event() const;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   179
  void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;
28024
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   180
  bool should_send_promotion_in_new_plab_event() const;
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   181
  bool should_send_promotion_outside_plab_event() const;
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   182
  void send_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   183
                                        uint age, bool tenured,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   184
                                        size_t plab_size) const;
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   185
  void send_promotion_outside_plab_event(Klass* klass, size_t obj_size,
33102d6e1f06 8066441: Add PLAB trace event
sfriberg
parents: 27684
diff changeset
   186
                                         uint age, bool tenured) const;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   187
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   188
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   189
class OldGCTracer : public GCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   190
 protected:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   191
  OldGCTracer(GCName name) : GCTracer(name) {}
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
   192
  virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   193
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   194
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   195
  void report_concurrent_mode_failure();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   196
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   197
 private:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   198
  void send_old_gc_event() const;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   199
  void send_concurrent_mode_failure_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   200
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   201
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   202
class ParallelOldTracer : public OldGCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   203
  ParallelOldGCInfo _parallel_old_gc_info;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   204
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   205
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   206
  ParallelOldTracer() : OldGCTracer(ParallelOld) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   207
  void report_dense_prefix(void* dense_prefix);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   208
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   209
 protected:
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
   210
  void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   211
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   212
 private:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   213
  void send_parallel_old_event() const;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   214
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   215
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   216
class SerialOldTracer : public OldGCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   217
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   218
  SerialOldTracer() : OldGCTracer(SerialOld) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   219
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   220
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   221
class ParallelScavengeTracer : public YoungGCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   222
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   223
  ParallelScavengeTracer() : YoungGCTracer(ParallelScavenge) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   224
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   225
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   226
class DefNewTracer : public YoungGCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   227
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   228
  DefNewTracer() : YoungGCTracer(DefNew) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   229
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   230
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   231
class ParNewTracer : public YoungGCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   232
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   233
  ParNewTracer() : YoungGCTracer(ParNew) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   234
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   235
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   236
#if INCLUDE_ALL_GCS
31619
f27b8fcf4018 8078901: Add trace event for G1 MMU information
sjohanss
parents: 31344
diff changeset
   237
class G1MMUTracer : public AllStatic {
33107
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 32608
diff changeset
   238
  static void send_g1_mmu_event(double timeSlice, double gcTime, double maxTime);
31619
f27b8fcf4018 8078901: Add trace event for G1 MMU information
sjohanss
parents: 31344
diff changeset
   239
f27b8fcf4018 8078901: Add trace event for G1 MMU information
sjohanss
parents: 31344
diff changeset
   240
 public:
33107
77bf0d2069a3 8134953: Make the GC ID available in a central place
brutisso
parents: 32608
diff changeset
   241
  static void report_mmu(double timeSlice, double gcTime, double maxTime);
31619
f27b8fcf4018 8078901: Add trace event for G1 MMU information
sjohanss
parents: 31344
diff changeset
   242
};
f27b8fcf4018 8078901: Add trace event for G1 MMU information
sjohanss
parents: 31344
diff changeset
   243
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   244
class G1NewTracer : public YoungGCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   245
  G1YoungGCInfo _g1_young_gc_info;
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   246
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   247
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   248
  G1NewTracer() : YoungGCTracer(G1New) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   249
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   250
  void report_yc_type(G1YCType type);
21767
41eaa9a17059 8028128: Add a type safe alternative for working with counter based data
mgronlun
parents: 18704
diff changeset
   251
  void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   252
  void report_evacuation_info(EvacuationInfo* info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   253
  void report_evacuation_failed(EvacuationFailedInfo& ef_info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   254
32380
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   255
  void report_evacuation_statistics(const G1EvacSummary& young_summary, const G1EvacSummary& old_summary) const;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   256
 private:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   257
  void send_g1_young_gc_event();
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   258
  void send_evacuation_info_event(EvacuationInfo* info);
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   259
  void send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const;
32380
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   260
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   261
  void send_young_evacuation_statistics(const G1EvacSummary& summary) const;
1dcdb686f0cb 8133530: Add JFR event for evacuation statistics
tschatzl
parents: 31619
diff changeset
   262
  void send_old_evacuation_statistics(const G1EvacSummary& summary) const;
18025
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   263
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   264
#endif
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   265
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   266
class CMSTracer : public OldGCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   267
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   268
  CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   269
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   270
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   271
class G1OldTracer : public OldGCTracer {
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   272
 public:
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   273
  G1OldTracer() : OldGCTracer(G1Old) {}
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   274
};
b7bcf7497f93 8005849: JEP 167: Event-Based JVM Tracing
sla
parents:
diff changeset
   275
30764
fec48bf5a827 8079792: GC directory structure cleanup
pliden
parents: 28940
diff changeset
   276
#endif // SHARE_VM_GC_SHARED_GCTRACE_HPP