hotspot/src/share/vm/gc/shared/gcTrace.hpp
changeset 33107 77bf0d2069a3
parent 32608 ef2ec6fac731
child 34300 6075c1e0e913
equal deleted inserted replaced
33106:20c533b9e167 33107:77bf0d2069a3
    50 class TimePartitions;
    50 class TimePartitions;
    51 class BoolObjectClosure;
    51 class BoolObjectClosure;
    52 
    52 
    53 class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
    53 class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
    54  private:
    54  private:
    55   GCId _gc_id;
       
    56   GCName _name;
    55   GCName _name;
    57   GCCause::Cause _cause;
    56   GCCause::Cause _cause;
    58   Ticks     _start_timestamp;
    57   Ticks     _start_timestamp;
    59   Ticks     _end_timestamp;
    58   Ticks     _end_timestamp;
    60   Tickspan  _sum_of_pauses;
    59   Tickspan  _sum_of_pauses;
    61   Tickspan  _longest_pause;
    60   Tickspan  _longest_pause;
    62 
    61 
    63  public:
    62  public:
    64   SharedGCInfo(GCName name) :
    63   SharedGCInfo(GCName name) :
    65     _gc_id(GCId::undefined()),
       
    66     _name(name),
    64     _name(name),
    67     _cause(GCCause::_last_gc_cause),
    65     _cause(GCCause::_last_gc_cause),
    68     _start_timestamp(),
    66     _start_timestamp(),
    69     _end_timestamp(),
    67     _end_timestamp(),
    70     _sum_of_pauses(),
    68     _sum_of_pauses(),
    71     _longest_pause() {
    69     _longest_pause() {
    72   }
    70   }
    73 
    71 
    74   void set_gc_id(GCId gc_id) { _gc_id = gc_id; }
       
    75   const GCId& gc_id() const { return _gc_id; }
       
    76 
       
    77   void set_start_timestamp(const Ticks& timestamp) { _start_timestamp = timestamp; }
    72   void set_start_timestamp(const Ticks& timestamp) { _start_timestamp = timestamp; }
    78   const Ticks start_timestamp() const { return _start_timestamp; }
    73   const Ticks start_timestamp() const { return _start_timestamp; }
    79 
    74 
    80   void set_end_timestamp(const Ticks& timestamp) { _end_timestamp = timestamp; }
    75   void set_end_timestamp(const Ticks& timestamp) { _end_timestamp = timestamp; }
    81   const Ticks end_timestamp() const { return _end_timestamp; }
    76   const Ticks end_timestamp() const { return _end_timestamp; }
   126   void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
   121   void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
   127   void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
   122   void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary) const;
   128   void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const;
   123   void report_metaspace_summary(GCWhen::Type when, const MetaspaceSummary& metaspace_summary) const;
   129   void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
   124   void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
   130   void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
   125   void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
   131   bool has_reported_gc_start() const;
       
   132   const GCId& gc_id() { return _shared_gc_info.gc_id(); }
       
   133 
   126 
   134  protected:
   127  protected:
   135   GCTracer(GCName name) : _shared_gc_info(name) {}
   128   GCTracer(GCName name) : _shared_gc_info(name) {}
   136   void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
   129   void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
   137   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
   130   virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
   240   ParNewTracer() : YoungGCTracer(ParNew) {}
   233   ParNewTracer() : YoungGCTracer(ParNew) {}
   241 };
   234 };
   242 
   235 
   243 #if INCLUDE_ALL_GCS
   236 #if INCLUDE_ALL_GCS
   244 class G1MMUTracer : public AllStatic {
   237 class G1MMUTracer : public AllStatic {
   245   static void send_g1_mmu_event(const GCId& gcId, double timeSlice, double gcTime, double maxTime);
   238   static void send_g1_mmu_event(double timeSlice, double gcTime, double maxTime);
   246 
   239 
   247  public:
   240  public:
   248   static void report_mmu(const GCId& gcId, double timeSlice, double gcTime, double maxTime);
   241   static void report_mmu(double timeSlice, double gcTime, double maxTime);
   249 };
   242 };
   250 
   243 
   251 class G1NewTracer : public YoungGCTracer {
   244 class G1NewTracer : public YoungGCTracer {
   252   G1YoungGCInfo _g1_young_gc_info;
   245   G1YoungGCInfo _g1_young_gc_info;
   253 
   246