virtmgr: Add boost_uclamp
To ensure consistent results during testing, passes the boost_uclamp
as a hint to the host scheduler to reduce variance and set
a mininum floor for performance.
Also enable boost_uclamp for Microdroid Boot tests,
partially authored by ioffe.
Bug: 342349882
Test: Booted a VM and checked uClamp
Change-Id: I0d40163515d1a4e41bde6cc81916de51f798813c
Signed-off-by: David Dai <davidai@google.com>
diff --git a/tests/benchmark/Android.bp b/tests/benchmark/Android.bp
index 413ffe4..5ede699 100644
--- a/tests/benchmark/Android.bp
+++ b/tests/benchmark/Android.bp
@@ -22,8 +22,10 @@
"MicrodroidTestNativeLib",
"libiovsock_host_jni",
],
- jni_uses_platform_apis: true,
- sdk_version: "test_current",
+ libs: [
+ "framework-virtualization.impl",
+ ],
+ platform_apis: true,
use_embedded_native_libs: true,
compile_multilib: "64",
required: ["perf-setup"],
diff --git a/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java b/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java
index 9cc1b7b..d8b17f1 100644
--- a/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java
+++ b/tests/benchmark/src/java/com/android/microdroid/benchmark/MicrodroidBenchmarks.java
@@ -233,6 +233,7 @@
for (int i = 0; i < trialCount; i++) {
VirtualMachineConfig.Builder builder =
newVmConfigBuilderWithPayloadBinary("MicrodroidIdleNativeLib.so")
+ .setShouldBoostUclamp(true)
.setMemoryBytes(256 * ONE_MEBI)
.setDebugLevel(DEBUG_LEVEL_NONE);
if (fullDebug) {