Date: Fri, 9 Jun 2023 10:34:42 +0800
Subject: [PATCH 42/59] 8140581: Excluding compile messages should only be printed with PrintCompilation

Bug url: https://bugs.openjdk.org/browse/JDK-8140581
---
 hotspot/src/share/vm/compiler/compileBroker.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp
index 63f7bde8f..e8f97074e 100644
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp
@@ -1504,7 +1504,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci,
   // The method may be explicitly excluded by the user.
   bool quietly;
   if (CompilerOracle::should_exclude(method, quietly)) {
-    if (!quietly) {
+    if (PrintCompilation && !quietly) {
       // This does not happen quietly...
       ResourceMark rm;
       tty->print("### Excluding %s:%s",
-- 
2.22.0

