8143155: Remove TraceRuntimeCalls, TraceJNICalls, and TraceJVMCalls rather than convert to UL
authorrprotacio
Tue, 24 Nov 2015 11:40:18 -0500
changeset 34285 0b07014c15e9
parent 34277 d457b9400c99
child 34286 ae53ecf4124a
8143155: Remove TraceRuntimeCalls, TraceJNICalls, and TraceJVMCalls rather than convert to UL Summary: Removed TraceRuntimeCalls, TraceJNICalls, and TraceJVMCalls options because their output is excessive, not useful, and covered in a more useful way by other options. Reviewed-by: coleenp, dholmes, ddmitriev
hotspot/src/share/vm/prims/jni.cpp
hotspot/src/share/vm/prims/jvm.cpp
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/runtime/interfaceSupport.cpp
hotspot/src/share/vm/runtime/interfaceSupport.hpp
hotspot/src/share/vm/runtime/thread.cpp
hotspot/test/runtime/CommandLine/VMOptionWarning.java
--- a/hotspot/src/share/vm/prims/jni.cpp	Tue Nov 24 20:01:45 2015 +0000
+++ b/hotspot/src/share/vm/prims/jni.cpp	Tue Nov 24 11:40:18 2015 -0500
@@ -261,19 +261,6 @@
   Histogram* JNIHistogram;
   static volatile jint JNIHistogram_lock = 0;
 
