提交 9892e0a8 编写于 作者: E egahlin

8205516: JFR tool

Reviewed-by: mgronlun
上级 ca4e51bc
...@@ -157,12 +157,14 @@ int EmitEventOperation::write_events(EdgeStore* edge_store) { ...@@ -157,12 +157,14 @@ int EmitEventOperation::write_events(EdgeStore* edge_store) {
const jlong last_sweep = _emit_all ? max_jlong : _object_sampler->last_sweep().value(); const jlong last_sweep = _emit_all ? max_jlong : _object_sampler->last_sweep().value();
int count = 0; int count = 0;
for (int i = 0; i < _object_sampler->item_count(); ++i) { const ObjectSample* current = _object_sampler->first();
const ObjectSample* sample = _object_sampler->item_at(i); while (current != NULL) {
if (sample->is_alive_and_older_than(last_sweep)) { ObjectSample* prev = current->prev();
write_event(sample, edge_store); if (current->is_alive_and_older_than(last_sweep)) {
write_event(current, edge_store);
++count; ++count;
} }
current = prev;
} }
// restore thread local stack trace and thread id // restore thread local stack trace and thread id
......
...@@ -121,6 +121,10 @@ const ObjectSample* ObjectSampler::last() const { ...@@ -121,6 +121,10 @@ const ObjectSample* ObjectSampler::last() const {
return _list->last(); return _list->last();
} }
const ObjectSample* ObjectSampler::first() const {
return _list->first();
}
const ObjectSample* ObjectSampler::last_resolved() const { const ObjectSample* ObjectSampler::last_resolved() const {
return _list->last_resolved(); return _list->last_resolved();
} }
......
...@@ -69,6 +69,7 @@ class ObjectSampler : public CHeapObj<mtTracing> { ...@@ -69,6 +69,7 @@ class ObjectSampler : public CHeapObj<mtTracing> {
const ObjectSample* item_at(int index) const; const ObjectSample* item_at(int index) const;
ObjectSample* item_at(int index); ObjectSample* item_at(int index);
int item_count() const; int item_count() const;
const ObjectSample* first() const;
const ObjectSample* last() const; const ObjectSample* last() const;
const ObjectSample* last_resolved() const; const ObjectSample* last_resolved() const;
void set_last_resolved(const ObjectSample* sample); void set_last_resolved(const ObjectSample* sample);
......
...@@ -45,6 +45,10 @@ ObjectSample* SampleList::last() const { ...@@ -45,6 +45,10 @@ ObjectSample* SampleList::last() const {
return _in_use_list.head(); return _in_use_list.head();
} }
ObjectSample* SampleList::first() const {
return _in_use_list.tail();
}
const ObjectSample* SampleList::last_resolved() const { const ObjectSample* SampleList::last_resolved() const {
return _last_resolved; return _last_resolved;
} }
......
...@@ -53,6 +53,7 @@ class SampleList : public JfrCHeapObj { ...@@ -53,6 +53,7 @@ class SampleList : public JfrCHeapObj {
void set_last_resolved(const ObjectSample* sample); void set_last_resolved(const ObjectSample* sample);
ObjectSample* get(); ObjectSample* get();
ObjectSample* last() const; ObjectSample* last() const;
ObjectSample* first() const;
void release(ObjectSample* sample); void release(ObjectSample* sample);
const ObjectSample* last_resolved() const; const ObjectSample* last_resolved() const;
ObjectSample* reuse(ObjectSample* sample); ObjectSample* reuse(ObjectSample* sample);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册