summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-format13
-rw-r--r--PREUPLOAD.cfg6
-rw-r--r--audio_loopback_test/Android.mk22
-rw-r--r--audio_loopback_test/AndroidTest.xml27
-rw-r--r--audio_loopback_test/AudioLoopbackTest.py132
-rw-r--r--audio_loopback_test/README.md18
-rw-r--r--audio_loopback_test/__init__.py0
-rw-r--r--hwbinder_latency_test/HwBinderLatencyTest.py107
-rw-r--r--hwbinder_latency_test/__init__.py0
-rw-r--r--hwbinder_latency_test/binderize/Android.mk22
-rw-r--r--hwbinder_latency_test/binderize/AndroidTest.xml35
-rw-r--r--hwbinder_latency_test/binderize/HwBinderBinderizeLatencyTest.config3
-rw-r--r--hwbinder_latency_test/binderize_systrace/Android.mk22
-rw-r--r--hwbinder_latency_test/binderize_systrace/AndroidTest.xml36
-rw-r--r--hwbinder_latency_test/passthrough/Android.mk22
-rw-r--r--hwbinder_latency_test/passthrough/AndroidTest.xml35
-rw-r--r--hwbinder_latency_test/passthrough/HwBinderPassthroughLatencyTest.config3
-rw-r--r--hwbinder_latency_test/passthrough_systrace/Android.mk22
-rw-r--r--hwbinder_latency_test/passthrough_systrace/AndroidTest.xml36
-rw-r--r--res/Loopback.apkbin0 -> 1334431 bytes
20 files changed, 561 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..6027082
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,13 @@
+---
+Language: Cpp
+BasedOnStyle: Google
+ColumnLimit: 80
+IndentWidth: 2
+ContinuationIndentWidth: 4
+---
+Language: Java
+BasedOnStyle: Google
+ColumnLimit: 100
+IndentWidth: 4
+ContinuationIndentWidth: 8
+...
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
new file mode 100644
index 0000000..6be6e5f
--- /dev/null
+++ b/PREUPLOAD.cfg
@@ -0,0 +1,6 @@
+[Builtin Hooks]
+clang_format = true
+
+[Builtin Hooks Options]
+clang_format = --commit ${PREUPLOAD_COMMIT} --style file --extensions c,h,cc,cpp,java
+
diff --git a/audio_loopback_test/Android.mk b/audio_loopback_test/Android.mk
new file mode 100644
index 0000000..75eac6a
--- /dev/null
+++ b/audio_loopback_test/Android.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2017 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.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := AudioLoopbackTest
+VTS_CONFIG_SRC_DIR := testcases/performance/audio_loopback_test
+-include test/vts/tools/build/Android.host_config.mk
diff --git a/audio_loopback_test/AndroidTest.xml b/audio_loopback_test/AndroidTest.xml
new file mode 100644
index 0000000..89a67d7
--- /dev/null
+++ b/audio_loopback_test/AndroidTest.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 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 VTS Sensor Module HIDL Audio Loopback test case">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="push-group" value="HostDrivenTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="DATA/performance/res/Loopback.apk->/data/local/tmp/Loopback.apk" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer" />
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-case-path" value="vts/testcases/performance/audio_loopback_test/AudioLoopbackTest" />
+ <option name="test-timeout" value="10m"/>
+ </test>
+</configuration>
diff --git a/audio_loopback_test/AudioLoopbackTest.py b/audio_loopback_test/AudioLoopbackTest.py
new file mode 100644
index 0000000..10c1b51
--- /dev/null
+++ b/audio_loopback_test/AudioLoopbackTest.py
@@ -0,0 +1,132 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2017 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.
+#
+
+import logging
+import math
+import os
+
+from time import sleep
+from vts.runners.host import asserts
+from vts.runners.host import base_test
+from vts.runners.host import const
+from vts.runners.host import test_runner
+from vts.utils.python.controllers import android_device
+
+
+class AudioLoopbackTest(base_test.BaseTestClass):
+ """A test module for the Audio Loopback Benchmark."""
+
+ # Threshold for average latency and standard deviation.
+ THRESHOLD = {"MAX_LATENCY": 20000000, }
+
+ TEST_DATA_DIR = "audiotest"
+ FULL_DATA_DIR_PATH = os.path.join("/mnt/sdcard/", TEST_DATA_DIR)
+ TEST_FILE_PREFIX = "out"
+ TEST_FILE_NAME = os.path.join(FULL_DATA_DIR_PATH,
+ TEST_FILE_PREFIX + ".txt")
+ ITERATION = 100
+
+ def setUpClass(self):
+ self.dut = self.registerController(android_device)[0]
+ self.dut.shell.InvokeTerminal("one")
+ self.dut.adb.shell("mkdir -p %s" % self.FULL_DATA_DIR_PATH)
+ # install Loopback.apk
+ self.dut.adb.shell("pm install -r -g /data/local/tmp/Loopback.apk")
+
+ def tearDown(self):
+ self.dut.adb.shell("rm -rf %s" % self.FULL_DATA_DIR_PATH)
+
+ def ProcessTestResults(self, latencies, confidences):
+ """Process test results and upload to web dashboard.
+
+ Calculate the average and standard deviation of latencies from all test run.
+ Only test results with confidence = 1.0 are counted.
+
+ Args:
+ latencies: List of latency (in ns) get from each run. e.g.[8040000]
+ confidences: List of confidence get from each run. e.g. [0.98, 1.0]
+ """
+ total_latency = 0
+ total_run = 0
+ for latency, confidence in zip(latencies, confidences):
+ # filter test runs with confidence < 1.0
+ if confidence < 1.0:
+ latencies.remove(latency)
+ else:
+ total_latency += latency
+ total_run += 1
+ asserts.assertLess(0, total_run, "No valid runs.")
+ self.web.AddProfilingDataUnlabeledVector(
+ "AVG_LATENCY",
+ latencies,
+ x_axis_label="AVG Roundtrip latency (ns)",
+ y_axis_label="Frequency")
+ # calculate the average latency.
+ avg_latency = total_latency / total_run
+ logging.info("avg_latency: %s", avg_latency)
+ asserts.assertLess(avg_latency, self.THRESHOLD["MAX_LATENCY"],
+ "avg latency exceeds threshold")
+ # calculate the standard deviation of latencies.
+ sd = 0.0
+ for latency in latencies:
+ sd += (latency - avg_latency) * (latency - avg_latency)
+ sd = int(math.sqrt(sd / total_run))
+ logging.info("standard_deviation: %s", sd)
+ self.web.AddProfilingDataUnlabeledVector(
+ "STANDARD_DEVIATION", [sd],
+ x_axis_label="Standard deviation",
+ y_axis_label="Frequency")
+
+ def testRun(self):
+ """Runs test in audio Loopback.apk and process the test results."""
+ latencies = []
+ confidences = []
+ for i in range(0, self.ITERATION):
+ self.dut.shell.one.Execute(
+ ["rm -f %s/*" % self.FULL_DATA_DIR_PATH])
+ self.dut.shell.one.Execute([
+ "am start -n org.drrickorang.loopback/.LoopbackActivity "
+ "--es FileName %s/%s --ei AudioLevel 11 --ei TestType 222;" %
+ (self.TEST_DATA_DIR, self.TEST_FILE_PREFIX)
+ ])
+ # wait until the test finished.
+ results = self.dut.shell.one.Execute(
+ ["ls %s" % self.TEST_FILE_NAME])
+ while results[const.EXIT_CODE][0]:
+ logging.info("Test is running...")
+ sleep(1)
+ results = self.dut.shell.one.Execute(
+ ["ls %s" % self.TEST_FILE_NAME])
+
+ results = self.dut.shell.one.Execute(
+ ["cat %s" % self.TEST_FILE_NAME])
+ asserts.assertFalse(results[const.EXIT_CODE][0],
+ "Fail to get the test output")
+ stdout_lines = results[const.STDOUT][0].split("\n")
+ for line in stdout_lines:
+ if line.startswith("LatencyMs"):
+ latencies.append(
+ int(
+ float(line.replace("LatencyMs = ", "")) * 1000000))
+ if line.startswith("LatencyConfidence"):
+ confidences.append(
+ float(line.replace("LatencyConfidence = ", "")))
+ self.ProcessTestResults(latencies, confidences)
+
+
+if __name__ == "__main__":
+ test_runner.main()
diff --git a/audio_loopback_test/README.md b/audio_loopback_test/README.md
new file mode 100644
index 0000000..35a2596
--- /dev/null
+++ b/audio_loopback_test/README.md
@@ -0,0 +1,18 @@
+The AudioLoopbackTest is used to test round-trip audio performance over headset jack and USB.
+It is based on the Loopback.apk run with Loopback dongle: https://source.android.com/devices/audio/loopback
+
+* How to run the test?
+ 1. plug in the Loopback dongle to your device.
+ 2. `make vts`
+ 3. `vts-tradefed run vts -m AudioLoopbackTest`
+
+* What metrics this test report?
+ 1. Average round-trip latency.
+ 2. Standard deviation of round-trip latency.
+
+* Which version of Loopback.apk is used in the test?
+ The Loopback.apk used in this test is Loopback-v17 copied from https://tradefed.teams.x20web.corp.google.com/testdata/media/apps/
+
+* Where can I get the source code for the Loopback.apk?
+ Internal developer: https://googleplex-android.git.corp.google.com/platform/vendor/google_toolbox/+/master/user/rago/studio/LoopbackApp/
+ Open source: https://github.com/gkasten/drrickorang \ No newline at end of file
diff --git a/audio_loopback_test/__init__.py b/audio_loopback_test/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/audio_loopback_test/__init__.py
diff --git a/hwbinder_latency_test/HwBinderLatencyTest.py b/hwbinder_latency_test/HwBinderLatencyTest.py
new file mode 100644
index 0000000..5d70625
--- /dev/null
+++ b/hwbinder_latency_test/HwBinderLatencyTest.py
@@ -0,0 +1,107 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2017 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.
+#
+
+import json
+import logging
+
+from vts.runners.host import asserts
+from vts.runners.host import base_test
+from vts.runners.host import const
+from vts.runners.host import test_runner
+from vts.utils.python.controllers import android_device
+from vts.utils.python.cpu import cpu_frequency_scaling
+
+
+class HwBinderLatencyTest(base_test.BaseTestClass):
+ """A test case for the hwbinder latency benchmarking."""
+
+ def setUpClass(self):
+ required_params = ["hidl_hal_mode"]
+ self.getUserParams(required_params)
+ self.dut = self.registerController(android_device)[0]
+ self.dut.shell.InvokeTerminal("one")
+ self._cpu_freq = cpu_frequency_scaling.CpuFrequencyScalingController(self.dut)
+ self._cpu_freq.DisableCpuScaling()
+
+ def setUp(self):
+ self._cpu_freq.SkipIfThermalThrottling(retry_delay_secs=30)
+
+ def tearDown(self):
+ self._cpu_freq.SkipIfThermalThrottling()
+
+ def tearDownClass(self):
+ self._cpu_freq.EnableCpuScaling()
+
+ def testRunBenchmark32Bit(self):
+ self._uploadResult(self._runBenchmark(32), 32)
+
+ def testRunBenchmark64Bit(self):
+ self._uploadResult(self._runBenchmark(64), 64)
+
+ def _runBenchmark(self, bits):
+ """Runs the native binary and parses its result.
+
+ Args:
+ bits: integer (32 or 64), the bitness of the binary to run.
+
+ Returns:
+ dict, the benchmarking result converted from native binary's JSON
+ output.
+ """
+ logging.info("Start %d-bit hwbinder latency test with HIDL mode=%s",
+ bits, self.hidl_hal_mode)
+ binary = "/data/local/tmp/%s/libhwbinder_latency%s" % (bits, bits)
+ min_cpu, max_cpu = self._cpu_freq.GetMinAndMaxCpuNo()
+ iterations = 1000 // (max_cpu - min_cpu)
+ results = self.dut.shell.one.Execute([
+ "chmod 755 %s" % binary,
+ "LD_LIBRARY_PATH=/system/lib%s:/data/local/tmp/%s/hw:"
+ "/data/local/tmp/%s:$LD_LIBRARY_PATH "
+ "%s -raw_data -pair %d -i %d -m %s" % (bits, bits, bits,
+ binary, max_cpu - min_cpu, iterations,
+ self.hidl_hal_mode.encode("utf-8"))])
+ # Parses the result.
+ asserts.assertEqual(len(results[const.STDOUT]), 2)
+ logging.info("stderr: %s", results[const.STDERR][1])
+ logging.info("stdout: %s", results[const.STDOUT][1])
+ asserts.assertFalse(
+ any(results[const.EXIT_CODE]),
+ "testRunBenchmark%sBit failed." % (bits))
+ json_result = json.loads(results[const.STDOUT][1]);
+ asserts.assertTrue(json_result["inheritance"] == "PASS",
+ "Scheduler does not support priority inheritance.");
+ return json_result
+
+ def _uploadResult(self, result, bits):
+ """Uploads the output of benchmark program to web DB.
+
+ Args:
+ result: dict which is the benchmarking result.
+ bits: integer (32 or 64).
+ """
+ opts = ["hidl_hal_mode=%s" % self.hidl_hal_mode.encode("utf-8")];
+ min_cpu, max_cpu = self._cpu_freq.GetMinAndMaxCpuNo()
+ for i in range(max_cpu - min_cpu):
+ self.web.AddProfilingDataUnlabeledVector(
+ "hwbinder_latency_%sbits" % bits,
+ result["fifo_%d_data" % i], options=opts,
+ x_axis_label="hwbinder latency",
+ y_axis_label="Frequency")
+
+
+if __name__ == "__main__":
+ test_runner.main()
diff --git a/hwbinder_latency_test/__init__.py b/hwbinder_latency_test/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/hwbinder_latency_test/__init__.py
diff --git a/hwbinder_latency_test/binderize/Android.mk b/hwbinder_latency_test/binderize/Android.mk
new file mode 100644
index 0000000..9c440a4
--- /dev/null
+++ b/hwbinder_latency_test/binderize/Android.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2017 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.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HwBinderBinderizeLatencyTest
+VTS_CONFIG_SRC_DIR := testcases/performance/hwbinder_latency_test/binderize
+include test/vts/tools/build/Android.host_config.mk
diff --git a/hwbinder_latency_test/binderize/AndroidTest.xml b/hwbinder_latency_test/binderize/AndroidTest.xml
new file mode 100644
index 0000000..0c47d69
--- /dev/null
+++ b/hwbinder_latency_test/binderize/AndroidTest.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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 VTS libhwbinder latency tests">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="abort-on-push-failure" value="false" />
+ <option name="push-group" value="HostDrivenTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="DATA/lib/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/32/android.hardware.tests.libhwbinder@1.0.so" />
+ <option name="push" value="DATA/lib64/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/64/android.hardware.tests.libhwbinder@1.0.so" />
+ <option name="push" value="DATA/nativetest/libhwbinder_latency/libhwbinder_latency->/data/local/tmp/32/libhwbinder_latency32" />
+ <option name="push" value="DATA/nativetest64/libhwbinder_latency/libhwbinder_latency->/data/local/tmp/64/libhwbinder_latency64" />
+ <option name="push" value="DATA/vendor/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/vendor/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
+ <option name="push" value="DATA/vendor/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/vendor/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="HwBinderBinderizeLatencyTest" />
+ <option name="test-case-path" value="vts/testcases/performance/hwbinder_latency_test/HwBinderLatencyTest" />
+ <option name="test-config-path" value="vts/testcases/performance/hwbinder_latency_test/binderize/HwBinderBinderizeLatencyTest.config" />
+ </test>
+</configuration>
diff --git a/hwbinder_latency_test/binderize/HwBinderBinderizeLatencyTest.config b/hwbinder_latency_test/binderize/HwBinderBinderizeLatencyTest.config
new file mode 100644
index 0000000..fc792a7
--- /dev/null
+++ b/hwbinder_latency_test/binderize/HwBinderBinderizeLatencyTest.config
@@ -0,0 +1,3 @@
+{
+ "hidl_hal_mode": "BINDERIZE"
+}
diff --git a/hwbinder_latency_test/binderize_systrace/Android.mk b/hwbinder_latency_test/binderize_systrace/Android.mk
new file mode 100644
index 0000000..e716aa7
--- /dev/null
+++ b/hwbinder_latency_test/binderize_systrace/Android.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2017 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.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HwBinderBinderizeLatencySystraceTest
+VTS_CONFIG_SRC_DIR := testcases/performance/hwbinder_latency_test/binderize_systrace
+include test/vts/tools/build/Android.host_config.mk
diff --git a/hwbinder_latency_test/binderize_systrace/AndroidTest.xml b/hwbinder_latency_test/binderize_systrace/AndroidTest.xml
new file mode 100644
index 0000000..a6ca43f
--- /dev/null
+++ b/hwbinder_latency_test/binderize_systrace/AndroidTest.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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 VTS libhwbinder latency tests with systrace">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="abort-on-push-failure" value="false" />
+ <option name="push-group" value="HostDrivenTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="DATA/lib/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/32/android.hardware.tests.libhwbinder@1.0.so" />
+ <option name="push" value="DATA/lib64/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/64/android.hardware.tests.libhwbinder@1.0.so" />
+ <option name="push" value="DATA/nativetest/libhwbinder_latency/libhwbinder_latency->/data/local/tmp/32/libhwbinder_latency32" />
+ <option name="push" value="DATA/nativetest64/libhwbinder_latency/libhwbinder_latency->/data/local/tmp/64/libhwbinder_latency64" />
+ <option name="push" value="DATA/vendor/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/vendor/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
+ <option name="push" value="DATA/vendor/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/vendor/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="HwBinderBinderizeLatencySystraceTest" />
+ <option name="test-case-path" value="vts/testcases/performance/hwbinder_latency_test/HwBinderLatencyTest" />
+ <option name="test-config-path" value="vts/testcases/performance/hwbinder_latency_test/binderize/HwBinderBinderizeLatencyTest.config" />
+ <option name="enable-systrace" value="true" />
+ </test>
+</configuration>
diff --git a/hwbinder_latency_test/passthrough/Android.mk b/hwbinder_latency_test/passthrough/Android.mk
new file mode 100644
index 0000000..12ca61f
--- /dev/null
+++ b/hwbinder_latency_test/passthrough/Android.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2017 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.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HwBinderPassthroughLatencyTest
+VTS_CONFIG_SRC_DIR := testcases/performance/hwbinder_latency_test/passthrough
+include test/vts/tools/build/Android.host_config.mk
diff --git a/hwbinder_latency_test/passthrough/AndroidTest.xml b/hwbinder_latency_test/passthrough/AndroidTest.xml
new file mode 100644
index 0000000..d6b8f86
--- /dev/null
+++ b/hwbinder_latency_test/passthrough/AndroidTest.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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 VTS libhwbinder latency tests">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="abort-on-push-failure" value="false" />
+ <option name="push-group" value="HostDrivenTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="DATA/lib/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/32/android.hardware.tests.libhwbinder@1.0.so" />
+ <option name="push" value="DATA/lib64/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/64/android.hardware.tests.libhwbinder@1.0.so" />
+ <option name="push" value="DATA/nativetest/libhwbinder_latency/libhwbinder_latency->/data/local/tmp/32/libhwbinder_latency32" />
+ <option name="push" value="DATA/nativetest64/libhwbinder_latency/libhwbinder_latency->/data/local/tmp/64/libhwbinder_latency64" />
+ <option name="push" value="DATA/vendor/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/vendor/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
+ <option name="push" value="DATA/vendor/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/vendor/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="HwBinderPassthroughLatencyTest" />
+ <option name="test-case-path" value="vts/testcases/performance/hwbinder_latency_test/HwBinderLatencyTest" />
+ <option name="test-config-path" value="vts/testcases/performance/hwbinder_latency_test/passthrough/HwBinderPassthroughLatencyTest.config" />
+ </test>
+</configuration>
diff --git a/hwbinder_latency_test/passthrough/HwBinderPassthroughLatencyTest.config b/hwbinder_latency_test/passthrough/HwBinderPassthroughLatencyTest.config
new file mode 100644
index 0000000..54d9875
--- /dev/null
+++ b/hwbinder_latency_test/passthrough/HwBinderPassthroughLatencyTest.config
@@ -0,0 +1,3 @@
+{
+ "hidl_hal_mode": "PASSTHROUGH"
+}
diff --git a/hwbinder_latency_test/passthrough_systrace/Android.mk b/hwbinder_latency_test/passthrough_systrace/Android.mk
new file mode 100644
index 0000000..3a619e0
--- /dev/null
+++ b/hwbinder_latency_test/passthrough_systrace/Android.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2017 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.
+#
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := HwBinderPassthroughLatencySystraceTest
+VTS_CONFIG_SRC_DIR := testcases/performance/hwbinder_latency_test/passthrough_systrace
+include test/vts/tools/build/Android.host_config.mk
diff --git a/hwbinder_latency_test/passthrough_systrace/AndroidTest.xml b/hwbinder_latency_test/passthrough_systrace/AndroidTest.xml
new file mode 100644
index 0000000..767abcb
--- /dev/null
+++ b/hwbinder_latency_test/passthrough_systrace/AndroidTest.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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 VTS libhwbinder latency tests with systrace">
+ <target_preparer class="com.android.compatibility.common.tradefed.targetprep.VtsFilePusher">
+ <option name="abort-on-push-failure" value="false" />
+ <option name="push-group" value="HostDrivenTest.push" />
+ <option name="cleanup" value="true" />
+ <option name="push" value="DATA/lib/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/32/android.hardware.tests.libhwbinder@1.0.so" />
+ <option name="push" value="DATA/lib64/android.hardware.tests.libhwbinder@1.0.so->/data/local/tmp/64/android.hardware.tests.libhwbinder@1.0.so" />
+ <option name="push" value="DATA/nativetest/libhwbinder_latency/libhwbinder_latency->/data/local/tmp/32/libhwbinder_latency32" />
+ <option name="push" value="DATA/nativetest64/libhwbinder_latency/libhwbinder_latency->/data/local/tmp/64/libhwbinder_latency64" />
+ <option name="push" value="DATA/vendor/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/vendor/lib/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
+ <option name="push" value="DATA/vendor/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so->/vendor/lib64/hw/android.hardware.tests.libhwbinder@1.0-impl.so" />
+ </target_preparer>
+ <target_preparer class="com.android.tradefed.targetprep.VtsPythonVirtualenvPreparer">
+ </target_preparer>
+ <test class="com.android.tradefed.testtype.VtsMultiDeviceTest">
+ <option name="test-module-name" value="HwBinderPassthroughLatencySystraceTest" />
+ <option name="test-case-path" value="vts/testcases/performance/hwbinder_latency_test/HwBinderLatencyTest" />
+ <option name="test-config-path" value="vts/testcases/performance/hwbinder_latency_test/passthrough/HwBinderPassthroughLatencyTest.config" />
+ <option name="enable-systrace" value="true" />
+ </test>
+</configuration>
diff --git a/res/Loopback.apk b/res/Loopback.apk
new file mode 100644
index 0000000..589a4b7
--- /dev/null
+++ b/res/Loopback.apk
Binary files differ