From da95f5319ecd3ef0085a2c0b4947e2ab08191e30 Mon Sep 17 00:00:00 2001 From: Keith McGuigan Date: Tue, 12 Oct 2010 10:57:33 -0400 Subject: [PATCH] 6392697: Additional flag needed to supress Hotspot warning messages Apply PrintJvmWarnings flag to all warnings Reviewed-by: coleenp, phh --- hotspot/src/share/vm/runtime/globals.hpp | 3 +++ hotspot/src/share/vm/utilities/debug.cpp | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 167edb5f796..c2619205957 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -815,6 +815,9 @@ class CommandLineFlags { 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") \ \ diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index 54282bf0740..c535ff0e5ab 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -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; }