Commit Graph

22 Commits

Author SHA1 Message Date
Sebastian Ene 297bcfd7c5 Merge "Average the cold app startup time to eliminate the noise" 2022-10-31 16:00:06 +00:00
Sebastian Ene 207be2f5fe Average the cold app startup time to eliminate the noise
Reduce the noise by warming the caches (start the app
package 3 times without capturing the logs). Then, run the app 5x times
before/during/after VM run and use the reportMetrics to send the data.
Create two different test cases, one for the Settings app package and
one for the Camera app. Verify if the package is installed before
starting the test.

Bug: 236621823
Test: atest AVFHostTestCase#testCameraAppStartupTime and then run
 atest AVFHostTestCase#testSettingsStartupTime and verify the reported
metrics

Change-Id: I3ca7761b117bdbf2262b043c015f96196459308c
2022-10-31 13:59:59 +00:00
Sebastian Ene 9aabc726ec Ensure the app is killed before collecting startup time metrics
The measured app startup time was not collected correctly while running
metrics because the app was not killed. Tear down the application and
get the cold app startup time.

Bug: 236621823
Test: atest AVFHostTestCase#testAppStartupTime
Change-Id: I85f145373bc773d8371df40f3fadd434cba60737
2022-10-19 11:48:17 +00:00
Sebastian Ene 6291981008 Measure app startup impact after VM teardown
Add a host side test as part of MicrodroidTestCase which starts a
Microdroid VM that reserves 80% of the device's memory reported from
/proc/meminfo (MemFree - field) and touches all the allocated guest
memory with a tmpfs filesystem and successive copies from /dev/zero.
This step is necessary to create host stage2 fragmentation and we
measure a cold app startup time delta before and after we tear-down
the VM.

The following metrics will be reported during atest
AVFHostTestCase#testAppStartupTime:

app_startup/com.android.settings/total_time/before_vm
app_startup/com.android.settings/wait_time/before_vm
app_startup/com.android.settings/total_time/during_vm
app_startup/com.android.settings/wait_time/during_vm
app_startup/com.android.settings/total_time/after_vm
app_startup/com.android.settings/wait_time/after_vm

Bug: 236621823
Test: Verified localy using atest
Change-Id: Iede9d6f0507c8d7e56b3e32324441ff11e54fa1e
2022-10-13 13:49:14 +00:00
David Brazdil cab9d1b964 Include 'debug.hypervisor.metrics_tag' in metric names
Vendor code can set a property to tag performance metric names. This can
be useful if devices in the lab have varying performance
characteristics.

Test: atest -p packages/modules/Virtualization:avf-postsubmit
Change-Id: I46478471571639a145079cdc296b9824f1328fc3
2022-09-26 15:15:48 +01:00
guile 3893add418 Add more time info and break down test cases in AVFHostTestCases.
Following are changes in this CL
1. add boot time info that retrieved from dmesg
2. add bootloader break time info that retrieved from prop
   "ro.boot.boottime"
3. break down to 4 cases

Bug: 236799228
Test: atest AVFHostTestCases
Change-Id: I8b8fbc12909dec56107448cb16bdc445f3bbca20
2022-09-19 08:29:14 +08:00
David Brazdil beeb104a81 Skip AVFHostTestCases on Cuttlefish
Cuttlefish does not support `adb reboot bootloader`; the instance
reboots back to Android. This breaks AVFHostTestCases that assume
each device is compatible with fastboot. Skip the affected tests, as
well as code in tearDown() which resets the device back to pKVM enabled
mode.

Test: 'atest AVFHostTestCases' on aosp_cf_x86_64_phone
Change-Id: I4fc5a47b3cb3af8f66d8493ae99cfbc44f8d3d55
2022-09-14 09:58:08 +01:00
David Brazdil c6a5f2ff49 Fix skipping testBootEnableAndDisablePKVM (take 2)
The string that the assumption looks for is actually printed on stderr,
not stdout as the code currently expects. As a result, the test was
skipped as expected on _pkvm builds, but also unexpectedly on all other
builds as well.

Bug: 236799228
Bug: 244769139
Test: atest AVFHostTestCases on oriole_pkvm-userdebug
Change-Id: Ic28c4594277520841c7eface9dcf0e8998e5e0a4
2022-09-07 13:48:12 +01:00
David Brazdil 2a3537d175 Fix metric reporting from AVFHostTestCase
Metrics are not being picked up by the CI from this test. TestMetric
object must be a @Rule.

Test: atest AVFHostTestCases
Change-Id: I02d82160196f01301e46cf4852cc5daef6cbb203
2022-09-07 13:25:14 +01:00
David Brazdil bcfa535417 Fix skipping testBootEnableAndDisablePKVM
The previous attempt in I20435fa3619ae428c167de4195ef1acf40261057
resulted in an exception, failing the test instead of skipping it.
Move the check earlier, at the beginning of the test, and make it
an assumption, not assertion.

