hotspot/test/gc/g1/TestRemsetLoggingPerRegion.java
author brutisso
Thu, 10 Dec 2015 14:57:55 +0100
changeset 35061 be6025ebffea
parent 31629 hotspot/test/gc/g1/TestSummarizeRSetStatsPerRegion.java@892d04ec5304
child 35189 a69874af6697
permissions -rw-r--r--
8145092: Use Unified Logging for the GC logging Summary: JEP-271. VM changes contributed by brutisso, test changes contributed by david. Reviewed-by: sjohanss, david, brutisso Contributed-by: bengt.rutisson@oracle.com, david.lindholm@oralce.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     1
/*
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 20305
diff changeset
     2
 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     4
 *
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     7
 * published by the Free Software Foundation.
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     8
 *
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    13
 * accompanied this code).
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    14
 *
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    18
 *
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    21
 * questions.
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    22
 */
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    23
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    24
/*
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    25
 * @test TestRemsetLoggingPerRegion.java
31629
892d04ec5304 8129977: TestSummarizeRSetStats.java fails: Incorrect amount of per-period RSet summaries at the end
tschatzl
parents: 30604
diff changeset
    26
 * @bug 8014078 8129977
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    27
 * @library /testlibrary
29678
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 20305
diff changeset
    28
 * @modules java.base/sun.misc
dd2f3932c21e 8075586: Add @modules as needed to the open hotspot tests
ykantser
parents: 20305
diff changeset
    29
 *          java.management/sun.management
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    30
 * @build TestRemsetLoggingTools TestRemsetLoggingPerRegion
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    31
 * @summary Verify output of -Xlog:gc+remset*=trace in regards to per-region type output
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    32
 * @run main TestRemsetLoggingPerRegion
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    33
 */
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    34
30604
b8d532cb6420 8067013: Rename the com.oracle.java.testlibary package
ykantser
parents: 29678
diff changeset
    35
import jdk.test.lib.*;
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    36
import java.lang.Thread;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    37
import java.util.ArrayList;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    38
import java.util.Arrays;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    39
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    40
public class TestRemsetLoggingPerRegion {
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    41
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    42
    public static void main(String[] args) throws Exception {
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    43
        String result;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    44
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    45
        if (!TestRemsetLoggingTools.testingG1GC()) {
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    46
            return;
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    47
        }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    48
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    49
        // single remembered set summary output at the end
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    50
        result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace" }, 0);
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    51
        TestRemsetLoggingTools.expectPerRegionRSetSummaries(result, 1, 0);
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    52
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    53
        // two times remembered set summary output
35061
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    54
        result = TestRemsetLoggingTools.runTest(new String[] { "-Xlog:gc+remset*=trace", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1);
be6025ebffea 8145092: Use Unified Logging for the GC logging
brutisso
parents: 31629
diff changeset
    55
        TestRemsetLoggingTools.expectPerRegionRSetSummaries(result, 1, 2);
20305
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    56
    }
af013cf4a5e6 8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
diff changeset
    57
}