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

8205516: JFR tool

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