author | jprovino |
Wed, 11 Nov 2015 23:47:42 +0000 | |
changeset 33911 | af2cff5bd523 |
parent 31629 | 892d04ec5304 |
permissions | -rw-r--r-- |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
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. |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
4 |
* |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
8 |
* |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
13 |
* accompanied this code). |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
14 |
* |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
18 |
* |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
21 |
* questions. |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
22 |
*/ |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
23 |
|
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
24 |
/* |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
25 |
* @test TestSummarizeRSetStats.java |
31629
892d04ec5304
8129977: TestSummarizeRSetStats.java fails: Incorrect amount of per-period RSet summaries at the end
tschatzl
parents:
29678
diff
changeset
|
26 |
* @bug 8013895 8129977 |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
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 |
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
30 |
* @build TestSummarizeRSetStatsTools TestSummarizeRSetStats |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
31 |
* @summary Verify output of -XX:+G1SummarizeRSetStats |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
32 |
* @run main TestSummarizeRSetStats |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
33 |
* |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
34 |
* Test the output of G1SummarizeRSetStats in conjunction with G1SummarizeRSetStatsPeriod. |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
35 |
*/ |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
36 |
|
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
37 |
public class TestSummarizeRSetStats { |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
38 |
|
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
39 |
public static void main(String[] args) throws Exception { |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
40 |
String result; |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
41 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
42 |
if (!TestSummarizeRSetStatsTools.testingG1GC()) { |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
43 |
return; |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
44 |
} |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
45 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
46 |
// no remembered set summary output |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
47 |
result = TestSummarizeRSetStatsTools.runTest(null, 0); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
48 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
49 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
50 |
// no remembered set summary output |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
51 |
result = TestSummarizeRSetStatsTools.runTest(null, 2); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
52 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
53 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
54 |
// no remembered set summary output |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
55 |
result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
56 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 0, 0); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
57 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
58 |
// single remembered set summary output at the end |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
59 |
result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 0); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
60 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
61 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
62 |
// single remembered set summary output at the end |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
63 |
result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats" }, 2); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
64 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
65 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
66 |
// single remembered set summary output |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
67 |
result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 0); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
68 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 0); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
69 |
|
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
70 |
// two times remembered set summary output |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
71 |
result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 1); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
72 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
73 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
74 |
// four times remembered set summary output |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
75 |
result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=1" }, 3); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
76 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 6); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
77 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
78 |
// three times remembered set summary output |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
79 |
result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=2" }, 3); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
80 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 4); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
81 |
|
20305
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
82 |
// single remembered set summary output |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
83 |
result = TestSummarizeRSetStatsTools.runTest(new String[] { "-XX:+G1SummarizeRSetStats", "-XX:G1SummarizeRSetStatsPeriod=100" }, 3); |
af013cf4a5e6
8014078: G1: improve remembered set summary information by providing per region type information
tschatzl
parents:
17854
diff
changeset
|
84 |
TestSummarizeRSetStatsTools.expectRSetSummaries(result, 1, 2); |
17854
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
85 |
} |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
86 |
} |
d65bc1546091
8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen
tschatzl
parents:
diff
changeset
|
87 |