diff --git a/src/share/vm/prims/jni.cpp b/src/share/vm/prims/jni.cpp index 221fe4a4cbcba46ad326ac4d6d57385961101263..0d6c210800092b0242b0a438d033d3944c381b03 100644 --- a/src/share/vm/prims/jni.cpp +++ b/src/share/vm/prims/jni.cpp @@ -5026,11 +5026,14 @@ static void post_thread_start_event(const JavaThread* jt) { if (event.should_commit()) { event.set_thread(JFR_THREAD_ID(jt)); event.set_parentThread((traceid)0); +#if INCLUDE_JFR if (EventThreadStart::is_stacktrace_enabled()) { jt->jfr_thread_local()->set_cached_stack_trace_id((traceid)0); event.commit(); jt->jfr_thread_local()->clear_cached_stack_trace(); - } else { + } else +#endif + { event.commit(); } }