< prev index next >

test/gc/g1/TestGCLogMessages.java

Print this page
rev 12512 : imported patch 8155094-logging-for-long-lasting-methods


  98         // Redirty Cards
  99         new LogMessageWithLevel("Redirty Cards", Level.DEBUG),
 100         new LogMessageWithLevel("Parallel Redirty", Level.TRACE),
 101         new LogMessageWithLevel("Redirtied Cards", Level.TRACE),
 102         // Misc Top-level
 103         new LogMessageWithLevel("Code Roots Purge", Level.DEBUG),
 104         new LogMessageWithLevel("String Dedup Fixup", Level.DEBUG),
 105         new LogMessageWithLevel("Expand Heap After Collection", Level.DEBUG),
 106         // Free CSet
 107         new LogMessageWithLevel("Free Collection Set", Level.DEBUG),
 108         new LogMessageWithLevel("Free Collection Set Serial", Level.TRACE),
 109         new LogMessageWithLevel("Young Free Collection Set", Level.TRACE),
 110         new LogMessageWithLevel("Non-Young Free Collection Set", Level.TRACE),
 111         // Humongous Eager Reclaim
 112         new LogMessageWithLevel("Humongous Reclaim", Level.DEBUG),
 113         new LogMessageWithLevel("Humongous Register", Level.DEBUG),
 114         // Preserve CM Referents
 115         new LogMessageWithLevel("Preserve CM Refs", Level.DEBUG),
 116         // Merge PSS
 117         new LogMessageWithLevel("Merge Per-Thread State", Level.DEBUG),






 118     };
 119 
 120     void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception {
 121         for (LogMessageWithLevel l : messages) {
 122             if (level.lessThan(l.level)) {
 123                 output.shouldNotContain(l.message);
 124             } else {
 125                 output.shouldMatch("\\[" + l.level + ".*" + l.message);
 126             }
 127         }
 128     }
 129 
 130     public static void main(String[] args) throws Exception {
 131         new TestGCLogMessages().testNormalLogs();
 132         new TestGCLogMessages().testWithToSpaceExhaustionLogs();
 133         new TestGCLogMessages().testWithInitialMark();
 134     }
 135 
 136     private void testNormalLogs() throws Exception {
 137 




  98         // Redirty Cards
  99         new LogMessageWithLevel("Redirty Cards", Level.DEBUG),
 100         new LogMessageWithLevel("Parallel Redirty", Level.TRACE),
 101         new LogMessageWithLevel("Redirtied Cards", Level.TRACE),
 102         // Misc Top-level
 103         new LogMessageWithLevel("Code Roots Purge", Level.DEBUG),
 104         new LogMessageWithLevel("String Dedup Fixup", Level.DEBUG),
 105         new LogMessageWithLevel("Expand Heap After Collection", Level.DEBUG),
 106         // Free CSet
 107         new LogMessageWithLevel("Free Collection Set", Level.DEBUG),
 108         new LogMessageWithLevel("Free Collection Set Serial", Level.TRACE),
 109         new LogMessageWithLevel("Young Free Collection Set", Level.TRACE),
 110         new LogMessageWithLevel("Non-Young Free Collection Set", Level.TRACE),
 111         // Humongous Eager Reclaim
 112         new LogMessageWithLevel("Humongous Reclaim", Level.DEBUG),
 113         new LogMessageWithLevel("Humongous Register", Level.DEBUG),
 114         // Preserve CM Referents
 115         new LogMessageWithLevel("Preserve CM Refs", Level.DEBUG),
 116         // Merge PSS
 117         new LogMessageWithLevel("Merge Per-Thread State", Level.DEBUG),
 118         // TLAB handling
 119         new LogMessageWithLevel("Prepare TLABs", Level.DEBUG),
 120         new LogMessageWithLevel("Resize TLABs", Level.DEBUG),
 121 
 122         new LogMessageWithLevel("DPT Update", Level.DEBUG),
 123         new LogMessageWithLevel("Start New Collection Set", Level.DEBUG),
 124     };
 125 
 126     void checkMessagesAtLevel(OutputAnalyzer output, LogMessageWithLevel messages[], Level level) throws Exception {
 127         for (LogMessageWithLevel l : messages) {
 128             if (level.lessThan(l.level)) {
 129                 output.shouldNotContain(l.message);
 130             } else {
 131                 output.shouldMatch("\\[" + l.level + ".*" + l.message);
 132             }
 133         }
 134     }
 135 
 136     public static void main(String[] args) throws Exception {
 137         new TestGCLogMessages().testNormalLogs();
 138         new TestGCLogMessages().testWithToSpaceExhaustionLogs();
 139         new TestGCLogMessages().testWithInitialMark();
 140     }
 141 
 142     private void testNormalLogs() throws Exception {
 143 


< prev index next >