1.1 --- a/src/share/vm/gc_implementation/shared/gcTrace.hpp Sat Nov 23 09:56:59 2013 +0100 1.2 +++ b/src/share/vm/gc_implementation/shared/gcTrace.hpp Sat Nov 23 12:25:13 2013 +0100 1.3 @@ -35,6 +35,7 @@ 1.4 #include "gc_implementation/g1/g1YCTypes.hpp" 1.5 #endif 1.6 #include "utilities/macros.hpp" 1.7 +#include "utilities/ticks.hpp" 1.8 1.9 typedef uint GCId; 1.10 1.11 @@ -47,8 +48,6 @@ 1.12 class BoolObjectClosure; 1.13 1.14 class SharedGCInfo VALUE_OBJ_CLASS_SPEC { 1.15 - static const jlong UNSET_TIMESTAMP = -1; 1.16 - 1.17 public: 1.18 static const GCId UNSET_GCID = (GCId)-1; 1.19 1.20 @@ -56,23 +55,30 @@ 1.21 GCId _id; 1.22 GCName _name; 1.23 GCCause::Cause _cause; 1.24 - jlong _start_timestamp; 1.25 - jlong _end_timestamp; 1.26 - jlong _sum_of_pauses; 1.27 - jlong _longest_pause; 1.28 + Ticks _start_timestamp; 1.29 + Ticks _end_timestamp; 1.30 + Tickspan _sum_of_pauses; 1.31 + Tickspan _longest_pause; 1.32 1.33 public: 1.34 - SharedGCInfo(GCName name) : _id(UNSET_GCID), _name(name), _cause(GCCause::_last_gc_cause), 1.35 - _start_timestamp(UNSET_TIMESTAMP), _end_timestamp(UNSET_TIMESTAMP), _sum_of_pauses(0), _longest_pause(0) {} 1.36 + SharedGCInfo(GCName name) : 1.37 + _id(UNSET_GCID), 1.38 + _name(name), 1.39 + _cause(GCCause::_last_gc_cause), 1.40 + _start_timestamp(), 1.41 + _end_timestamp(), 1.42 + _sum_of_pauses(), 1.43 + _longest_pause() { 1.44 + } 1.45 1.46 void set_id(GCId id) { _id = id; } 1.47 GCId id() const { return _id; } 1.48 1.49 - void set_start_timestamp(jlong timestamp) { _start_timestamp = timestamp; } 1.50 - jlong start_timestamp() const { return _start_timestamp; } 1.51 + void set_start_timestamp(const Ticks& timestamp) { _start_timestamp = timestamp; } 1.52 + const Ticks start_timestamp() const { return _start_timestamp; } 1.53 1.54 - void set_end_timestamp(jlong timestamp) { _end_timestamp = timestamp; } 1.55 - jlong end_timestamp() const { return _end_timestamp; } 1.56 + void set_end_timestamp(const Ticks& timestamp) { _end_timestamp = timestamp; } 1.57 + const Ticks end_timestamp() const { return _end_timestamp; } 1.58 1.59 void set_name(GCName name) { _name = name; } 1.60 GCName name() const { return _name; } 1.61 @@ -80,11 +86,11 @@ 1.62 void set_cause(GCCause::Cause cause) { _cause = cause; } 1.63 GCCause::Cause cause() const { return _cause; } 1.64 1.65 - void set_sum_of_pauses(jlong duration) { _sum_of_pauses = duration; } 1.66 - jlong sum_of_pauses() const { return _sum_of_pauses; } 1.67 + void set_sum_of_pauses(const Tickspan& duration) { _sum_of_pauses = duration; } 1.68 + const Tickspan sum_of_pauses() const { return _sum_of_pauses; } 1.69 1.70 - void set_longest_pause(jlong duration) { _longest_pause = duration; } 1.71 - jlong longest_pause() const { return _longest_pause; } 1.72 + void set_longest_pause(const Tickspan& duration) { _longest_pause = duration; } 1.73 + const Tickspan longest_pause() const { return _longest_pause; } 1.74 }; 1.75 1.76 class ParallelOldGCInfo VALUE_OBJ_CLASS_SPEC { 1.77 @@ -116,8 +122,8 @@ 1.78 SharedGCInfo _shared_gc_info; 1.79 1.80 public: 1.81 - void report_gc_start(GCCause::Cause cause, jlong timestamp); 1.82 - void report_gc_end(jlong timestamp, TimePartitions* time_partitions); 1.83 + void report_gc_start(GCCause::Cause cause, const Ticks& timestamp); 1.84 + void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions); 1.85 void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary, const MetaspaceSummary& meta_space_summary) const; 1.86 void report_gc_reference_stats(const ReferenceProcessorStats& rp) const; 1.87 void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN; 1.88 @@ -125,8 +131,8 @@ 1.89 1.90 protected: 1.91 GCTracer(GCName name) : _shared_gc_info(name) {} 1.92 - virtual void report_gc_start_impl(GCCause::Cause cause, jlong timestamp); 1.93 - virtual void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions); 1.94 + virtual void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp); 1.95 + virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); 1.96 1.97 private: 1.98 void send_garbage_collection_event() const; 1.99 @@ -143,7 +149,7 @@ 1.100 1.101 protected: 1.102 YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {} 1.103 - virtual void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions); 1.104 + virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); 1.105 1.106 public: 1.107 void report_promotion_failed(const PromotionFailedInfo& pf_info); 1.108 @@ -157,7 +163,7 @@ 1.109 class OldGCTracer : public GCTracer { 1.110 protected: 1.111 OldGCTracer(GCName name) : GCTracer(name) {} 1.112 - virtual void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions); 1.113 + virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); 1.114 1.115 public: 1.116 void report_concurrent_mode_failure(); 1.117 @@ -175,7 +181,7 @@ 1.118 void report_dense_prefix(void* dense_prefix); 1.119 1.120 protected: 1.121 - void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions); 1.122 + void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); 1.123 1.124 private: 1.125 void send_parallel_old_event() const; 1.126 @@ -209,7 +215,7 @@ 1.127 G1NewTracer() : YoungGCTracer(G1New) {} 1.128 1.129 void report_yc_type(G1YCType type); 1.130 - void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions); 1.131 + void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions); 1.132 void report_evacuation_info(EvacuationInfo* info); 1.133 void report_evacuation_failed(EvacuationFailedInfo& ef_info); 1.134