< prev index next >

src/share/vm/prims/jni.cpp

Print this page
rev 9380 : 8237499: JFR: Include stack trace in the ThreadStart event
Reviewed-by: egahlin


5008 }
5009 
5010 // Returns the function structure
5011 struct JNINativeInterface_* jni_functions() {
5012 #if INCLUDE_JNI_CHECK
5013   if (CheckJNICalls) return jni_functions_check();
5014 #endif // INCLUDE_JNI_CHECK
5015   return &jni_NativeInterface;
5016 }
5017 
5018 // Returns the function structure
5019 struct JNINativeInterface_* jni_functions_nocheck() {
5020   return &jni_NativeInterface;
5021 }
5022 
5023 static void post_thread_start_event(const JavaThread* jt) {
5024   assert(jt != NULL, "invariant");
5025   EventThreadStart event;
5026   if (event.should_commit()) {
5027     event.set_thread(JFR_THREAD_ID(jt));



5028     event.commit();




5029   }
5030 }
5031 
5032 // Invocation API
5033 
5034 
5035 // Forward declaration
5036 extern const struct JNIInvokeInterface_ jni_InvokeInterface;
5037 
5038 // Global invocation API vars
5039 volatile jint vm_created = 0;
5040 // Indicate whether it is safe to recreate VM
5041 volatile jint safe_to_recreate_vm = 1;
5042 struct JavaVM_ main_vm = {&jni_InvokeInterface};
5043 
5044 
5045 #define JAVASTACKSIZE (400 * 1024)    /* Default size of a thread java stack */
5046 enum { VERIFY_NONE, VERIFY_REMOTE, VERIFY_ALL };
5047 
5048 #ifndef USDT2




5008 }
5009 
5010 // Returns the function structure
5011 struct JNINativeInterface_* jni_functions() {
5012 #if INCLUDE_JNI_CHECK
5013   if (CheckJNICalls) return jni_functions_check();
5014 #endif // INCLUDE_JNI_CHECK
5015   return &jni_NativeInterface;
5016 }
5017 
5018 // Returns the function structure
5019 struct JNINativeInterface_* jni_functions_nocheck() {
5020   return &jni_NativeInterface;
5021 }
5022 
5023 static void post_thread_start_event(const JavaThread* jt) {
5024   assert(jt != NULL, "invariant");
5025   EventThreadStart event;
5026   if (event.should_commit()) {
5027     event.set_thread(JFR_THREAD_ID(jt));
5028     event.set_parentThread((traceid)0);
5029     if (EventThreadStart::is_stacktrace_enabled()) {
5030       jt->jfr_thread_local()->set_cached_stack_trace_id((traceid)0);
5031       event.commit();
5032       jt->jfr_thread_local()->clear_cached_stack_trace();
5033     } else {
5034       event.commit();
5035     }
5036   }
5037 }
5038 
5039 // Invocation API
5040 
5041 
5042 // Forward declaration
5043 extern const struct JNIInvokeInterface_ jni_InvokeInterface;
5044 
5045 // Global invocation API vars
5046 volatile jint vm_created = 0;
5047 // Indicate whether it is safe to recreate VM
5048 volatile jint safe_to_recreate_vm = 1;
5049 struct JavaVM_ main_vm = {&jni_InvokeInterface};
5050 
5051 
5052 #define JAVASTACKSIZE (400 * 1024)    /* Default size of a thread java stack */
5053 enum { VERIFY_NONE, VERIFY_REMOTE, VERIFY_ALL };
5054 
5055 #ifndef USDT2


< prev index next >