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:
Jiakai Zhang
2021-08-09 06:44:37 +00:00
committed by Automerger Merge Worker

View File

@@ -31,6 +31,8 @@ public class BootImageProfileTest implements IDeviceTest {
private static final String SYSTEM_SERVER_PROFILE = private static final String SYSTEM_SERVER_PROFILE =
"/data/misc/profiles/cur/0/android/primary.prof"; "/data/misc/profiles/cur/0/android/primary.prof";
private static final boolean USE_PHENOTYPE = false; private static final boolean USE_PHENOTYPE = false;
private static final String DALVIK_VM_EXTRA_OPTS =
"-Xusejit:false -Xint -Xjitsaveprofilinginfo";
@Override @Override
public void setDevice(ITestDevice testDevice) { public void setDevice(ITestDevice testDevice) {
@@ -54,10 +56,10 @@ public class BootImageProfileTest implements IDeviceTest {
private String setProperty(String property, String value) throws Exception { private String setProperty(String property, String value) throws Exception {
if (USE_PHENOTYPE) { if (USE_PHENOTYPE) {
return mTestDevice.executeShellCommand( return mTestDevice.executeShellCommand(
"device_config put runtime_native_boot " + property + " " + value); String.format("device_config put runtime_native_boot %s '%s'", property, value));
} else { } else {
return mTestDevice.executeShellCommand( 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)); assertTrue("profile boot class path not enabled: " + res, "true".equals(res));
res = getProperty("profilesystemserver"); res = getProperty("profilesystemserver");
assertTrue("profile system server not enabled: " + res, "true".equals(res)); 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 { private boolean forceSaveProfile(String pkg) throws Exception {
@@ -91,16 +95,20 @@ public class BootImageProfileTest implements IDeviceTest {
boolean profileBootClassPath = "true".equals(pbcp); boolean profileBootClassPath = "true".equals(pbcp);
String pss = getProperty("profilesystemserver"); String pss = getProperty("profilesystemserver");
boolean profileSystemServer = "true".equals(pss); 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; break;
} }
if (i == numIterations) { if (i == numIterations) {
assertTrue("profile system server not enabled: " + pss, profileSystemServer); assertTrue("profile system server not enabled: " + pss, profileSystemServer);
assertTrue("profile boot class path not enabled: " + pbcp, profileBootClassPath); assertTrue("profile boot class path not enabled: " + pbcp, profileBootClassPath);
assertTrue("extra options not set: " + extraOpts, extraOptsOk);
} }
setProperty("profilebootclasspath", "true"); setProperty("profilebootclasspath", "true");
setProperty("profilesystemserver", "true"); setProperty("profilesystemserver", "true");
setProperty("extra-opts", DALVIK_VM_EXTRA_OPTS);
Thread.sleep(1000); Thread.sleep(1000);
} }
@@ -114,12 +122,15 @@ public class BootImageProfileTest implements IDeviceTest {
boolean profileBootClassPath = "true".equals(pbcp); boolean profileBootClassPath = "true".equals(pbcp);
String pss = getProperty("profilesystemserver"); String pss = getProperty("profilesystemserver");
boolean profileSystemServer = "true".equals(pss); boolean profileSystemServer = "true".equals(pss);
String extraOpts = getProperty("extra-opts");
boolean extraOptsOk = DALVIK_VM_EXTRA_OPTS.equals(extraOpts);
if (profileBootClassPath && profileSystemServer) { if (profileBootClassPath && profileSystemServer) {
break; break;
} }
if (i == numIterations) { if (i == numIterations) {
assertTrue("profile system server not enabled: " + pss, profileSystemServer); assertTrue("profile system server not enabled: " + pss, profileSystemServer);
assertTrue("profile boot class path not enabled: " + pbcp, profileBootClassPath); assertTrue("profile boot class path not enabled: " + pbcp, profileBootClassPath);
assertTrue("extra options not set: " + extraOpts, extraOptsOk);
} }
Thread.sleep(1000); Thread.sleep(1000);
} }