-  class JNITraceWrapper : public StackObj {
-   public:
-    JNITraceWrapper(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
-      if (TraceJNICalls) {
-        va_list ap;
-        va_start(ap, format);
-        tty->print("JNI ");
-        tty->vprint_cr(format, ap);
-        va_end(ap);
-      }
-    }
-  };
-
   class JNIHistogramElement : public HistogramElement {
     public:
      JNIHistogramElement(const char* name);
@@ -305,7 +292,7 @@
      static JNIHistogramElement* e = new JNIHistogramElement(arg); \
       /* There is a MT-race condition in VC++. So we need to make sure that that e has been initialized */ \
      if (e != NULL) e->increment_count()
-  #define JNIWrapper(arg) JNICountWrapper(arg); JNITraceWrapper(arg)
+  #define JNIWrapper(arg) JNICountWrapper(arg);
 #else
   #define JNIWrapper(arg)
 #endif
@@ -3759,7 +3746,7 @@
 void quicken_jni_functions() {
   // Replace Get<Primitive>Field with fast versions
   if (UseFastJNIAccessors && !JvmtiExport::can_post_field_access()
-      && !VerifyJNIFields && !TraceJNICalls && !CountJNICalls && !CheckJNICalls
+      && !VerifyJNIFields && !CountJNICalls && !CheckJNICalls
 #if defined(_WINDOWS) && defined(IA32) && defined(COMPILER2)
       // windows x86 currently needs SEH wrapper and the gain of the fast
       // versions currently isn't certain for server vm on uniprocessor.
--- a/hotspot/src/share/vm/prims/jvm.cpp	Tue Nov 24 20:01:45 2015 +0000
+++ b/hotspot/src/share/vm/prims/jvm.cpp	Tue Nov 24 11:40:18 2015 -0500
@@ -223,19 +223,6 @@
 // Wrapper to trace JVM functions
 
 #ifdef ASSERT
-  class JVMTraceWrapper : public StackObj {
-   public:
-    JVMTraceWrapper(const char* format, ...) ATTRIBUTE_PRINTF(2, 3) {
-      if (TraceJVMCalls) {
-        va_list ap;
-        va_start(ap, format);
-        tty->print("JVM ");
-        tty->vprint_cr(format, ap);
-        va_end(ap);
-      }
-    }
-  };
-
   Histogram* JVMHistogram;
   volatile jint JVMHistogram_lock = 0;
 
@@ -269,15 +256,9 @@
       static JVMHistogramElement* e = new JVMHistogramElement(arg); \
       if (e != NULL) e->increment_count();  // Due to bug in VC++, we need a NULL check here eventhough it should never happen!
 
-  #define JVMWrapper(arg1)                    JVMCountWrapper(arg1); JVMTraceWrapper(arg1)
-  #define JVMWrapper2(arg1, arg2)             JVMCountWrapper(arg1); JVMTraceWrapper(arg1, arg2)
-  #define JVMWrapper3(arg1, arg2, arg3)       JVMCountWrapper(arg1); JVMTraceWrapper(arg1, arg2, arg3)
-  #define JVMWrapper4(arg1, arg2, arg3, arg4) JVMCountWrapper(arg1); JVMTraceWrapper(arg1, arg2, arg3, arg4)
+  #define JVMWrapper(arg) JVMCountWrapper(arg);
 #else
-  #define JVMWrapper(arg1)
-  #define JVMWrapper2(arg1, arg2)
-  #define JVMWrapper3(arg1, arg2, arg3)
-  #define JVMWrapper4(arg1, arg2, arg3, arg4)
+  #define JVMWrapper(arg)
 #endif
 
 
@@ -672,7 +653,7 @@
 // java.io.File ///////////////////////////////////////////////////////////////
 
 JVM_LEAF(char*, JVM_NativePath(char* path))
-  JVMWrapper2("JVM_NativePath (%s)", path);
+  JVMWrapper("JVM_NativePath");
   return os::native_path(path);
 JVM_END
 
@@ -749,7 +730,7 @@
 // FindClassFromBootLoader is exported to the launcher for windows.
 JVM_ENTRY(jclass, JVM_FindClassFromBootLoader(JNIEnv* env,
                                               const char* name))
-  JVMWrapper2("JVM_FindClassFromBootLoader %s", name);
+  JVMWrapper("JVM_FindClassFromBootLoader");
 
   // Java libraries should ensure that name is never null...
   if (name == NULL || (int)strlen(name) > Symbol::max_length()) {
@@ -774,7 +755,7 @@
 JVM_ENTRY(jclass, JVM_FindClassFromCaller(JNIEnv* env, const char* name,
                                           jboolean init, jobject loader,
                                           jclass caller))
-  JVMWrapper2("JVM_FindClassFromCaller %s throws ClassNotFoundException", name);
+  JVMWrapper("JVM_FindClassFromCaller throws ClassNotFoundException");
   // Java libraries should ensure that name is never null...
   if (name == NULL || (int)strlen(name) > Symbol::max_length()) {
     // It's impossible to create this class;  the name cannot fit
@@ -809,7 +790,7 @@
 
 JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
                                          jboolean init, jclass from))
-  JVMWrapper2("JVM_FindClassFromClass %s", name);
+  JVMWrapper("JVM_FindClassFromClass");
   if (name == NULL || (int)strlen(name) > Symbol::max_length()) {
     // It's impossible to create this class;  the name cannot fit
     // into the constant pool.
@@ -916,14 +897,14 @@
 
 
 JVM_ENTRY(jclass, JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd))
-  JVMWrapper2("JVM_DefineClass %s", name);
+  JVMWrapper("JVM_DefineClass");
 
   return jvm_define_class_common(env, name, loader, buf, len, pd, NULL, THREAD);
 JVM_END
 
 
 JVM_ENTRY(jclass, JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader, const jbyte *buf, jsize len, jobject pd, const char *source))
-  JVMWrapper2("JVM_DefineClassWithSource %s", name);
+  JVMWrapper("JVM_DefineClassWithSource");
 
   return jvm_define_class_common(env, name, loader, buf, len, pd, source, THREAD);
 JVM_END
@@ -3350,7 +3331,7 @@
 
 JVM_ENTRY_NO_ENV(void*, JVM_LoadLibrary(const char* name))
   //%note jvm_ct
-  JVMWrapper2("JVM_LoadLibrary (%s)", name);
+  JVMWrapper("JVM_LoadLibrary");
   char ebuf[1024];
   void *load_result;
   {
@@ -3382,7 +3363,7 @@
 
 
 JVM_LEAF(void*, JVM_FindLibraryEntry(void* handle, const char* name))
-  JVMWrapper2("JVM_FindLibraryEntry (%s)", name);
+  JVMWrapper("JVM_FindLibraryEntry");
   return os::dll_lookup(handle, name);
 JVM_END
 
@@ -3390,7 +3371,7 @@
 // JNI version ///////////////////////////////////////////////////////////////////////////////
 
 JVM_LEAF(jboolean, JVM_IsSupportedJNIVersion(jint version))
-  JVMWrapper2("JVM_IsSupportedJNIVersion (%d)", version);
+  JVMWrapper("JVM_IsSupportedJNIVersion");
   return Threads::is_supported_jni_version_including_1_1(version);
 JVM_END
 
--- a/hotspot/src/share/vm/runtime/globals.hpp	Tue Nov 24 20:01:45 2015 +0000
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Tue Nov 24 11:40:18 2015 -0500
@@ -1426,18 +1426,9 @@
                                                                             \
   /* tracing */                                                             \
                                                                             \
-  notproduct(bool, TraceRuntimeCalls, false,                                \
-          "Trace run-time calls")                                           \
-                                                                            \
-  develop(bool, TraceJNICalls, false,                                       \
-          "Trace JNI calls")                                                \
-                                                                            \
   develop(bool, StressRewriter, false,                                      \
           "Stress linktime bytecode rewriting")                             \
                                                                             \
-  notproduct(bool, TraceJVMCalls, false,                                    \
-          "Trace JVM calls")                                                \
-                                                                            \
   product(ccstr, TraceJVMTI, NULL,                                          \
           "Trace flags for JVMTI functions and events")                     \
                                                                             \
--- a/hotspot/src/share/vm/runtime/interfaceSupport.cpp	Tue Nov 24 20:01:45 2015 +0000
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.cpp	Tue Nov 24 11:40:18 2015 -0500
@@ -70,10 +70,6 @@
   Atomic::dec(&RuntimeHistogram_lock);
 }
 
-void InterfaceSupport::trace(const char* result_type, const char* header) {
-  tty->print_cr("%6ld  %s", _number_of_calls, header);
-}
-
 void InterfaceSupport::gc_alot() {
   Thread *thread = Thread::current();
   if (!thread->is_Java_thread()) return; // Avoid concurrent calls
--- a/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Tue Nov 24 20:01:45 2015 +0000
+++ b/hotspot/src/share/vm/runtime/interfaceSupport.hpp	Tue Nov 24 11:40:18 2015 -0500
@@ -74,9 +74,6 @@
   static long _number_of_calls;
   static long _fullgc_alot_invocation;
 
-  // tracing
-  static void trace(const char* result_type, const char* header);
-
   // Helper methods used to implement +ScavengeALot and +FullGCALot
   static void check_gc_alot() { if (ScavengeALot || FullGCALot) gc_alot(); }
   static void gc_alot();
@@ -402,8 +399,6 @@
 
 #define TRACE_CALL(result_type, header)                            \
   InterfaceSupport::_number_of_calls++;                            \
-  if (TraceRuntimeCalls)                                           \
-    InterfaceSupport::trace(#result_type, #header);                \
   if (CountRuntimeCalls) {                                         \
     static RuntimeHistogramElement* e = new RuntimeHistogramElement(#header); \
     if (e != NULL) e->increment_count();                           \
--- a/hotspot/src/share/vm/runtime/thread.cpp	Tue Nov 24 20:01:45 2015 +0000
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Tue Nov 24 11:40:18 2015 -0500
@@ -4022,13 +4022,6 @@
   // will be stopped at native=>Java/VM barriers. Note that we can't
   // simply kill or suspend them, as it is inherently deadlock-prone.
 
-#ifndef PRODUCT
-  // disable function tracing at JNI/JVM barriers
-  TraceJNICalls = false;
-  TraceJVMCalls = false;
-  TraceRuntimeCalls = false;
-#endif
-
   VM_Exit::set_vm_exited();
 
   notify_vm_shutdown();
--- a/hotspot/test/runtime/CommandLine/VMOptionWarning.java	Tue Nov 24 20:01:45 2015 +0000
+++ b/hotspot/test/runtime/CommandLine/VMOptionWarning.java	Tue Nov 24 11:40:18 2015 -0500
@@ -47,12 +47,12 @@
         output = new OutputAnalyzer(pb.start());
         output.shouldContain("Error: VM option 'PrintInlining' is diagnostic and must be enabled via -XX:+UnlockDiagnosticVMOptions.");
 
-        pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceJNICalls", "-version");
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+VerifyStack", "-version");
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Error: VM option 'TraceJNICalls' is develop and is available only in debug version of VM.");
+        output.shouldContain("Error: VM option 'VerifyStack' is develop and is available only in debug version of VM.");
 
-        pb = ProcessTools.createJavaProcessBuilder("-XX:+TraceJVMCalls", "-version");
+        pb = ProcessTools.createJavaProcessBuilder("-XX:+ExecuteInternalVMTests", "-version");
         output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Error: VM option 'TraceJVMCalls' is notproduct and is available only in debug version of VM.");
+        output.shouldContain("Error: VM option 'ExecuteInternalVMTests' is notproduct and is available only in debug version of VM.");
     }
 }