mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-06 14:10:36 +00:00
8028647: Add instrumentation in GetSafepointSyncTime.java and remove it from ProblemList.txt
Reviewed-by: sla, chegar
This commit is contained in:
parent
ed3617da2e
commit
7183dce25d
@ -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 + ")");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user