8277397: ZGC: Add JFR event for temporary latency measurements
Reviewed-by: eosterlund, jbachorik, pliden, mgronlun
This commit is contained in:
parent
7b2d823e84
commit
712b875682
@ -131,3 +131,16 @@ void ZTracer::send_thread_phase(const char* name, const Ticks& start, const Tick
|
||||
e.commit();
|
||||
}
|
||||
}
|
||||
|
||||
void ZTracer::send_thread_debug(const char* name, const Ticks& start, const Ticks& end) {
|
||||
NoSafepointVerifier nsv;
|
||||
|
||||
EventZThreadDebug e(UNTIMED);
|
||||
if (e.should_commit()) {
|
||||
e.set_gcId(GCId::current_or_undefined());
|
||||
e.set_name(name);
|
||||
e.set_starttime(start);
|
||||
e.set_endtime(end);
|
||||
e.commit();
|
||||
}
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ private:
|
||||
void send_stat_counter(const ZStatCounter& counter, uint64_t increment, uint64_t value);
|
||||
void send_stat_sampler(const ZStatSampler& sampler, uint64_t value);
|
||||
void send_thread_phase(const char* name, const Ticks& start, const Ticks& end);
|
||||
void send_thread_debug(const char* name, const Ticks& start, const Ticks& end);
|
||||
|
||||
public:
|
||||
static ZTracer* tracer();
|
||||
@ -47,16 +48,18 @@ public:
|
||||
void report_stat_counter(const ZStatCounter& counter, uint64_t increment, uint64_t value);
|
||||
void report_stat_sampler(const ZStatSampler& sampler, uint64_t value);
|
||||
void report_thread_phase(const char* name, const Ticks& start, const Ticks& end);
|
||||
void report_thread_debug(const char* name, const Ticks& start, const Ticks& end);
|
||||
};
|
||||
|
||||
class ZTraceThreadPhase : public StackObj {
|
||||
// For temporary latency measurements during development and debugging
|
||||
class ZTraceThreadDebug : public StackObj {
|
||||
private:
|
||||
const Ticks _start;
|
||||
const char* const _name;
|
||||
|
||||
public:
|
||||
ZTraceThreadPhase(const char* name);
|
||||
~ZTraceThreadPhase();
|
||||
ZTraceThreadDebug(const char* name);
|
||||
~ZTraceThreadDebug();
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_Z_ZTRACER_HPP
|
||||
|
@ -50,12 +50,18 @@ inline void ZTracer::report_thread_phase(const char* name, const Ticks& start, c
|
||||
}
|
||||
}
|
||||
|
||||
inline ZTraceThreadPhase::ZTraceThreadPhase(const char* name) :
|
||||
inline void ZTracer::report_thread_debug(const char* name, const Ticks& start, const Ticks& end) {
|
||||
if (EventZThreadDebug::is_enabled()) {
|
||||
send_thread_debug(name, start, end);
|
||||
}
|
||||
}
|
||||
|
||||
inline ZTraceThreadDebug::ZTraceThreadDebug(const char* name) :
|
||||
_start(Ticks::now()),
|
||||
_name(name) {}
|
||||
|
||||
inline ZTraceThreadPhase::~ZTraceThreadPhase() {
|
||||
ZTracer::tracer()->report_thread_phase(_name, _start, Ticks::now());
|
||||
inline ZTraceThreadDebug::~ZTraceThreadDebug() {
|
||||
ZTracer::tracer()->report_thread_debug(_name, _start, Ticks::now());
|
||||
}
|
||||
|
||||
#endif // SHARE_GC_Z_ZTRACER_INLINE_HPP
|
||||
|
@ -1034,6 +1034,11 @@
|
||||
<Field type="string" name="name" label="Name" />
|
||||
</Event>
|
||||
|
||||
<Event name="ZThreadDebug" category="Java Virtual Machine, GC, Detailed" label="ZGC Thread Event" description="Temporary latency measurements used during development and debugging of ZGC" thread="true" experimental="true">
|
||||
<Field type="uint" name="gcId" label="GC Identifier" relation="GcId"/>
|
||||
<Field type="string" name="name" label="Name" />
|
||||
</Event>
|
||||
|
||||
<Event name="ZUncommit" category="Java Virtual Machine, GC, Detailed" label="ZGC Uncommit" description="Uncommitting of memory" thread="true">
|
||||
<Field type="ulong" contentType="bytes" name="uncommitted" label="Uncommitted" />
|
||||
</Event>
|
||||
|
@ -775,6 +775,11 @@
|
||||
<setting name="threshold">0 ms</setting>
|
||||
</event>
|
||||
|
||||
<event name="jdk.ZThreadDebug">
|
||||
<setting name="enabled">true</setting>
|
||||
<setting name="threshold">0 ms</setting>
|
||||
</event>
|
||||
|
||||
<event name="jdk.ZUncommit">
|
||||
<setting name="enabled">true</setting>
|
||||
<setting name="threshold">0 ms</setting>
|
||||
|
@ -775,6 +775,11 @@
|
||||
<setting name="threshold">0 ms</setting>
|
||||
</event>
|
||||
|
||||
<event name="jdk.ZThreadDebug">
|
||||
<setting name="enabled">true</setting>
|
||||
<setting name="threshold">0 ms</setting>
|
||||
</event>
|
||||
|
||||
<event name="jdk.ZUncommit">
|
||||
<setting name="enabled">true</setting>
|
||||
<setting name="threshold">0 ms</setting>
|
||||
|
Loading…
Reference in New Issue
Block a user