8204082: Make names of Young GCs more uniform in logs
authortschatzl
Tue, 26 Jun 2018 11:09:42 +0200
changeset 50787 5f0266d16543
parent 50786 f249187b6c3d
child 50788 6274aee1f692
8204082: Make names of Young GCs more uniform in logs Summary: All G1 young gcs now start with "Pause Young" plus a more detailed description Reviewed-by: sjohanss
src/hotspot/share/gc/g1/g1Arguments.cpp
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
src/hotspot/share/gc/g1/g1HeapVerifier.hpp
test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp
test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java
test/hotspot/jtreg/gc/g1/TestHumongousAllocInitialMark.java
test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java
test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java
test/hotspot/jtreg/gc/g1/TestVerifyGCType.java
test/hotspot/jtreg/gc/g1/humongousObjects/objectGraphTest/GCTokens.java
test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java
--- a/src/hotspot/share/gc/g1/g1Arguments.cpp	Tue Jun 26 09:17:53 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1Arguments.cpp	Tue Jun 26 11:09:42 2018 +0200
@@ -54,10 +54,10 @@
 }
 
 void G1Arguments::parse_verification_type(const char* type) {
-  if (strcmp(type, "young-only") == 0) {
-    G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyYoungOnly);
-  } else if (strcmp(type, "initial-mark") == 0) {
-    G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyInitialMark);
+  if (strcmp(type, "young-normal") == 0) {
+    G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyYoungNormal);
+  } else if (strcmp(type, "concurrent-start") == 0) {
+    G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyConcurrentStart);
   } else if (strcmp(type, "mixed") == 0) {
     G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyMixed);
   } else if (strcmp(type, "remark") == 0) {
@@ -68,7 +68,7 @@
     G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyFull);
   } else {
     log_warning(gc, verify)("VerifyGCType: '%s' is unknown. Available types are: "
-                            "young-only, initial-mark, mixed, remark, cleanup and full", type);
+                            "young-normal, concurrent-start, mixed, remark, cleanup and full", type);
   }
 }
 
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Jun 26 09:17:53 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp	Tue Jun 26 11:09:42 2018 +0200
@@ -2813,15 +2813,19 @@
     GCTraceCPUTime tcpu;
 
     G1HeapVerifier::G1VerifyType verify_type;
-    FormatBuffer<> gc_string("Pause ");
+    FormatBuffer<> gc_string("Pause Young ");
     if (collector_state()->in_initial_mark_gc()) {
-      gc_string.append("Initial Mark");
-      verify_type = G1HeapVerifier::G1VerifyInitialMark;
+      gc_string.append("(Concurrent Start)");
+      verify_type = G1HeapVerifier::G1VerifyConcurrentStart;
     } else if (collector_state()->in_young_only_phase()) {
-      gc_string.append("Young");
-      verify_type = G1HeapVerifier::G1VerifyYoungOnly;
+      if (collector_state()->in_young_gc_before_mixed()) {
+        gc_string.append("(Prepare Mixed)");
+      } else {
+        gc_string.append("(Normal)");
+      }
+      verify_type = G1HeapVerifier::G1VerifyYoungNormal;
     } else {
-      gc_string.append("Mixed");
+      gc_string.append("(Mixed)");
       verify_type = G1HeapVerifier::G1VerifyMixed;
     }
     GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true);
--- a/src/hotspot/share/gc/g1/g1HeapVerifier.hpp	Tue Jun 26 09:17:53 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1HeapVerifier.hpp	Tue Jun 26 11:09:42 2018 +0200
@@ -42,13 +42,13 @@
 
 public:
   enum G1VerifyType {
-    G1VerifyYoungOnly   =  1, // -XX:VerifyGCType=young-only
-    G1VerifyInitialMark =  2, // -XX:VerifyGCType=initial-mark
-    G1VerifyMixed       =  4, // -XX:VerifyGCType=mixed
-    G1VerifyRemark      =  8, // -XX:VerifyGCType=remark
-    G1VerifyCleanup     = 16, // -XX:VerifyGCType=cleanup
-    G1VerifyFull        = 32, // -XX:VerifyGCType=full
-    G1VerifyAll         = -1
+    G1VerifyYoungNormal     =  1, // -XX:VerifyGCType=young-normal
+    G1VerifyConcurrentStart =  2, // -XX:VerifyGCType=concurrent-start
+    G1VerifyMixed           =  4, // -XX:VerifyGCType=mixed
+    G1VerifyRemark          =  8, // -XX:VerifyGCType=remark
+    G1VerifyCleanup         = 16, // -XX:VerifyGCType=cleanup
+    G1VerifyFull            = 32, // -XX:VerifyGCType=full
+    G1VerifyAll             = -1
   };
 
   G1HeapVerifier(G1CollectedHeap* heap) : _g1h(heap) {}
