Merge "Disable JIT in BootImageProfileTest." am: 89320ec08f am: 3e8f4a285c am: 2b3b5e27ec
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1781192 Change-Id: Ie3924e303f1d0ad8e935e26e7a958cfbe4d8a974
This commit is contained in:
@@ -31,6 +31,8 @@ public class BootImageProfileTest implements IDeviceTest {
|
||||
private static final String SYSTEM_SERVER_PROFILE =
|
||||
"/data/misc/profiles/cur/0/android/primary.prof";
|
||||
private static final boolean USE_PHENOTYPE = false;
|
||||
private static final String DALVIK_VM_EXTRA_OPTS =
|
||||
"-Xusejit:false -Xint -Xjitsaveprofilinginfo";
|
||||
|
||||
@Override
|
||||
public void setDevice(ITestDevice testDevice) {
|
||||
@@ -54,10 +56,10 @@ public class BootImageProfileTest implements IDeviceTest {
|
||||
private String setProperty(String property, String value) throws Exception {
|
||||
if (USE_PHENOTYPE) {
|
||||
return mTestDevice.executeShellCommand(
|
||||
"device_config put runtime_native_boot " + property + " " + value);
|
||||
String.format("device_config put runtime_native_boot %s '%s'", property, value));
|
||||
} else {
|
||||
return mTestDevice.executeShellCommand(
|
||||
"setprop dalvik.vm." + property + " " + value);
|
||||
String.format("setprop dalvik.vm.%s '%s'", property, value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,6 +71,8 @@ public class BootImageProfileTest implements IDeviceTest {
|
||||
assertTrue("profile boot class path not enabled: " + res, "true".equals(res));
|
||||
res = getProperty("profilesystemserver");
|
||||
assertTrue("profile system server not enabled: " + res, "true".equals(res));
|
||||
res = getProperty("extra-opts");
|
||||
assertTrue("extra options not set: " + res, DALVIK_VM_EXTRA_OPTS.equals(res));
|
||||
}
|
||||
|
||||
private boolean forceSaveProfile(String pkg) throws Exception {
|
||||
@@ -91,16 +95,20 @@ public class BootImageProfileTest implements IDeviceTest {
|
||||
boolean profileBootClassPath = "true".equals(pbcp);
|
||||
String pss = getProperty("profilesystemserver");
|
||||
boolean profileSystemServer = "true".equals(pss);
|
||||
if (profileBootClassPath && profileSystemServer) {
|
||||
String extraOpts = getProperty("extra-opts");
|
||||
boolean extraOptsOk = DALVIK_VM_EXTRA_OPTS.equals(extraOpts);
|
||||
if (profileBootClassPath && profileSystemServer && extraOptsOk) {
|
||||
break;
|
||||
}
|
||||
if (i == numIterations) {
|
||||
assertTrue("profile system server not enabled: " + pss, profileSystemServer);
|
||||
assertTrue("profile boot class path not enabled: " + pbcp, profileBootClassPath);
|
||||
assertTrue("extra options not set: " + extraOpts, extraOptsOk);
|
||||
}
|
||||
|
||||
setProperty("profilebootclasspath", "true");
|
||||
setProperty("profilesystemserver", "true");
|
||||
setProperty("extra-opts", DALVIK_VM_EXTRA_OPTS);
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
@@ -114,12 +122,15 @@ public class BootImageProfileTest implements IDeviceTest {
|
||||
boolean profileBootClassPath = "true".equals(pbcp);
|
||||
String pss = getProperty("profilesystemserver");
|
||||
boolean profileSystemServer = "true".equals(pss);
|
||||
String extraOpts = getProperty("extra-opts");
|
||||
boolean extraOptsOk = DALVIK_VM_EXTRA_OPTS.equals(extraOpts);
|
||||
if (profileBootClassPath && profileSystemServer) {
|
||||
break;
|
||||
}
|
||||
if (i == numIterations) {
|
||||
assertTrue("profile system server not enabled: " + pss, profileSystemServer);
|
||||
assertTrue("profile boot class path not enabled: " + pbcp, profileBootClassPath);
|
||||
assertTrue("extra options not set: " + extraOpts, extraOptsOk);
|
||||
}
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user