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

changeset 5388
6aa440bc1125
parent 5387
63cffb381adc
child 6131
86e6d691f2e1
     1.1 --- a/src/share/vm/gc_implementation/shared/gcTrace.cpp	Wed Jun 12 15:50:14 2013 +0200
     1.2 +++ b/src/share/vm/gc_implementation/shared/gcTrace.cpp	Wed Jun 12 15:21:41 2013 +0200
     1.3 @@ -30,6 +30,7 @@
     1.4  #include "gc_implementation/shared/objectCountEventSender.hpp"
     1.5  #include "memory/heapInspection.hpp"
     1.6  #include "memory/referenceProcessorStats.hpp"
     1.7 +#include "runtime/os.hpp"
     1.8  #include "utilities/globalDefinitions.hpp"
     1.9  
    1.10  #if INCLUDE_ALL_GCS
    1.11 @@ -96,17 +97,19 @@
    1.12    const GCId _gc_id;
    1.13    const double _size_threshold_percentage;
    1.14    const size_t _total_size_in_words;
    1.15 +  const jlong _timestamp;
    1.16  
    1.17   public:
    1.18 -  ObjectCountEventSenderClosure(GCId gc_id, size_t total_size_in_words) :
    1.19 +  ObjectCountEventSenderClosure(GCId gc_id, size_t total_size_in_words, jlong timestamp) :
    1.20      _gc_id(gc_id),
    1.21      _size_threshold_percentage(ObjectCountCutOffPercent / 100),
    1.22 -    _total_size_in_words(total_size_in_words)
    1.23 +    _total_size_in_words(total_size_in_words),
    1.24 +    _timestamp(timestamp)
    1.25    {}
    1.26  
    1.27    virtual void do_cinfo(KlassInfoEntry* entry) {
    1.28      if (should_send_event(entry)) {
    1.29 -      ObjectCountEventSender::send(entry, _gc_id);
    1.30 +      ObjectCountEventSender::send(entry, _gc_id, _timestamp);
    1.31      }
    1.32    }
    1.33  
    1.34 @@ -129,7 +132,8 @@
    1.35        HeapInspection hi(false, false, false, NULL);
    1.36        hi.populate_table(&cit, is_alive_cl);
    1.37  
    1.38 -      ObjectCountEventSenderClosure event_sender(_shared_gc_info.id(), cit.size_of_instances_in_words());
    1.39 +      jlong timestamp = os::elapsed_counter();
    1.40 +      ObjectCountEventSenderClosure event_sender(_shared_gc_info.id(), cit.size_of_instances_in_words(), timestamp);
    1.41        cit.iterate(&event_sender);
    1.42      }
    1.43    }

mercurial