--- a/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp	Tue Jun 26 09:17:53 2018 +0200
+++ b/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp	Tue Jun 26 11:09:42 2018 +0200
@@ -37,8 +37,8 @@
 
   // Default is to verify everything.
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyAll));
-  ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly));
-  ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyInitialMark));
+  ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
+  ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyConcurrentStart));
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark));
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup));
@@ -47,18 +47,18 @@
   // Setting one will disable all other.
   G1Arguments::parse_verification_type("full");
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyAll));
-  ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly));
-  ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyInitialMark));
+  ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
+  ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyConcurrentStart));
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark));
   ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup));
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull));
 
   // Verify case sensitivity.
-  G1Arguments::parse_verification_type("YOUNG-ONLY");
-  ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly));
-  G1Arguments::parse_verification_type("young-only");
-  ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly));
+  G1Arguments::parse_verification_type("YOUNG-NORMAL");
+  ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
+  G1Arguments::parse_verification_type("young-normal");
+  ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal));
 
   // Verify perfect match
   G1Arguments::parse_verification_type("mixedgc");
@@ -69,7 +69,7 @@
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed));
 
   // Verify the last three
-  G1Arguments::parse_verification_type("initial-mark");
+  G1Arguments::parse_verification_type("concurrent-start");
   G1Arguments::parse_verification_type("remark");
   G1Arguments::parse_verification_type("cleanup");
   ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark));
--- a/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java	Tue Jun 26 09:17:53 2018 +0200
+++ b/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java	Tue Jun 26 11:09:42 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -74,14 +74,14 @@
     OutputAnalyzer out = runWithoutG1ClassUnloading();
 
     out.shouldMatch(".*Pause Full.*");
-    out.shouldNotMatch(".*Pause Initial Mark.*");
+    out.shouldNotMatch(".*Pause Young \\(Concurrent Start\\).*");
   }
 
   public static void testWithG1ClassUnloading() throws Exception {
     // -XX:+ClassUnloadingWithConcurrentMark is used, so we expect a concurrent cycle instead of a full GC.
     OutputAnalyzer out = runWithG1ClassUnloading();
 
-    out.shouldMatch(".*Pause Initial Mark.*");
+    out.shouldMatch(".*Pause Young \\(Concurrent Start\\).*");
     out.shouldNotMatch(".*Pause Full.*");
   }
 
--- a/test/hotspot/jtreg/gc/g1/TestHumongousAllocInitialMark.java	Tue Jun 26 09:17:53 2018 +0200
+++ b/test/hotspot/jtreg/gc/g1/TestHumongousAllocInitialMark.java	Tue Jun 26 11:09:42 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -52,7 +52,7 @@
             HumongousObjectAllocator.class.getName());
 
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Pause Initial Mark (G1 Humongous Allocation)");
+        output.shouldContain("Pause Young (Concurrent Start) (G1 Humongous Allocation)");
         output.shouldNotContain("Full GC");
         output.shouldHaveExitValue(0);
     }
--- a/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java	Tue Jun 26 09:17:53 2018 +0200
+++ b/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java	Tue Jun 26 11:09:42 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -51,7 +51,7 @@
             HumongousObjectAllocator.class.getName());
 
         OutputAnalyzer output = new OutputAnalyzer(pb.start());
-        output.shouldContain("Pause Initial Mark (G1 Humongous Allocation)");
+        output.shouldContain("Pause Young (Concurrent Start) (G1 Humongous Allocation)");
         output.shouldHaveExitValue(0);
     }
 
--- a/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java	Tue Jun 26 09:17:53 2018 +0200
+++ b/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java	Tue Jun 26 11:09:42 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -335,7 +335,7 @@
                                                       YoungGC,
                                                       "-Xlog:gc,gc+stringdedup=trace");
         output.shouldNotContain("Full GC");