Bug: 236799228
Bug: 244769139
Test: atest AVFHostTestCases on oriole_pkvm-userdebug
Change-Id: Ic0f1fdea3143833d9e35b85ee9470c20a08630b9
2022-09-06 14:19:59 +01:00
David Brazdil 32721cd357 Skip pKVM boot time benchmark on _pkvm builds
The recently introduced testBootEnableAndDisablePKVM fails on _pkvm
builds because the pkvm_enabler service checks if pKVM is enabled and if
not, sets the corresponding flag in the misc partition and reboots the
device. The test overrides this config in fastboot, resulting in a
bootloop and making lab devices unavailable. Skip the test if it detects
that the flag in misc has been set.

Bug: 236799228
Bug: 244769139
Test: atest AVFHostTestCases on oriole_pkvm-userdebug
Change-Id: I20435fa3619ae428c167de4195ef1acf40261057
2022-09-02 21:04:53 +01:00
Alice Wang 7f7c43966d Rename host test helper package to com.android.microdroid.test.host
This CL renames host test heper com.android.microdroid.test to
com.android.microdroid.test.host package to eventually have two
separate separate packages for the device test helper and host
test helper.

Test: atest ComposTestCase
Change-Id: I527fcb91299d87a7155ad2818fbd9b499a381f29
2022-09-02 12:50:27 +00:00
Alice Wang dc001667b1 Merge "Add MetricsProcessor to calculate metrics stats" 2022-09-02 12:37:11 +00:00
Alice Wang bc039c099b Add MetricsProcessor to calculate metrics stats
This CL adds MetricsProcessor class to calculate metrics stats
for both device tests and host tests.

Test: atest MicrodroidBenchmarks
Change-Id: I4f742d6800f14c857a5d0e0718e09870e8ca6547
2022-09-02 11:04:49 +00:00
guile ae6731af71 Fix boot time includes shutdown time issue that mention in
b/236799228#comment39

Bug: 236799228
Test: atest AVFHostTestCases
Change-Id: I40d0c07a60e9e0bff262c4bd71405bf124bac073
2022-09-02 10:33:34 +08:00
Guile Chao e042804536 Merge "Migrate pkvm_perf_test.py test_boot_time_when_pkvm_enabled and test_boot_time_when_pkvm_disabled functions to AOSP" 2022-09-02 00:46:02 +00:00
guile e429aa38a4 Migrate pkvm_perf_test.py test_boot_time_when_pkvm_enabled and
test_boot_time_when_pkvm_disabled functions to AOSP

Bug: 236799228
Test: atest AVFHostTestCases
Change-Id: I4fb8b47e4d0d9e647e73d679d68d1ef388dee949
2022-09-01 19:40:55 +08:00
David Brazdil 16ef8107b6 Skip CompOS benchmark on Cuttlefish
Compilation on staged APEX takes too long on Cuttlefish and the test
times out in postsubmits. Skip the test on Cuttlefish, like we do for
other similar tests.

Test: atest AVFHostTestCases
Change-Id: I4303e6e69b373b2a1243f481437f62b5b3a1f900
2022-09-01 02:51:17 +01:00
guile 5108b5ac37 Add AVFHostTestCases to postsubmit and fix boot time is not as expected issue.
1. abtd run post submit and confirm result is PASS. http://sponge2/0ef87667-7f24-4ca7-a3fa-eb31bbc0bf23
2. dalvik.vm.systemservercompilerfilter=speed will cause boot time is not as expected so remove it in this CL. Trace in b/243926823

Bug: 243197801
Test: atest AVFHostTestCases
Change-Id: Ie8cd9e5f6868f1cb3e297807ae651da08282b795
2022-08-29 01:00:48 +00:00
guile 828770511d Fix issues after submit aosp/2188239
1. Remove postsubmit in TEST_MAPPING. Plan to run it via ABTD to make
   sure this test case can run under TF normally. After that, will
   submit another CL to add in TEST_MAPPING.
2. Add rebootAndWaitBootCompleted in setup to make sure no staged
   session is left
3. remove assert for boot time compare temporarily
4. Add enableAdbRoot() after reboot because somehow it will become
   normal user after reboot
5. Add retry in reInstallApex() and compileStagedApex() because it seems
   after reboot sometimes the 2 functions will be fail

Bug: 243197801
Test: atest ComposBenchmarkApp
Change-Id: Icd70fc2dd1632f0b67954b2260d9d36db8249bdf
2022-08-24 20:53:47 +08:00
David Brazdil a70277067c Revert "Migrate pkvm_perf_test.py test_boot_time_without_comp_os and"
This reverts commit 5f522d766f.

Reason for revert: testBootWithAndWithoutCompOS() fails in postsubmits

Change-Id: Ie8a0da4024a38dcab691839e2ee369ba62821360
2022-08-21 07:27:51 +00:00
guile 5f522d766f Migrate pkvm_perf_test.py test_boot_time_without_comp_os and
test_boot_time_with_comp_os function to AOSP

testBootWithAndWithoutCompOS will find the boot elapsed time with and
without CompOS.

Bug: 236799228
Test: atest AVFHostTestCases
Change-Id: Ie61c40b28a9d104002fc946da8b151910fb0b0c8
2022-08-19 09:51:37 +08:00