8205516: JFR tool

Wed, 05 Dec 2018 16:40:12 +0100

author
egahlin
date
Wed, 05 Dec 2018 16:40:12 +0100
changeset 9867
150ab470bf7f
parent 9866
41515291559a
child 9868
69fb91513217

8205516: JFR tool
Reviewed-by: mgronlun

src/share/vm/jfr/leakprofiler/emitEventOperation.cpp file | annotate | diff | comparison | revisions
src/share/vm/jfr/leakprofiler/sampling/objectSampler.cpp file | annotate | diff | comparison | revisions
src/share/vm/jfr/leakprofiler/sampling/objectSampler.hpp file | annotate | diff | comparison | revisions
src/share/vm/jfr/leakprofiler/sampling/sampleList.cpp file | annotate | diff | comparison | revisions
src/share/vm/jfr/leakprofiler/sampling/sampleList.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/jfr/leakprofiler/emitEventOperation.cpp	Tue Aug 28 10:10:11 2018 -0400
     1.2 +++ b/src/share/vm/jfr/leakprofiler/emitEventOperation.cpp	Wed Dec 05 16:40:12 2018 +0100
     1.3 @@ -157,12 +157,14 @@
     1.4    const jlong last_sweep = _emit_all ? max_jlong : _object_sampler->last_sweep().value();
     1.5    int count = 0;
     1.6  
     1.7 -  for (int i = 0; i < _object_sampler->item_count(); ++i) {
     1.8 -    const ObjectSample* sample = _object_sampler->item_at(i);
     1.9 -    if (sample->is_alive_and_older_than(last_sweep)) {
    1.10 -      write_event(sample, edge_store);
    1.11 +  const ObjectSample* current = _object_sampler->first();
    1.12 +  while (current != NULL) {
    1.13 +    ObjectSample* prev = current->prev();
    1.14 +    if (current->is_alive_and_older_than(last_sweep)) {
    1.15 +      write_event(current, edge_store);
    1.16        ++count;
    1.17      }
    1.18 +    current = prev;
    1.19    }
    1.20  
    1.21    // restore thread local stack trace and thread id
     2.1 --- a/src/share/vm/jfr/leakprofiler/sampling/objectSampler.cpp	Tue Aug 28 10:10:11 2018 -0400
     2.2 +++ b/src/share/vm/jfr/leakprofiler/sampling/objectSampler.cpp	Wed Dec 05 16:40:12 2018 +0100
     2.3 @@ -121,6 +121,10 @@
     2.4    return _list->last();
     2.5  }
     2.6  
     2.7 +const ObjectSample* ObjectSampler::first() const {
     2.8 +  return _list->first();
     2.9 +}
    2.10 +
    2.11  const ObjectSample* ObjectSampler::last_resolved() const {
    2.12    return _list->last_resolved();
    2.13  }
     3.1 --- a/src/share/vm/jfr/leakprofiler/sampling/objectSampler.hpp	Tue Aug 28 10:10:11 2018 -0400
     3.2 +++ b/src/share/vm/jfr/leakprofiler/sampling/objectSampler.hpp	Wed Dec 05 16:40:12 2018 +0100
     3.3 @@ -69,6 +69,7 @@
     3.4    const ObjectSample* item_at(int index) const;
     3.5    ObjectSample* item_at(int index);
     3.6    int item_count() const;
     3.7 +  const ObjectSample* first() const;
     3.8    const ObjectSample* last() const;
     3.9    const ObjectSample* last_resolved() const;
    3.10    void set_last_resolved(const ObjectSample* sample);
     4.1 --- a/src/share/vm/jfr/leakprofiler/sampling/sampleList.cpp	Tue Aug 28 10:10:11 2018 -0400
     4.2 +++ b/src/share/vm/jfr/leakprofiler/sampling/sampleList.cpp	Wed Dec 05 16:40:12 2018 +0100
     4.3 @@ -45,6 +45,10 @@
     4.4    return _in_use_list.head();
     4.5  }
     4.6  
     4.7 +ObjectSample* SampleList::first() const {
     4.8 +  return _in_use_list.tail();
     4.9 +}
    4.10 +
    4.11  const ObjectSample* SampleList::last_resolved() const {
    4.12    return _last_resolved;
    4.13  }
     5.1 --- a/src/share/vm/jfr/leakprofiler/sampling/sampleList.hpp	Tue Aug 28 10:10:11 2018 -0400
     5.2 +++ b/src/share/vm/jfr/leakprofiler/sampling/sampleList.hpp	Wed Dec 05 16:40:12 2018 +0100
     5.3 @@ -53,6 +53,7 @@
     5.4    void set_last_resolved(const ObjectSample* sample);
     5.5    ObjectSample* get();
     5.6    ObjectSample* last() const;
     5.7 +  ObjectSample* first() const;
     5.8    void release(ObjectSample* sample);
     5.9    const ObjectSample* last_resolved() const;
    5.10    ObjectSample* reuse(ObjectSample* sample);

mercurial