src/share/vm/gc_implementation/shared/gcTrace.hpp

Thu, 13 Feb 2014 17:44:39 +0100

author
stefank
date
Thu, 13 Feb 2014 17:44:39 +0100
changeset 6971
7426d8d76305
parent 6904
0982ec23da03
child 7535
7ae4e26cb1e0
child 9858
b985cbb00e68
permissions
-rw-r--r--

8034761: Remove the do_code_roots parameter from process_strong_roots
Reviewed-by: tschatzl, mgerdin, jmasa

sla@5237 1 /*
sla@5237 2 * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
sla@5237 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
sla@5237 4 *
sla@5237 5 * This code is free software; you can redistribute it and/or modify it
sla@5237 6 * under the terms of the GNU General Public License version 2 only, as
sla@5237 7 * published by the Free Software Foundation.
sla@5237 8 *
sla@5237 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sla@5237 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sla@5237 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sla@5237 12 * version 2 for more details (a copy is included in the LICENSE file that
sla@5237 13 * accompanied this code).
sla@5237 14 *
sla@5237 15 * You should have received a copy of the GNU General Public License version
sla@5237 16 * 2 along with this work; if not, write to the Free Software Foundation,
sla@5237 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
sla@5237 18 *
sla@5237 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sla@5237 20 * or visit www.oracle.com if you need additional information or have any
sla@5237 21 * questions.
sla@5237 22 *
sla@5237 23 */
sla@5237 24
sla@5237 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP
sla@5237 26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP
sla@5237 27
sla@5237 28 #include "gc_interface/gcCause.hpp"
sla@5237 29 #include "gc_interface/gcName.hpp"
brutisso@6904 30 #include "gc_implementation/shared/gcId.hpp"
sla@5237 31 #include "gc_implementation/shared/gcWhen.hpp"
sla@5237 32 #include "gc_implementation/shared/copyFailedInfo.hpp"
sla@5237 33 #include "memory/allocation.hpp"
ehelin@6420 34 #include "memory/metaspace.hpp"
sla@5237 35 #include "memory/referenceType.hpp"
sla@5237 36 #if INCLUDE_ALL_GCS
sla@5237 37 #include "gc_implementation/g1/g1YCTypes.hpp"
sla@5237 38 #endif
sla@5237 39 #include "utilities/macros.hpp"
mgronlun@6131 40 #include "utilities/ticks.hpp"
sla@5237 41
sla@5237 42
sla@5237 43 class EvacuationInfo;
sla@5237 44 class GCHeapSummary;
ehelin@6420 45 class MetaspaceChunkFreeListSummary;
sla@5237 46 class MetaspaceSummary;
sla@5237 47 class PSHeapSummary;
sla@5237 48 class ReferenceProcessorStats;
sla@5237 49 class TimePartitions;
sla@5237 50 class BoolObjectClosure;
sla@5237 51
sla@5237 52 class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
sla@5237 53 private:
brutisso@6904 54 GCId _gc_id;
sla@5237 55 GCName _name;
sla@5237 56 GCCause::Cause _cause;
mgronlun@6131 57 Ticks _start_timestamp;
mgronlun@6131 58 Ticks _end_timestamp;
mgronlun@6131 59 Tickspan _sum_of_pauses;
mgronlun@6131 60 Tickspan _longest_pause;
sla@5237 61
sla@5237 62 public:
mgronlun@6131 63 SharedGCInfo(GCName name) :
brutisso@6904 64 _gc_id(GCId::undefined()),
mgronlun@6131 65 _name(name),
mgronlun@6131 66 _cause(GCCause::_last_gc_cause),
mgronlun@6131 67 _start_timestamp(),
mgronlun@6131 68 _end_timestamp(),
mgronlun@6131 69 _sum_of_pauses(),
mgronlun@6131 70 _longest_pause() {
mgronlun@6131 71 }
sla@5237 72
brutisso@6904 73 void set_gc_id(GCId gc_id) { _gc_id = gc_id; }
brutisso@6904 74 const GCId& gc_id() const { return _gc_id; }
sla@5237 75
mgronlun@6131 76 void set_start_timestamp(const Ticks& timestamp) { _start_timestamp = timestamp; }
mgronlun@6131 77 const Ticks start_timestamp() const { return _start_timestamp; }
sla@5237 78
mgronlun@6131 79 void set_end_timestamp(const Ticks& timestamp) { _end_timestamp = timestamp; }
mgronlun@6131 80 const Ticks end_timestamp() const { return _end_timestamp; }
sla@5237 81
sla@5237 82 void set_name(GCName name) { _name = name; }
sla@5237 83 GCName name() const { return _name; }
sla@5237 84
sla@5237 85 void set_cause(GCCause::Cause cause) { _cause = cause; }
sla@5237 86 GCCause::Cause cause() const { return _cause; }
sla@5237 87
mgronlun@6131 88 void set_sum_of_pauses(const Tickspan& duration) { _sum_of_pauses = duration; }
mgronlun@6131 89 const Tickspan sum_of_pauses() const { return _sum_of_pauses; }
sla@5237 90
mgronlun@6131 91 void set_longest_pause(const Tickspan& duration) { _longest_pause = duration; }
mgronlun@6131 92 const Tickspan longest_pause() const { return _longest_pause; }
sla@5237 93 };
sla@5237 94
sla@5237 95 class ParallelOldGCInfo VALUE_OBJ_CLASS_SPEC {
sla@5237 96 void* _dense_prefix;
sla@5237 97 public:
sla@5237 98 ParallelOldGCInfo() : _dense_prefix(NULL) {}
sla@5237 99 void report_dense_prefix(void* addr) {
sla@5237 100 _dense_prefix = addr;
sla@5237 101 }
sla@5237 102 void* dense_prefix() const { return _dense_prefix; }
sla@5237 103 };
sla@5237 104
sla@5237 105 #if INCLUDE_ALL_GCS
sla@5237 106
sla@5237 107 class G1YoungGCInfo VALUE_OBJ_CLASS_SPEC {
sla@5237 108 G1YCType _type;
sla@5237 109 public:
sla@5237 110 G1YoungGCInfo() : _type(G1YCTypeEndSentinel) {}
sla@5237 111 void set_type(G1YCType type) {
sla@5237 112 _type = type;
sla@5237 113 }
sla@5237 114 G1YCType type() const { return _type; }
sla@5237 115 };
sla@5237 116
sla@5237 117 #endif // INCLUDE_ALL_GCS
sla@5237 118
sla@5237 119 class GCTracer : public ResourceObj {
sla@5237 120 protected:
sla@5237 121 SharedGCInfo _shared_gc_info;
sla@5237 122
sla@5237 123 public:
mgronlun@6131 124 void report_gc_start(GCCause::Cause cause, const Ticks& timestamp);
mgronlun@6131 125 void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
ehelin@6420 126 void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
ehelin@6420 127 void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const;
sla@5237 128 void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
sla@5237 129 void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
sla@5237 130 bool has_reported_gc_start() const;
brutisso@6904 131 const GCId& gc_id() { return _shared_gc_info.gc_id(); }
sla@5237 132
sla@5237 133 protected:
sla@5237 134 GCTracer(GCName name) : _shared_gc_info(name) {}
brutisso@6904 135 void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
mgronlun@6131 136 virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
sla@5237 137
sla@5237 138 private:
sla@5237 139 void send_garbage_collection_event() const;
sla@5237 140 void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
sla@5237 141 void send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const;
ehelin@6420 142 void send_metaspace_chunk_free_list_summary(GCWhen::Type when, Metaspace::MetadataType mdtype, const MetaspaceChunkFreeListSummary& summary) const;
sla@5237 143 void send_reference_stats_event(ReferenceType type, size_t count) const;
sla@5237 144 void send_phase_events(TimePartitions* time_partitions) const;
sla@5237 145 };
sla@5237 146
sla@5237 147 class YoungGCTracer : public GCTracer {
sla@5237 148 static const uint UNSET_TENURING_THRESHOLD = (uint) -1;
sla@5237 149
sla@5237 150 uint _tenuring_threshold;
sla@5237 151
sla@5237 152 protected:
sla@5237 153 YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {}
mgronlun@6131 154 virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
sla@5237 155
sla@5237 156 public:
sla@5237 157 void report_promotion_failed(const PromotionFailedInfo& pf_info);
sla@5237 158 void report_tenuring_threshold(const uint tenuring_threshold);
sla@5237 159
sla@5237 160 private:
sla@5237 161 void send_young_gc_event() const;
sla@5237 162 void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;
sla@5237 163 };
sla@5237 164
sla@5237 165 class OldGCTracer : public GCTracer {
sla@5237 166 protected:
sla@5237 167 OldGCTracer(GCName name) : GCTracer(name) {}
mgronlun@6131 168 virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
sla@5237 169
sla@5237 170 public:
sla@5237 171 void report_concurrent_mode_failure();
sla@5237 172
sla@5237 173 private:
sla@5237 174 void send_old_gc_event() const;
sla@5237 175 void send_concurrent_mode_failure_event();
sla@5237 176 };
sla@5237 177
sla@5237 178 class ParallelOldTracer : public OldGCTracer {
sla@5237 179 ParallelOldGCInfo _parallel_old_gc_info;
sla@5237 180
sla@5237 181 public:
sla@5237 182 ParallelOldTracer() : OldGCTracer(ParallelOld) {}
sla@5237 183 void report_dense_prefix(void* dense_prefix);
sla@5237 184
sla@5237 185 protected:
mgronlun@6131 186 void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
sla@5237 187
sla@5237 188 private:
sla@5237 189 void send_parallel_old_event() const;
sla@5237 190 };
sla@5237 191
sla@5237 192 class SerialOldTracer : public OldGCTracer {
sla@5237 193 public:
sla@5237 194 SerialOldTracer() : OldGCTracer(SerialOld) {}
sla@5237 195 };
sla@5237 196
sla@5237 197 class ParallelScavengeTracer : public YoungGCTracer {
sla@5237 198 public:
sla@5237 199 ParallelScavengeTracer() : YoungGCTracer(ParallelScavenge) {}
sla@5237 200 };
sla@5237 201
sla@5237 202 class DefNewTracer : public YoungGCTracer {
sla@5237 203 public:
sla@5237 204 DefNewTracer() : YoungGCTracer(DefNew) {}
sla@5237 205 };
sla@5237 206
sla@5237 207 class ParNewTracer : public YoungGCTracer {
sla@5237 208 public:
sla@5237 209 ParNewTracer() : YoungGCTracer(ParNew) {}
sla@5237 210 };
sla@5237 211
sla@5237 212 #if INCLUDE_ALL_GCS
sla@5237 213 class G1NewTracer : public YoungGCTracer {
sla@5237 214 G1YoungGCInfo _g1_young_gc_info;
sla@5237 215
sla@5237 216 public:
sla@5237 217 G1NewTracer() : YoungGCTracer(G1New) {}
sla@5237 218
sla@5237 219 void report_yc_type(G1YCType type);
mgronlun@6131 220 void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
sla@5237 221 void report_evacuation_info(EvacuationInfo* info);
sla@5237 222 void report_evacuation_failed(EvacuationFailedInfo& ef_info);
sla@5237 223
sla@5237 224 private:
sla@5237 225 void send_g1_young_gc_event();
sla@5237 226 void send_evacuation_info_event(EvacuationInfo* info);
sla@5237 227 void send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const;
sla@5237 228 };
sla@5237 229 #endif
sla@5237 230
sla@5237 231 class CMSTracer : public OldGCTracer {
sla@5237 232 public:
sla@5237 233 CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {}
sla@5237 234 };
sla@5237 235
sla@5237 236 class G1OldTracer : public OldGCTracer {
sla@5237 237 public:
sla@5237 238 G1OldTracer() : OldGCTracer(G1Old) {}
sla@5237 239 };
sla@5237 240
sla@5237 241 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP

mercurial