1<?xml version="1.0" encoding="utf-8"?> 2<!-- Copyright (C) 2024 The Android Open Source Project 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15--> 16<configuration description="Runs CoroutineTracingPerfTests metric instrumentation."> 17 <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/> 18 <!-- Needed for pushing the trace config file --> 19 <target_preparer class="com.android.tradefed.targetprep.PushFilePreparer"> 20 <option name="push-file" key="trace_config_detailed.textproto" value="/data/misc/perfetto-traces/trace_config.textproto" /> 21 </target_preparer> 22 23 <target_preparer class="com.android.tradefed.targetprep.TestFilePushSetup" /> 24 <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer" /> 25 26 <target_preparer class="com.android.tradefed.targetprep.suite.SuiteApkInstaller"> 27 <option name="cleanup-apks" value="true" /> 28 <option name="test-file-name" value="CoroutineTracingPerfTests.apk" /> 29 </target_preparer> 30 31 <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer"> 32 <option name="run-command" value="input keyevent KEYCODE_WAKEUP" /> 33 </target_preparer> 34 35 <!-- Needed for pulling the collected trace config on to the host --> 36 <metrics_collector class="com.android.tradefed.device.metric.FilePullerLogCollector"> 37 <option name="pull-pattern-keys" value="perfetto_file_path" /> 38 </metrics_collector> 39 40 <!-- Needed for storing the perfetto trace files in the sdcard/test_results --> 41 <option name="isolated-storage" value="false" /> 42 43 <test class="com.android.tradefed.testtype.AndroidJUnitTest" > 44 <option name="package" value="com.android.app.tracing.benchmark" /> 45 <!-- <option name="runner" value="androidx.test.runner.AndroidJUnitRunner" /> --> 46 47 <option name="device-listeners" value="android.device.collectors.ProcLoadListener,android.device.collectors.PerfettoListener" /> 48 <!-- ProcLoadListener related arguments --> 49 <!-- Wait for device last minute threshold to reach 3 with 2 minute timeout before starting the test run --> 50 <option name="instrumentation-arg" key="procload-collector:per_run" value="true" /> 51 <option name="instrumentation-arg" key="proc-loadavg-threshold" value="3" /> 52 <option name="instrumentation-arg" key="proc-loadavg-timeout" value="120000" /> 53 <option name="instrumentation-arg" key="proc-loadavg-interval" value="10000" /> 54 55 <!-- PerfettoListener related arguments --> 56 <option name="instrumentation-arg" key="perfetto_config_text_proto" value="true" /> 57 <option name="instrumentation-arg" key="perfetto_config_file" value="trace_config.textproto" /> 58 59 <option name="instrumentation-arg" key="newRunListenerMode" value="true" /> 60 </test> 61</configuration> 62