test/hotspot/jtreg/gc/g1/TestGCLogMessages.java
changeset 59162 09b295eb214b
parent 58777 18c246ad2ff9
child 59198 92c98aa0f801
equal deleted inserted replaced
59161:6374e632b1ea 59162:09b295eb214b
    33  * @library /test/lib
    33  * @library /test/lib
    34  * @modules java.base/jdk.internal.misc
    34  * @modules java.base/jdk.internal.misc
    35  *          java.management
    35  *          java.management
    36  * @build sun.hotspot.WhiteBox
    36  * @build sun.hotspot.WhiteBox
    37  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
    37  * @run driver ClassFileInstaller sun.hotspot.WhiteBox
    38  * @run main gc.g1.TestGCLogMessages
    38  *                                sun.hotspot.WhiteBox$WhiteBoxPermission
       
    39  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
       
    40  *                   gc.g1.TestGCLogMessages
    39  */
    41  */
    40 
    42 
    41 import jdk.test.lib.process.OutputAnalyzer;
    43 import jdk.test.lib.process.OutputAnalyzer;
    42 import jdk.test.lib.process.ProcessTools;
    44 import jdk.test.lib.process.ProcessTools;
    43 import jdk.test.lib.Platform;
    45 import sun.hotspot.code.Compiler;
    44 
    46 
    45 public class TestGCLogMessages {
    47 public class TestGCLogMessages {
    46 
    48 
    47     private enum Level {
    49     private enum Level {
    48         OFF(""),
    50         OFF(""),
    83         public LogMessageWithLevelC2OrJVMCIOnly(String message, Level level) {
    85         public LogMessageWithLevelC2OrJVMCIOnly(String message, Level level) {
    84             super(message, level);
    86             super(message, level);
    85         }
    87         }
    86 
    88 
    87         public boolean isAvailable() {
    89         public boolean isAvailable() {
    88             return Platform.isGraal() || Platform.isServer();
    90             return Compiler.isC2Enabled() || Compiler.isGraalEnabled();
    89         }
    91         }
    90     }
    92     }
    91 
    93 
    92     private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] {
    94     private LogMessageWithLevel allLogMessages[] = new LogMessageWithLevel[] {
    93         new LogMessageWithLevel("Pre Evacuate Collection Set", Level.INFO),
    95         new LogMessageWithLevel("Pre Evacuate Collection Set", Level.INFO),