15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 * @test
27 * @bug 8031320
28 * @summary Verify that rtm locking statistics contain proper information
29 * on overall aborts and locks count and count of aborts of
30 * different types. Test also verify that VM output does not
31 * contain rtm locking statistics when it should not.
32 * @library /testlibrary /test/lib /
33 * @modules java.base/jdk.internal.misc
34 * java.management
35 * @build TestPrintPreciseRTMLockingStatistics
36 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
37 * sun.hotspot.WhiteBox$WhiteBoxPermission
38 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
39 * -XX:+WhiteBoxAPI TestPrintPreciseRTMLockingStatistics
40 */
41
42 import java.util.*;
43
44 import jdk.test.lib.*;
45 import jdk.test.lib.cli.CommandLineOptionTest;
46 import jdk.test.lib.cli.predicate.AndPredicate;
47 import compiler.testlibrary.rtm.*;
48 import compiler.testlibrary.rtm.predicate.SupportedCPU;
49 import compiler.testlibrary.rtm.predicate.SupportedVM;
50
51 /**
52 * Test verifies that VM output does not contain RTM locking statistics when it
53 * should not (when PrintPreciseRTMLockingStatistics is off) and that with
54 * -XX:+PrintPreciseRTMLockingStatistics locking statistics contains sane
55 * total locks and aborts count as well as for specific abort types.
56 */
57 public class TestPrintPreciseRTMLockingStatistics
58 extends CommandLineOptionTest {
59 private TestPrintPreciseRTMLockingStatistics() {
60 super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
61 }
62
63 @Override
64 public void runTestCases() throws Throwable {
65 verifyNoStatistics();
66 verifyStatistics();
67 }
68
69 // verify that VM output does not contain
70 // rtm locking statistics
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 /**
26 * @test
27 * @bug 8031320
28 * @summary Verify that rtm locking statistics contain proper information
29 * on overall aborts and locks count and count of aborts of
30 * different types. Test also verify that VM output does not
31 * contain rtm locking statistics when it should not.
32 * @library /testlibrary /test/lib /
33 * @modules java.base/jdk.internal.misc
34 * java.management
35 * @build compiler.rtm.print.TestPrintPreciseRTMLockingStatistics
36 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
37 * sun.hotspot.WhiteBox$WhiteBoxPermission
38 * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions
39 * -XX:+WhiteBoxAPI
40 * compiler.rtm.print.TestPrintPreciseRTMLockingStatistics
41 */
42
43
44 package compiler.rtm.print;
45
46 import compiler.testlibrary.rtm.AbortProvoker;
47 import compiler.testlibrary.rtm.AbortType;
48 import compiler.testlibrary.rtm.RTMLockingStatistics;
49 import compiler.testlibrary.rtm.RTMTestBase;
50 import compiler.testlibrary.rtm.predicate.SupportedCPU;
51 import compiler.testlibrary.rtm.predicate.SupportedVM;
52 import jdk.test.lib.Asserts;
53 import jdk.test.lib.OutputAnalyzer;
54 import jdk.test.lib.cli.CommandLineOptionTest;
55 import jdk.test.lib.cli.predicate.AndPredicate;
56
57 import java.util.Collections;
58 import java.util.LinkedList;
59 import java.util.List;
60
61 /**
62 * Test verifies that VM output does not contain RTM locking statistics when it
63 * should not (when PrintPreciseRTMLockingStatistics is off) and that with
64 * -XX:+PrintPreciseRTMLockingStatistics locking statistics contains sane
65 * total locks and aborts count as well as for specific abort types.
66 */
67 public class TestPrintPreciseRTMLockingStatistics
68 extends CommandLineOptionTest {
69 private TestPrintPreciseRTMLockingStatistics() {
70 super(new AndPredicate(new SupportedCPU(), new SupportedVM()));
71 }
72
73 @Override
74 public void runTestCases() throws Throwable {
75 verifyNoStatistics();
76 verifyStatistics();
77 }
78
79 // verify that VM output does not contain
80 // rtm locking statistics
|