8204082: Make names of Young GCs more uniform in logs

All G1 young gcs now start with "Pause Young" plus a more detailed description

Reviewed-by: sjohanss
This commit is contained in:
Thomas Schatzl 2018-06-26 11:09:42 +02:00
parent 7628589694
commit 19f5116cd9
11 changed files with 74 additions and 63 deletions

View File

@ -54,10 +54,10 @@ void G1Arguments::initialize_verification_types() {
}
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 @@ void G1Arguments::parse_verification_type(const char* type) {
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);
}
}

View File

@ -2813,15 +2813,19 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
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);

View File

@ -42,13 +42,13 @@ private:
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) {}

View File

@ -37,8 +37,8 @@ TEST_F(G1HeapVerifierTest, parse) {
// 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 @@ TEST_F(G1HeapVerifierTest, parse) {
// 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 @@ TEST_F(G1HeapVerifierTest, parse) {
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));

View File

@ -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 @@ public class TestG1ClassUnloadingHWM {
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.*");
}

View File

@ -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 @@ public class TestHumongousAllocInitialMark {
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);
}

View File

@ -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 @@ public class TestHumongousAllocNearlyFullRegion {
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);
}

View File

@ -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 @@ class TestStringDeduplicationTools {
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 @@ class TestStringDeduplicationTools {
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:");

View File

@ -60,9 +60,10 @@ public class TestVerifyGCType {
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 @@ public class TestVerifyGCType {
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 @@ public class TestVerifyGCType {
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 @@ public class TestVerifyGCType {
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 @@ public class TestVerifyGCType {
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 @@ public class TestVerifyGCType {
// 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
}

View File

@ -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 @@ public final class GCTokens {
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";

View File

@ -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 @@ public class TestLogging {
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)");
}
/**