mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8237499: JFR: Include stack trace in the ThreadStart event
Reviewed-by: egahlin
This commit is contained in:
parent
8493812702
commit
52d7a61e8d
8 changed files with 54 additions and 8 deletions
|
@ -94,6 +94,7 @@
|
|||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <jfr/recorder/jfrRecorder.hpp>
|
||||
|
||||
/*
|
||||
NOTE about use of any ctor or function call that can trigger a safepoint/GC:
|
||||
|
@ -2882,6 +2883,15 @@ JVM_ENTRY(void, JVM_StartThread(JNIEnv* env, jobject jthread))
|
|||
os::native_thread_creation_failed_msg());
|
||||
}
|
||||
|
||||
#if INCLUDE_JFR
|
||||
if (JfrRecorder::is_recording() && EventThreadStart::is_enabled() &&
|
||||
EventThreadStart::is_stacktrace_enabled()) {
|
||||
JfrThreadLocal* tl = native_thread->jfr_thread_local();
|
||||
// skip Thread.start() and Thread.start0()
|
||||
tl->set_cached_stack_trace_id(JfrStackTraceRepository::record(thread, 2));
|
||||
}
|
||||
#endif
|
||||
|
||||
Thread::start(native_thread);
|
||||
|
||||
JVM_END
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue