6914622: Print values of all flags for product VM

Thu, 07 Jan 2010 16:24:17 -0800

author
kvn
date
Thu, 07 Jan 2010 16:24:17 -0800
changeset 1585
f62a22282a47
parent 1579
9b9c1ee9b3f6
child 1586
1271af4ec18c

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

src/share/vm/runtime/arguments.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/globals.cpp file | annotate | diff | comparison | revisions
src/share/vm/runtime/globals.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/runtime/arguments.cpp	Wed Jan 06 22:21:39 2010 -0800
     1.2 +++ b/src/share/vm/runtime/arguments.cpp	Thu Jan 07 16:24:17 2010 -0800
     1.3 @@ -2633,6 +2633,10 @@
     1.4      if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions", &tail)) {
     1.5        IgnoreUnrecognizedVMOptions = false;
     1.6      }
     1.7 +    if (match_option(option, "-XX:+PrintFlagsInitial", &tail)) {
     1.8 +      CommandLineFlags::printFlags();
     1.9 +      vm_exit(0);
    1.10 +    }
    1.11    }
    1.12  
    1.13    if (IgnoreUnrecognizedVMOptions) {
    1.14 @@ -2795,11 +2799,9 @@
    1.15      CommandLineFlags::printSetFlags();
    1.16    }
    1.17  
    1.18 -#ifdef ASSERT
    1.19    if (PrintFlagsFinal) {
    1.20      CommandLineFlags::printFlags();
    1.21    }
    1.22 -#endif
    1.23  
    1.24    return JNI_OK;
    1.25  }
     2.1 --- a/src/share/vm/runtime/globals.cpp	Wed Jan 06 22:21:39 2010 -0800
     2.2 +++ b/src/share/vm/runtime/globals.cpp	Thu Jan 07 16:24:17 2010 -0800
     2.3 @@ -468,6 +468,8 @@
     2.4    assert(Arguments::check_vm_args_consistency(), "Some flag settings conflict");
     2.5  }
     2.6  
     2.7 +#endif // PRODUCT
     2.8 +
     2.9  void CommandLineFlags::printFlags() {
    2.10    // Print the flags sorted by name
    2.11    // note: this method is called before the thread structure is in place
    2.12 @@ -493,5 +495,3 @@
    2.13    }
    2.14    FREE_C_HEAP_ARRAY(Flag*, array);
    2.15  }
    2.16 -
    2.17 -#endif
     3.1 --- a/src/share/vm/runtime/globals.hpp	Wed Jan 06 22:21:39 2010 -0800
     3.2 +++ b/src/share/vm/runtime/globals.hpp	Thu Jan 07 16:24:17 2010 -0800
     3.3 @@ -211,7 +211,7 @@
     3.4    static bool wasSetOnCmdline(const char* name, bool* value);
     3.5    static void printSetFlags();
     3.6  
     3.7 -  static void printFlags() PRODUCT_RETURN;
     3.8 +  static void printFlags();
     3.9  
    3.10    static void verify() PRODUCT_RETURN;
    3.11  };
    3.12 @@ -327,9 +327,6 @@
    3.13    product(bool, UseMembar, false,                                           \
    3.14            "(Unstable) Issues membars on thread state transitions")          \
    3.15                                                                              \
    3.16 -  product(bool, PrintCommandLineFlags, false,                               \
    3.17 -          "Prints flags that appeared on the command line")                 \
    3.18 -                                                                            \
    3.19    diagnostic(bool, UnlockDiagnosticVMOptions, trueInDebug,                  \
    3.20            "Enable normal processing of flags relating to field diagnostics")\
    3.21                                                                              \
    3.22 @@ -1967,9 +1964,6 @@
    3.23            "number of times a GC thread (minus the coordinator) "            \
    3.24            "will sleep while yielding before giving up and resuming GC")     \
    3.25                                                                              \
    3.26 -  notproduct(bool, PrintFlagsFinal, false,                                  \
    3.27 -          "Print all command line flags after argument processing")         \
    3.28 -                                                                            \
    3.29    /* gc tracing */                                                          \
    3.30    manageable(bool, PrintGC, false,                                          \
    3.31            "Print message at garbage collect")                               \
    3.32 @@ -2269,11 +2263,20 @@
    3.33           "If false, restricts profiled locations to the root method only")  \
    3.34                                                                              \
    3.35    product(bool, PrintVMOptions, trueInDebug,                                \
    3.36 -         "print VM flag settings")                                          \
    3.37 +         "Print flags that appeared on the command line")                   \
    3.38                                                                              \
    3.39    product(bool, IgnoreUnrecognizedVMOptions, false,                         \
    3.40           "Ignore unrecognized VM options")                                  \
    3.41                                                                              \
    3.42 +  product(bool, PrintCommandLineFlags, false,                               \
    3.43 +         "Print flags specified on command line or set by ergonomics")      \
    3.44 +                                                                            \
    3.45 +  product(bool, PrintFlagsInitial, false,                                   \
    3.46 +         "Print all VM flags before argument processing and exit VM")       \
    3.47 +                                                                            \
    3.48 +  product(bool, PrintFlagsFinal, false,                                     \
    3.49 +         "Print all VM flags after argument and ergonomic processing")      \
    3.50 +                                                                            \
    3.51    diagnostic(bool, SerializeVMOutput, true,                                 \
    3.52           "Use a mutex to serialize output to tty and hotspot.log")          \
    3.53                                                                              \

mercurial