blob: ba0dcdcda2f2b2fb1a6080955e7d6df623c1c6fc [file]
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2025 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<configuration description="Config for App Memory Tests">
<option name="test-suite-tag" value="apct"/>
<option name="config-descriptor:metadata" key="component" value="systems"/>
<option name="config-descriptor:metadata" key="parameter" value="not_instant_app" />
<option name="config-descriptor:metadata" key="parameter" value="not_multi_abi" />
<option name="config-descriptor:metadata" key="parameter" value="secondary_user" />
<option name="config-descriptor:metadata" key="parameter" value="no_foldable_states" />
<option name="config-descriptor:metadata" key="test-type" value="performance" />
<option name="install-arg" value="-t -g" />
<!-- Expose shared storage for testing purpose. -->
<target_preparer class="com.android.tradefed.targetprep.DisableSELinuxTargetPreparer" />
<target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller">
<option name="cleanup-apks" value="true"/>
<option name="test-file-name" value="AppMemoryTestCases.apk"/>
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
<option name="run-command" value="rm -rf /data/local/tmp/appmemorytest"/>
<option name="run-command" value="mkdir -p /data/local/tmp/appmemorytest"/>
<option name="run-command" value="chmod a+rw /data/local/tmp/appmemorytest"/>
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="push"
value="AppMemoryTest_Helper.apk->/data/local/tmp/appmemorytest/"/>
</target_preparer>
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="push-file" key="perfetto.textproto" value="/data/misc/perfetto-traces/trace_config.textproto" />
</target_preparer>
<option name="isolated-storage" value="false" />
<test class="com.android.tradefed.testtype.AndroidJUnitTest">
<option name="package" value="android.app.memory.tests"/>
<option name="runner" value="androidx.test.runner.AndroidJUnitRunner"/>
<option name="device-listeners" value="android.device.collectors.ProcLoadListener,android.device.collectors.PerfettoListener,android.device.collectors.ShowmapSnapshotListener" />
<option name="instrumentation-arg" key="procload-collector:per_run" value="true" />
<option name="instrumentation-arg" key="proc-loadavg-threshold" value="3" />
<option name="instrumentation-arg" key="proc-loadavg-timeout" value="120000" />
<option name="instrumentation-arg" key="perfetto_config_text_proto" value="true" />
<option name="instrumentation-arg" key="perfetto_config_file" value="trace_config.textproto" />
<option name="instrumentation-arg" key="showmapsnapshot-collector:drop-cache" value="all"/>
<option name="instrumentation-arg" key="showmapsnapshot-collector:gc-precollect" value="true"/>
<option name="instrumentation-arg" key="showmapsnapshot-collector:process-names" value="android.app.memory.testhelper"/>
</test>
<metrics_collector class="com.android.tradefed.device.metric.PerfettoPullerMetricCollector">
<option name="trace-processor-binary" value="trace_processor_shell"/>
<option name="perfetto-v1-metrics" value="false"/>
<option name="perfetto-v2-metrics" value="true"/>
<option name="perfetto-v2-metrics-ids" value="appmemorytest_binder_transaction_count,appmemorytest_native_allocations_bytes"/>
<option name="summary-spec-file-name" value="appmemorytest_binder_transactions.textproto,appmemorytest_native_allocations.textproto"/>
<option name="trace-processor-timeout" value="120000"/>
<option name="pull-pattern-keys" value="^perfetto_file_path(_\d+)?$"/>
<option name="clean-up" value="false"/>
<option name="collect-on-run-ended-only" value="false"/>
</metrics_collector>
<metric_post_processor class="com.android.tradefed.postprocessor.PerfettoGenericPostProcessor">
<option name="perfetto-proto-file-prefix" value="metric_v2_perfetto"/>
<option name="perfetto-metric-filter-regex" value="appmemorytest_binder_transaction_count"/>
<option name="perfetto-metric-filter-regex" value="appmemorytest_native_allocations_bytes"/>
</metric_post_processor>
<!-- Retrieve the heap profile. It will be named "jheap_<n>.hprof". -->
<metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector">
<option name="directory-keys" value="/data/local/tmp/appmemorytest" />
<option name="pull-pattern-keys" value="jheap-*.hprof" />
<option name="pull-pattern-keys" value="jheap-*.stats" />
<option name="pull-pattern-keys" value="perfetto_file_path" />
<option name="collect-on-run-ended-only" value="true" />
<option name="clean-up" value="true" />
</metrics_collector>
</configuration>