提交 ccccc01c 编写于 作者: M mchung

8028647: Add instrumentation in GetSafepointSyncTime.java and remove it from ProblemList.txt

Reviewed-by: sla, chegar
上级 18b5c0e7
......@@ -129,9 +129,6 @@ java/lang/management/MemoryMXBean/CollectionUsageThreshold.java generic-all
# jdk_management
# 8010897
sun/management/HotspotRuntimeMBean/GetSafepointSyncTime.java macosx-all
# 8028150
sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh windows-all
......
......@@ -45,12 +45,9 @@ public class GetSafepointSyncTime {
private static final long MIN_VALUE_FOR_PASS = 1;
private static final long MAX_VALUE_FOR_PASS = Long.MAX_VALUE;
private static boolean trace = false;
public static void main(String args[]) throws Exception {
if (args.length > 0 && args[0].equals("trace")) {
trace = true;
}
long count = mbean.getSafepointCount();
long value = mbean.getSafepointSyncTime();
// Thread.getAllStackTraces() should cause safepoints.
// If this test is failing because it doesn't,
......@@ -59,15 +56,15 @@ public class GetSafepointSyncTime {
Thread.getAllStackTraces();
}
long value = mbean.getSafepointSyncTime();
long count1 = mbean.getSafepointCount();
long value1 = mbean.getSafepointSyncTime();
if (trace) {
System.out.println("Safepoint sync time (ms): " + value);
}
System.out.format("Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
count1, count1-count, value1, value1-value);
if (value < MIN_VALUE_FOR_PASS || value > MAX_VALUE_FOR_PASS) {
if (value1 < MIN_VALUE_FOR_PASS || value1 > MAX_VALUE_FOR_PASS) {
throw new RuntimeException("Safepoint sync time " +
"illegal value: " + value + " ms " +
"illegal value: " + value1 + " ms " +
"(MIN = " + MIN_VALUE_FOR_PASS + "; " +
"MAX = " + MAX_VALUE_FOR_PASS + ")");
}
......@@ -76,16 +73,16 @@ public class GetSafepointSyncTime {
Thread.getAllStackTraces();
}
long count2 = mbean.getSafepointCount();
long value2 = mbean.getSafepointSyncTime();
if (trace) {
System.out.println("Safepoint sync time2 (ms): " + value2);
}
System.out.format("Safepoint count=%d (diff=%d), sync time=%d ms (diff=%d)%n",
count2, count2-count1, value2, value2-value1);
if (value2 <= value) {
if (value2 <= value1) {
throw new RuntimeException("Safepoint sync time " +
"did not increase " +
"(value = " + value + "; " +
"(value1 = " + value1 + "; " +
"value2 = " + value2 + ")");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册