1.1 --- a/src/share/vm/gc_implementation/shared/gcTrace.cpp Sat Nov 23 09:56:59 2013 +0100 1.2 +++ b/src/share/vm/gc_implementation/shared/gcTrace.cpp Sat Nov 23 12:25:13 2013 +0100 1.3 @@ -32,6 +32,7 @@ 1.4 #include "memory/referenceProcessorStats.hpp" 1.5 #include "runtime/os.hpp" 1.6 #include "utilities/globalDefinitions.hpp" 1.7 +#include "utilities/ticks.inline.hpp" 1.8 1.9 #if INCLUDE_ALL_GCS 1.10 #include "gc_implementation/g1/evacuationInfo.hpp" 1.11 @@ -45,7 +46,7 @@ 1.12 return GCTracer_next_gc_id++; 1.13 } 1.14 1.15 -void GCTracer::report_gc_start_impl(GCCause::Cause cause, jlong timestamp) { 1.16 +void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) { 1.17 assert_unset_gc_id(); 1.18 1.19 GCId gc_id = create_new_gc_id(); 1.20 @@ -54,7 +55,7 @@ 1.21 _shared_gc_info.set_start_timestamp(timestamp); 1.22 } 1.23 1.24 -void GCTracer::report_gc_start(GCCause::Cause cause, jlong timestamp) { 1.25 +void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) { 1.26 assert_unset_gc_id(); 1.27 1.28 report_gc_start_impl(cause, timestamp); 1.29 @@ -64,7 +65,7 @@ 1.30 return _shared_gc_info.id() != SharedGCInfo::UNSET_GCID; 1.31 } 1.32 1.33 -void GCTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) { 1.34 +void GCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) { 1.35 assert_set_gc_id(); 1.36 1.37 _shared_gc_info.set_sum_of_pauses(time_partitions->sum_of_pauses()); 1.38 @@ -75,7 +76,7 @@ 1.39 send_garbage_collection_event(); 1.40 } 1.41 1.42 -void GCTracer::report_gc_end(jlong timestamp, TimePartitions* time_partitions) { 1.43 +void GCTracer::report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions) { 1.44 assert_set_gc_id(); 1.45 1.46 report_gc_end_impl(timestamp, time_partitions); 1.47 @@ -97,10 +98,10 @@ 1.48 const GCId _gc_id; 1.49 const double _size_threshold_percentage; 1.50 const size_t _total_size_in_words; 1.51 - const jlong _timestamp; 1.52 + const Ticks _timestamp; 1.53 1.54 public: 1.55 - ObjectCountEventSenderClosure(GCId gc_id, size_t total_size_in_words, jlong timestamp) : 1.56 + ObjectCountEventSenderClosure(GCId gc_id, size_t total_size_in_words, const Ticks& timestamp) : 1.57 _gc_id(gc_id), 1.58 _size_threshold_percentage(ObjectCountCutOffPercent / 100), 1.59 _total_size_in_words(total_size_in_words), 1.60 @@ -131,9 +132,7 @@ 1.61 if (!cit.allocation_failed()) { 1.62 HeapInspection hi(false, false, false, NULL); 1.63 hi.populate_table(&cit, is_alive_cl); 1.64 - 1.65 - jlong timestamp = os::elapsed_counter(); 1.66 - ObjectCountEventSenderClosure event_sender(_shared_gc_info.id(), cit.size_of_instances_in_words(), timestamp); 1.67 + ObjectCountEventSenderClosure event_sender(_shared_gc_info.id(), cit.size_of_instances_in_words(), Ticks::now()); 1.68 cit.iterate(&event_sender); 1.69 } 1.70 } 1.71 @@ -147,7 +146,7 @@ 1.72 send_meta_space_summary_event(when, meta_space_summary); 1.73 } 1.74 1.75 -void YoungGCTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) { 1.76 +void YoungGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) { 1.77 assert_set_gc_id(); 1.78 assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported"); 1.79 1.80 @@ -167,14 +166,14 @@ 1.81 _tenuring_threshold = tenuring_threshold; 1.82 } 1.83 1.84 -void OldGCTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) { 1.85 +void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) { 1.86 assert_set_gc_id(); 1.87 1.88 GCTracer::report_gc_end_impl(timestamp, time_partitions); 1.89 send_old_gc_event(); 1.90 } 1.91 1.92 -void ParallelOldTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) { 1.93 +void ParallelOldTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) { 1.94 assert_set_gc_id(); 1.95 1.96 OldGCTracer::report_gc_end_impl(timestamp, time_partitions); 1.97 @@ -200,7 +199,7 @@ 1.98 _g1_young_gc_info.set_type(type); 1.99 } 1.100 1.101 -void G1NewTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) { 1.102 +void G1NewTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) { 1.103 assert_set_gc_id(); 1.104 1.105 YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);