6392697: Additional flag needed to supress Hotspot warning messages
authorkamg
Tue, 12 Oct 2010 10:57:33 -0400
changeset 6967 c5ebdcf8372e
parent 6966 e55126fda154
child 6968 5d1eaf2fd05f
6392697: Additional flag needed to supress Hotspot warning messages Summary: Apply PrintJvmWarnings flag to all warnings Reviewed-by: coleenp, phh
hotspot/src/share/vm/runtime/globals.hpp
hotspot/src/share/vm/utilities/debug.cpp
--- a/hotspot/src/share/vm/runtime/globals.hpp	Thu Oct 07 15:14:41 2010 -0400
+++ b/hotspot/src/share/vm/runtime/globals.hpp	Tue Oct 12 10:57:33 2010 -0400
@@ -815,6 +815,9 @@
   develop(bool, PrintJVMWarnings, false,                                    \
           "Prints warnings for unimplemented JVM functions")                \
                                                                             \
+  product(bool, PrintWarnings, true,                                        \
+          "Prints JVM warnings to output stream")                           \
+                                                                            \
   notproduct(uintx, WarnOnStalledSpinLock, 0,                               \
           "Prints warnings for stalled SpinLocks")                          \
                                                                             \
--- a/hotspot/src/share/vm/utilities/debug.cpp	Thu Oct 07 15:14:41 2010 -0400
+++ b/hotspot/src/share/vm/utilities/debug.cpp	Tue Oct 12 10:57:33 2010 -0400
@@ -51,14 +51,16 @@
 
 
 void warning(const char* format, ...) {
-  // In case error happens before init or during shutdown
-  if (tty == NULL) ostream_init();
+  if (PrintWarnings) {
+    // In case error happens before init or during shutdown
+    if (tty == NULL) ostream_init();
 
-  tty->print("%s warning: ", VM_Version::vm_name());
-  va_list ap;
-  va_start(ap, format);
-  tty->vprint_cr(format, ap);
-  va_end(ap);
+    tty->print("%s warning: ", VM_Version::vm_name());
+    va_list ap;
+    va_start(ap, format);
+    tty->vprint_cr(format, ap);
+    va_end(ap);
+  }
   if (BreakAtWarning) BREAKPOINT;
 }