-        output.shouldContain("Pause Young (G1 Evacuation Pause)");
+        output.shouldContain("Pause Young (Normal) (G1 Evacuation Pause)");
         output.shouldContain("Concurrent String Deduplication");
         output.shouldContain("Deduplicated:");
         output.shouldHaveExitValue(0);
@@ -347,7 +347,7 @@
                                                       DefaultAgeThreshold,
                                                       FullGC,
                                                       "-Xlog:gc,gc+stringdedup=trace");
-        output.shouldNotContain("Pause Young (G1 Evacuation Pause)");
+        output.shouldNotContain("Pause Young (Normal) (G1 Evacuation Pause)");
         output.shouldContain("Full GC");
         output.shouldContain("Concurrent String Deduplication");
         output.shouldContain("Deduplicated:");
--- a/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java	Tue Jun 26 09:17:53 2018 +0200
+++ b/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java	Tue Jun 26 11:09:42 2018 +0200
@@ -60,9 +60,10 @@
         OutputAnalyzer output = testWithVerificationType(new String[0]);
         output.shouldHaveExitValue(0);
 
-        verifyCollection("Pause Young", true, false, true, output.getStdout());
-        verifyCollection("Pause Initial Mark", true, false, true, output.getStdout());
-        verifyCollection("Pause Mixed", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Normal)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Concurrent Start)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Mixed)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Prepare Mixed)", true, false, true, output.getStdout());
         verifyCollection("Pause Remark", false, true, false, output.getStdout());
         verifyCollection("Pause Cleanup", false, true, false, output.getStdout());
         verifyCollection("Pause Full", true, true, true, output.getStdout());
@@ -72,12 +73,13 @@
         OutputAnalyzer output;
         // Test with all explicitly enabled
         output = testWithVerificationType(new String[] {
-                "young-only", "initial-mark", "mixed", "remark", "cleanup", "full"});
+                "young-normal", "concurrent-start", "mixed", "remark", "cleanup", "full"});
         output.shouldHaveExitValue(0);
 
-        verifyCollection("Pause Young", true, false, true, output.getStdout());
-        verifyCollection("Pause Initial Mark", true, false, true, output.getStdout());
-        verifyCollection("Pause Mixed", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Normal)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Concurrent Start)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Mixed)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Prepare Mixed)", true, false, true, output.getStdout());
         verifyCollection("Pause Remark", false, true, false, output.getStdout());
         verifyCollection("Pause Cleanup", false, true, false, output.getStdout());
         verifyCollection("Pause Full", true, true, true, output.getStdout());
@@ -89,9 +91,10 @@
         output = testWithVerificationType(new String[] {"remark", "full"});
         output.shouldHaveExitValue(0);
 
-        verifyCollection("Pause Young", false, false, false, output.getStdout());
-        verifyCollection("Pause Initial Mark", false, false, false, output.getStdout());
-        verifyCollection("Pause Mixed", false, false, false, output.getStdout());
+        verifyCollection("Pause Young (Normal)", false, false, false, output.getStdout());
+        verifyCollection("Pause Young (Concurrent Start)", false, false, false, output.getStdout());
+        verifyCollection("Pause Young (Mixed)", false, false, false, output.getStdout());
+        verifyCollection("Pause Young (Prepare Mixed)", false, false, false, output.getStdout());
         verifyCollection("Pause Remark", false, true, false, output.getStdout());
         verifyCollection("Pause Cleanup", false, false, false, output.getStdout());
         verifyCollection("Pause Full", true, true, true, output.getStdout());
