mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8066441: Add PLAB trace event
Reviewed-by: tschatzl, ehelin, egahlin
This commit is contained in:
parent
5c41d82d78
commit
4b3a02ee0b
4 changed files with 110 additions and 0 deletions
|
@ -172,6 +172,27 @@ void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
|
||||||
_tenuring_threshold = tenuring_threshold;
|
_tenuring_threshold = tenuring_threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool YoungGCTracer::should_report_promotion_in_new_plab_event() const {
|
||||||
|
return should_send_promotion_in_new_plab_event();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool YoungGCTracer::should_report_promotion_outside_plab_event() const {
|
||||||
|
return should_send_promotion_outside_plab_event();
|
||||||
|
}
|
||||||
|
|
||||||
|
void YoungGCTracer::report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
uint age, bool tenured,
|
||||||
|
size_t plab_size) const {
|
||||||
|
assert_set_gc_id();
|
||||||
|
send_promotion_in_new_plab_event(klass, obj_size, age, tenured, plab_size);
|
||||||
|
}
|
||||||
|
|
||||||
|
void YoungGCTracer::report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
uint age, bool tenured) const {
|
||||||
|
assert_set_gc_id();
|
||||||
|
send_promotion_outside_plab_event(klass, obj_size, age, tenured);
|
||||||
|
}
|
||||||
|
|
||||||
void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
|
void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
|
||||||
assert_set_gc_id();
|
assert_set_gc_id();
|
||||||
|
|
||||||
|
|
|
@ -156,9 +156,38 @@ class YoungGCTracer : public GCTracer {
|
||||||
void report_promotion_failed(const PromotionFailedInfo& pf_info);
|
void report_promotion_failed(const PromotionFailedInfo& pf_info);
|
||||||
void report_tenuring_threshold(const uint tenuring_threshold);
|
void report_tenuring_threshold(const uint tenuring_threshold);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Methods for reporting Promotion in new or outside PLAB Events.
|
||||||
|
*
|
||||||
|
* The object age is always required as it is not certain that the mark word
|
||||||
|
* of the oop can be trusted at this stage.
|
||||||
|
*
|
||||||
|
* obj_size is the size of the promoted object in bytes.
|
||||||
|
*
|
||||||
|
* tenured should be true if the object has been promoted to the old
|
||||||
|
* space during this GC, if the object is copied to survivor space
|
||||||
|
* from young space or survivor space (aging) tenured should be false.
|
||||||
|
*
|
||||||
|
* plab_size is the size of the newly allocated PLAB in bytes.
|
||||||
|
*/
|
||||||
|
bool should_report_promotion_in_new_plab_event() const;
|
||||||
|
bool should_report_promotion_outside_plab_event() const;
|
||||||
|
void report_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
uint age, bool tenured,
|
||||||
|
size_t plab_size) const;
|
||||||
|
void report_promotion_outside_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
uint age, bool tenured) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void send_young_gc_event() const;
|
void send_young_gc_event() const;
|
||||||
void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;
|
void send_promotion_failed_event(const PromotionFailedInfo& pf_info) const;
|
||||||
|
bool should_send_promotion_in_new_plab_event() const;
|
||||||
|
bool should_send_promotion_outside_plab_event() const;
|
||||||
|
void send_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
uint age, bool tenured,
|
||||||
|
size_t plab_size) const;
|
||||||
|
void send_promotion_outside_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
uint age, bool tenured) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OldGCTracer : public GCTracer {
|
class OldGCTracer : public GCTracer {
|
||||||
|
|
|
@ -111,6 +111,44 @@ void YoungGCTracer::send_young_gc_event() const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool YoungGCTracer::should_send_promotion_in_new_plab_event() const {
|
||||||
|
return EventPromoteObjectInNewPLAB::is_enabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool YoungGCTracer::should_send_promotion_outside_plab_event() const {
|
||||||
|
return EventPromoteObjectOutsidePLAB::is_enabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
void YoungGCTracer::send_promotion_in_new_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
uint age, bool tenured,
|
||||||
|
size_t plab_size) const {
|
||||||
|
|
||||||
|
EventPromoteObjectInNewPLAB event;
|
||||||
|
if (event.should_commit()) {
|
||||||
|
event.set_gcId(_shared_gc_info.gc_id().id());
|
||||||
|
event.set_class(klass);
|
||||||
|
event.set_objectSize(obj_size);
|
||||||
|
event.set_tenured(tenured);
|
||||||
|
event.set_tenuringAge(age);
|
||||||
|
event.set_plabSize(plab_size);
|
||||||
|
event.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void YoungGCTracer::send_promotion_outside_plab_event(Klass* klass, size_t obj_size,
|
||||||
|
uint age, bool tenured) const {
|
||||||
|
|
||||||
|
EventPromoteObjectOutsidePLAB event;
|
||||||
|
if (event.should_commit()) {
|
||||||
|
event.set_gcId(_shared_gc_info.gc_id().id());
|
||||||
|
event.set_class(klass);
|
||||||
|
event.set_objectSize(obj_size);
|
||||||
|
event.set_tenured(tenured);
|
||||||
|
event.set_tenuringAge(age);
|
||||||
|
event.commit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void OldGCTracer::send_old_gc_event() const {
|
void OldGCTracer::send_old_gc_event() const {
|
||||||
EventGCOldGarbageCollection e(UNTIMED);
|
EventGCOldGarbageCollection e(UNTIMED);
|
||||||
if (e.should_commit()) {
|
if (e.should_commit()) {
|
||||||
|
|
|
@ -314,6 +314,28 @@ Declares a structure type that can be used in other events.
|
||||||
<value type="BYTES64" field="totalSize" label="Total Size" />
|
<value type="BYTES64" field="totalSize" label="Total Size" />
|
||||||
</event>
|
</event>
|
||||||
|
|
||||||
|
<!-- Promotion events, Supported GCs are Parallel Scavange, G1 and CMS with Parallel New. -->
|
||||||
|
<event id="PromoteObjectInNewPLAB" path="vm/gc/detailed/object_promotion_in_new_PLAB" label="Promotion in new PLAB"
|
||||||
|
description="Object survived scavenge and was copied to a new Promotion Local Allocation Buffer (PLAB). Supported GCs are Parallel Scavange, G1 and CMS with Parallel New. Due to promotion being done in parallel an object might be reported multiple times as the GC threads race to copy all objects."
|
||||||
|
has_thread="true" has_stacktrace="false" is_instant="true">
|
||||||
|
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID" description="ID of GC during which the object was promoted"/>
|
||||||
|
<value type="CLASS" field="class" label="Class" description="Class of promoted object"/>
|
||||||
|
<value type="BYTES64" field="objectSize" label="Object Size" description="Size of promoted object"/>
|
||||||
|
<value type="UINT" field="tenuringAge" label="Object Tenuring Age" description="Tenuring age of a surviving object before being copied. The tenuring age of an object is a value between 0-15 and is incremented each scavange the object survives. Newly allocated objects have tenuring age 0."/>
|
||||||
|
<value type="BOOLEAN" field="tenured" label="Tenured" description="True if object was promoted to Old space, otherwise the object was aged and copied to a Survivor space"/>
|
||||||
|
<value type="BYTES64" field="plabSize" label="PLAB Size" description="Size of the allocated PLAB to which the object was copied"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
|
<event id="PromoteObjectOutsidePLAB" path="vm/gc/detailed/object_promotion_outside_PLAB" label="Promotion outside PLAB"
|
||||||
|
description="Object survived scavenge and was copied directly to the heap. Supported GCs are Parallel Scavange, G1 and CMS with Parallel New. Due to promotion being done in parallel an object might be reported multiple times as the GC threads race to copy all objects."
|
||||||
|
has_thread="true" has_stacktrace="false" is_instant="true">
|
||||||
|
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID" description="ID of GC during which the object was promoted"/>
|
||||||
|
<value type="CLASS" field="class" label="Class" description="Class of promoted object"/>
|
||||||
|
<value type="BYTES64" field="objectSize" label="Object Size" description="Size of promoted object"/>
|
||||||
|
<value type="UINT" field="tenuringAge" label="Object Tenuring Age" description="Tenuring age of a surviving object before being copied. The tenuring age of an object is a value between 0-15 and is incremented each scavange the object survives. Newly allocated objects have tenuring age 0."/>
|
||||||
|
<value type="BOOLEAN" field="tenured" label="Tenured" description="True if object was promoted to Old space, otherwise the object was aged and copied to a Survivor space"/>
|
||||||
|
</event>
|
||||||
|
|
||||||
<event id="PromotionFailed" path="vm/gc/detailed/promotion_failed" label="Promotion Failed" is_instant="true"
|
<event id="PromotionFailed" path="vm/gc/detailed/promotion_failed" label="Promotion Failed" is_instant="true"
|
||||||
description="Promotion of an object failed">
|
description="Promotion of an object failed">
|
||||||
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/>
|
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue