< prev index next >

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

Print this page
rev 8910 : full patch for jfr
   1 /*
   2  * Copyright (c) 2012, 2013, 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  *


 140   void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
 141   void send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const;
 142   void send_metaspace_chunk_free_list_summary(GCWhen::Type when, Metaspace::MetadataType mdtype, const MetaspaceChunkFreeListSummary& summary) const;
 143   void send_reference_stats_event(ReferenceType type, size_t count) const;
 144   void send_phase_events(TimePartitions* time_partitions) const;
 145 };
 146 
 147 class YoungGCTracer : public GCTracer {
 148   static const uint UNSET_TENURING_THRESHOLD = (uint) -1;
 149 
 150   uint _tenuring_threshold;
 151 
 152  protected:
 153   YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {}
 154   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 155 
 156  public:
 157   void report_promotion_failed(const PromotionFailedInfo& pf_info);
 158   void report_tenuring_threshold(const uint tenuring_threshold);
 159 























 160  private:
 161   void send_young_gc_event() const;
 162   void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;







 163 };
 164 
 165 class OldGCTracer : public GCTracer {
 166  protected:
 167   OldGCTracer(GCName name) : GCTracer(name) {}
 168   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 169 
 170  public:
 171   void report_concurrent_mode_failure();
 172 
 173  private:
 174   void send_old_gc_event() const;
 175   void send_concurrent_mode_failure_event();
 176 };
 177 
 178 class ParallelOldTracer : public OldGCTracer {
 179   ParallelOldGCInfo _parallel_old_gc_info;
 180 
 181  public:
 182   ParallelOldTracer() : OldGCTracer(ParallelOld) {}


 193  public:
 194   SerialOldTracer() : OldGCTracer(SerialOld) {}
 195 };
 196 
 197 class ParallelScavengeTracer : public YoungGCTracer {
 198  public:
 199   ParallelScavengeTracer() : YoungGCTracer(ParallelScavenge) {}
 200 };
 201 
 202 class DefNewTracer : public YoungGCTracer {
 203  public:
 204   DefNewTracer() : YoungGCTracer(DefNew) {}
 205 };
 206 
 207 class ParNewTracer : public YoungGCTracer {
 208  public:
 209   ParNewTracer() : YoungGCTracer(ParNew) {}
 210 };
 211 
 212 #if INCLUDE_ALL_GCS







 213 class G1NewTracer : public YoungGCTracer {
 214   G1YoungGCInfo _g1_young_gc_info;
 215 
 216  public:
 217   G1NewTracer() : YoungGCTracer(G1New) {}
 218 
 219   void report_yc_type(G1YCType type);
 220   void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 221   void report_evacuation_info(EvacuationInfo* info);
 222   void report_evacuation_failed(EvacuationFailedInfo& ef_info);
 223 







 224  private:
 225   void send_g1_young_gc_event();
 226   void send_evacuation_info_event(EvacuationInfo* info);
 227   void send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const;








 228 };
 229 #endif
 230 
 231 class CMSTracer : public OldGCTracer {
 232  public:
 233   CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {}
 234 };
 235 
 236 class G1OldTracer : public OldGCTracer {
 237  public:
 238   G1OldTracer() : OldGCTracer(G1Old) {}
 239 };
 240 
 241 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP
   1 /*
   2  * Copyright (c) 2012, 2019, 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  *


 140   void send_gc_heap_summary_event(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
 141   void send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const;
 142   void send_metaspace_chunk_free_list_summary(GCWhen::Type when, Metaspace::MetadataType mdtype, const MetaspaceChunkFreeListSummary& summary) const;
 143   void send_reference_stats_event(ReferenceType type, size_t count) const;
 144   void send_phase_events(TimePartitions* time_partitions) const;
 145 };
 146 
 147 class YoungGCTracer : public GCTracer {
 148   static const uint UNSET_TENURING_THRESHOLD = (uint) -1;
 149 
 150   uint _tenuring_threshold;
 151 
 152  protected:
 153   YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {}
 154   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 155 
 156  public:
 157   void report_promotion_failed(const PromotionFailedInfo& pf_info);
 158   void report_tenuring_threshold(const uint tenuring_threshold);
 159 
 160   /*
 161    * Methods for reporting Promotion in new or outside PLAB Events.
 162    *
 163    * The object age is always required as it is not certain that the mark word
 164    * of the oop can be trusted at this stage.
 165    *
 166    * obj_size is the size of the promoted object in bytes.
 167    *
 168    * tenured should be true if the object has been promoted to the old
 169    * space during this GC, if the object is copied to survivor space
 170    * from young space or survivor space (aging) tenured should be false.
 171    *
 172    * plab_size is the size of the newly allocated PLAB in bytes.
 173    */
 174   bool should_report_promotion_events() const;
 175   bool should_report_promotion_in_new_plab_event() const;
 176   bool should_report_promotion_outside_plab_event() const;
 177   void report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
 178                                           uint age, bool tenured,
 179                                           size_t plab_size) const;
 180   void report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
 181                                            uint age, bool tenured) const;
 182 
 183  private:
 184   void send_young_gc_event() const;
 185   void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;
 186   bool should_send_promotion_in_new_plab_event() const;
 187   bool should_send_promotion_outside_plab_event() const;
 188   void send_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
 189                                         uint age, bool tenured,
 190                                         size_t plab_size) const;
 191   void send_promotion_outside_plab_event(Klass* klass, size_t obj_size,
 192                                          uint age, bool tenured) const;
 193 };
 194 
 195 class OldGCTracer : public GCTracer {
 196  protected:
 197   OldGCTracer(GCName name) : GCTracer(name) {}
 198   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 199 
 200  public:
 201   void report_concurrent_mode_failure();
 202 
 203  private:
 204   void send_old_gc_event() const;
 205   void send_concurrent_mode_failure_event();
 206 };
 207 
 208 class ParallelOldTracer : public OldGCTracer {
 209   ParallelOldGCInfo _parallel_old_gc_info;
 210 
 211  public:
 212   ParallelOldTracer() : OldGCTracer(ParallelOld) {}


 223  public:
 224   SerialOldTracer() : OldGCTracer(SerialOld) {}
 225 };
 226 
 227 class ParallelScavengeTracer : public YoungGCTracer {
 228  public:
 229   ParallelScavengeTracer() : YoungGCTracer(ParallelScavenge) {}
 230 };
 231 
 232 class DefNewTracer : public YoungGCTracer {
 233  public:
 234   DefNewTracer() : YoungGCTracer(DefNew) {}
 235 };
 236 
 237 class ParNewTracer : public YoungGCTracer {
 238  public:
 239   ParNewTracer() : YoungGCTracer(ParNew) {}
 240 };
 241 
 242 #if INCLUDE_ALL_GCS
 243 class G1MMUTracer : public AllStatic {
 244   static void send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms, bool gc_thread);
 245 
 246  public:
 247   static void report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec, bool gc_thread);
 248 };
 249 
 250 class G1NewTracer : public YoungGCTracer {
 251   G1YoungGCInfo _g1_young_gc_info;
 252 
 253  public:
 254   G1NewTracer() : YoungGCTracer(G1New) {}
 255 
 256   void report_yc_type(G1YCType type);
 257   void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
 258   void report_evacuation_info(EvacuationInfo* info);
 259   void report_evacuation_failed(EvacuationFailedInfo& ef_info);
 260 
 261   void report_basic_ihop_statistics(size_t threshold,
 262                                     size_t target_occupancy,
 263                                     size_t current_occupancy,
 264                                     size_t last_allocation_size,
 265                                     double last_allocation_duration,
 266                                     double last_marking_length);
 267 
 268  private:
 269   void send_g1_young_gc_event();
 270   void send_evacuation_info_event(EvacuationInfo* info);
 271   void send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const;
 272 
 273   void send_basic_ihop_statistics(size_t threshold,
 274                                   size_t target_occupancy,
 275                                   size_t current_occupancy,
 276                                   size_t last_allocation_size,
 277                                   double last_allocation_duration,
 278                                   double last_marking_length);
 279 
 280 };
 281 #endif
 282 
 283 class CMSTracer : public OldGCTracer {
 284  public:
 285   CMSTracer() : OldGCTracer(ConcurrentMarkSweep) {}
 286 };
 287 
 288 class G1OldTracer : public OldGCTracer {
 289  public:
 290   G1OldTracer() : OldGCTracer(G1Old) {}
 291 };
 292 
 293 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACE_HPP
< prev index next >