12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 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 | 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 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 /test/lib / 33 * @modules java.base/jdk.internal.misc 34 * java.management 35 * @build sun.hotspot.WhiteBox 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.process.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 |