提交 77e715a0 编写于 作者: E egahlin

8165675: Trace event for thread park has incorrect unit for timeout

Reviewed-by: mgronlun
上级 9fd27380
......@@ -40,7 +40,8 @@
<Event name="ThreadPark" category="Java Application" label="Java Thread Park" thread="true" stackTrace="true">
<Field type="Class" name="parkedClass" label="Class Parked On" />
<Field type="long" contentType="millis" name="timeout" label="Park Timeout" />
<Field type="long" contentType="nanos" name="timeout" label="Park Timeout" />
<Field type="long" contentType="epochmillis" name="until" label="Park Until" />
<Field type="ulong" contentType="address" name="address" label="Address of Object Parked" relation="JavaMonitorAddress" />
</Event>
......@@ -1134,5 +1135,6 @@
<XmlContentType name="address" annotationType="jdk.jfr.MemoryAddress" />
<XmlContentType name="percentage" annotationType="jdk.jfr.Percentage" />
<XmlContentType name="millis" annotationType="jdk.jfr.Timespan" annotationValue="MILLISECONDS" />
<XmlContentType name="nanos" annotationType="jdk.jfr.Timespan" annotationValue="NANOSECONDS" />
</Metadata>
......@@ -1236,11 +1236,12 @@ UNSAFE_ENTRY(jboolean, Unsafe_CompareAndSwapLong(JNIEnv *env, jobject unsafe, jo
#endif
UNSAFE_END
static void post_thread_park_event(EventThreadPark* event, const oop obj, jlong timeout) {
static void post_thread_park_event(EventThreadPark* event, const oop obj, jlong timeout_nanos, jlong until_epoch_millis) {
assert(event != NULL, "invariant");
assert(event->should_commit(), "invariant");
event->set_parkedClass((obj != NULL) ? obj->klass() : NULL);
event->set_timeout(timeout);
event->set_timeout(timeout_nanos);
event->set_until(until_epoch_millis);
event->set_address((obj != NULL) ? (u8)cast_from_oop<uintptr_t>(obj) : 0);
event->commit();
}
......@@ -1263,7 +1264,16 @@ UNSAFE_ENTRY(void, Unsafe_Park(JNIEnv *env, jobject unsafe, jboolean isAbsolute,
(uintptr_t) thread->parker());
#endif /* USDT2 */
if (event.should_commit()) {
post_thread_park_event(&event, thread->current_park_blocker(), time);
const oop obj = thread->current_park_blocker();
if (time == 0) {
post_thread_park_event(&event, obj, min_jlong, min_jlong);
} else {
if (isAbsolute != 0) {
post_thread_park_event(&event, obj, min_jlong, time);
} else {
post_thread_park_event(&event, obj, time, min_jlong);
}
}
}
UNSAFE_END
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册