@@ -100,12 +103,13 @@
     private static void testConcurrentMark() throws Exception {
         OutputAnalyzer output;
         // Test with full and remark
-        output = testWithVerificationType(new String[] {"initial-mark", "cleanup", "remark"});
+        output = testWithVerificationType(new String[] {"concurrent-start", "cleanup", "remark"});
         output.shouldHaveExitValue(0);
 
-        verifyCollection("Pause Young", false, false, false, output.getStdout());
-        verifyCollection("Pause Initial Mark", true, false, true, output.getStdout());
-        verifyCollection("Pause Mixed", false, false, false, output.getStdout());
+        verifyCollection("Pause Young (Normal)", false, false, false, output.getStdout());
+        verifyCollection("Pause Young (Concurrent Start)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Mixed)", false, false, false, output.getStdout());
+        verifyCollection("Pause Young (Prepare Mixed)", false, false, false, output.getStdout());
         verifyCollection("Pause Remark", false, true, false, output.getStdout());
         verifyCollection("Pause Cleanup", false, true, false, output.getStdout());
         verifyCollection("Pause Full", false, false, false, output.getStdout());
@@ -117,10 +121,11 @@
         output = testWithVerificationType(new String[] {"old"});
         output.shouldHaveExitValue(0);
 
-        output.shouldMatch("VerifyGCType: '.*' is unknown. Available types are: young-only, initial-mark, mixed, remark, cleanup and full");
-        verifyCollection("Pause Young", true, false, true, output.getStdout());
-        verifyCollection("Pause Initial Mark", true, false, true, output.getStdout());
-        verifyCollection("Pause Mixed", true, false, true, output.getStdout());
+        output.shouldMatch("VerifyGCType: '.*' is unknown. Available types are: young-normal, concurrent-start, mixed, remark, cleanup and full");
+        verifyCollection("Pause Young (Normal)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Concurrent Start)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Mixed)", true, false, true, output.getStdout());
+        verifyCollection("Pause Young (Prepare Mixed)", true, false, true, output.getStdout());
         verifyCollection("Pause Remark", false, true, false, output.getStdout());
         verifyCollection("Pause Cleanup", false, true, false, output.getStdout());
         verifyCollection("Pause Full", true, true, true, output.getStdout());
@@ -229,21 +234,23 @@
             // Allocate some memory that can be turned into garbage.
             Object[] used = alloc1M();
 
+            wb.youngGC(); // young-normal
+
             // Trigger the different GCs using the WhiteBox API.
             wb.fullGC();  // full
 
             // Memory have been promoted to old by full GC. Free
             // some memory to be reclaimed by concurrent cycle.
             partialFree(used);
-            wb.g1StartConcMarkCycle(); // initial-mark, remark and cleanup
+            wb.g1StartConcMarkCycle(); // concurrent-start, remark and cleanup
 
             // Sleep to make sure concurrent cycle is done
             while (wb.g1InConcurrentMark()) {
                 Thread.sleep(1000);
             }
 
-            // Trigger two young GCs, first will be young-only, second will be mixed.
-            wb.youngGC(); // young-only
+            // Trigger two young GCs, first will be young-prepare-mixed, second will be mixed.
+            wb.youngGC(); // young-prepare-mixed
             wb.youngGC(); // mixed
         }
 
--- a/test/hotspot/jtreg/gc/g1/humongousObjects/objectGraphTest/GCTokens.java	Tue Jun 26 09:17:53 2018 +0200
+++ b/test/hotspot/jtreg/gc/g1/humongousObjects/objectGraphTest/GCTokens.java	Tue Jun 26 11:09:42 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -31,8 +31,8 @@
     private GCTokens() {
     }
 
-    public static final String WB_INITIATED_YOUNG_GC = "Young (WhiteBox Initiated Young GC)";
-    public static final String WB_INITIATED_MIXED_GC = "Pause Mixed (WhiteBox Initiated Young GC)";
+    public static final String WB_INITIATED_YOUNG_GC = "Young (Normal) (WhiteBox Initiated Young GC)";
+    public static final String WB_INITIATED_MIXED_GC = "Young (Mixed) (WhiteBox Initiated Young GC)";
     public static final String WB_INITIATED_CMC = "WhiteBox Initiated Concurrent Mark";
     public static final String FULL_GC = "Full (System.gc())";
     public static final String FULL_GC_MEMORY_PRESSURE = "WhiteBox Initiated Full GC";
--- a/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java	Tue Jun 26 09:17:53 2018 +0200
+++ b/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java	Tue Jun 26 11:09:42 2018 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -80,7 +80,7 @@
         OutputAnalyzer output = spawnMixedGCProvoker(vmFlag);
         System.out.println(output.getStdout());
         output.shouldHaveExitValue(0);
-        output.shouldContain("Pause Mixed (G1 Evacuation Pause)");
+        output.shouldContain("Pause Young (Mixed) (G1 Evacuation Pause)");
     }
 
     /**