changeset 1144:5c6d1b90dc19

6914622: Print values of all flags for product VM Summary: Change the flag -XX:+PrintFlagsFinal to product and add new product flag -XX:+PrintFlagsInitial. Reviewed-by: phh, ysr Contributed-by: gbenson@redhat.com
author kvn
date Thu, 07 Jan 2010 16:24:17 -0800
parents 3b8413513ece
children dd5a19d97c1d
files src/share/vm/runtime/arguments.cpp src/share/vm/runtime/globals.cpp src/share/vm/runtime/globals.hpp
diffstat 3 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.cpp	Mon Jan 04 03:34:40 2010 -0800
+++ b/src/share/vm/runtime/arguments.cpp	Thu Jan 07 16:24:17 2010 -0800
@@ -2625,6 +2625,10 @@
     if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions", &tail)) {
       IgnoreUnrecognizedVMOptions = false;
     }
+    if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) {
+      CommandLineFlags::printFlags();
+      vm_exit(0);
+    }
   }
 
   if (IgnoreUnrecognizedVMOptions) {
@@ -2765,11 +2769,9 @@
     CommandLineFlags::printSetFlags();
   }
 
-#ifdef ASSERT
   if (PrintFlagsFinal) {
     CommandLineFlags::printFlags();
   }
-#endif
 
   return JNI_OK;
 }
--- a/src/share/vm/runtime/globals.cpp	Mon Jan 04 03:34:40 2010 -0800
+++ b/src/share/vm/runtime/globals.cpp	Thu Jan 07 16:24:17 2010 -0800
@@ -468,6 +468,8 @@
   assert(Arguments::check_vm_args_consistency(), "Some flag settings conflict");
 }
 
+#endif // PRODUCT
+
 void CommandLineFlags::printFlags() {
   // Print the flags sorted by name
   // note: this method is called before the thread structure is in place
@@ -493,5 +495,3 @@
   }
   FREE_C_HEAP_ARRAY(Flag*, array);
 }
-
-#endif
--- a/src/share/vm/runtime/globals.hpp	Mon Jan 04 03:34:40 2010 -0800
+++ b/src/share/vm/runtime/globals.hpp	Thu Jan 07 16:24:17 2010 -0800
@@ -210,7 +210,7 @@
   static bool wasSetOnCmdline(const char* name, bool* value);
   static void printSetFlags();
 
-  static void printFlags() PRODUCT_RETURN;
+  static void printFlags();
 
   static void verify() PRODUCT_RETURN;
 };
@@ -326,9 +326,6 @@
   product(bool, UseMembar, false,                                           \
           "(Unstable) Issues membars on thread state transitions")          \
                                                                             \
-  product(bool, PrintCommandLineFlags, false,                               \
-          "Prints flags that appeared on the command line")                 \
-                                                                            \
   diagnostic(bool, UnlockDiagnosticVMOptions, trueInDebug,                  \
           "Enable normal processing of flags relating to field diagnostics")\
                                                                             \
@@ -1962,9 +1959,6 @@
           "number of times a GC thread (minus the coordinator) "            \
           "will sleep while yielding before giving up and resuming GC")     \
                                                                             \
-  notproduct(bool, PrintFlagsFinal, false,                                  \
-          "Print all command line flags after argument processing")         \
-                                                                            \
   /* gc tracing */                                                          \
   manageable(bool, PrintGC, false,                                          \
           "Print message at garbage collect")                               \
@@ -2264,11 +2258,20 @@
          "If false, restricts profiled locations to the root method only")  \
                                                                             \
   product(bool, PrintVMOptions, trueInDebug,                                \
-         "print VM flag settings")                                          \
+         "Print flags that appeared on the command line")                   \
                                                                             \
   product(bool, IgnoreUnrecognizedVMOptions, false,                         \
          "Ignore unrecognized VM options")                                  \
                                                                             \
+  product(bool, PrintCommandLineFlags, false,                               \
+         "Print flags specified on command line or set by ergonomics")      \
+                                                                            \
+  product(bool, PrintFlagsInitial, false,                                   \
+         "Print all VM flags before argument processing and exit VM")       \
+                                                                            \
+  product(bool, PrintFlagsFinal, false,                                     \
+         "Print all VM flags after argument and ergonomic processing")      \
+                                                                            \
   diagnostic(bool, SerializeVMOutput, true,                                 \
          "Use a mutex to serialize output to tty and hotspot.log")          \
                                                                             \