summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2019-10-30 16:40:55 -0700
committerYabin Cui <yabinc@google.com>2019-11-01 12:12:59 -0700
commit03317bbcf52b5f7eca07cf0a32d30d757703fd99 (patch)
tree34eaaeac5c3d0255f09d8f881e00104ba9dff933
parent5279bc29133cdf83d0c15edff5fa703c09de487c (diff)
downloadextras-03317bbcf52b5f7eca07cf0a32d30d757703fd99.tar.gz
simpleperf: test profiling apps with the same abi.
32-bit simpleperf can't profile 64-bit java app. Because simpleperf uses process_vm_readv() to read jit debug interface of the app process. If the jit debug info is at address >= 1<<32, then 32-bit simpleperf can't read it. So install apks in the same abi as the test to avoid test failure. Bug: none Test: run 32-bit simpleperf_unit_test. Change-Id: Ie3b4db320389bf5acb30ff5ea1f071b5fc3e2736
-rw-r--r--simpleperf/cmd_record_test.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/simpleperf/cmd_record_test.cpp b/simpleperf/cmd_record_test.cpp
index 701c9cc2..184f9359 100644
--- a/simpleperf/cmd_record_test.cpp
+++ b/simpleperf/cmd_record_test.cpp
@@ -747,7 +747,7 @@ TEST(record_cmd, cpu_percent_option) {
class RecordingAppHelper {
public:
bool InstallApk(const std::string& apk_path, const std::string& package_name) {
- if (Workload::RunCmd({"pm", "install", "-t", apk_path})) {
+ if (Workload::RunCmd({"pm", "install", "-t", "--abi", GetABI(), apk_path})) {
installed_packages_.emplace_back(package_name);
return true;
}
@@ -785,6 +785,20 @@ class RecordingAppHelper {
}
private:
+ const char* GetABI() {
+#if defined(__i386__)
+ return "x86";
+#elif defined(__x86_64__)
+ return "x86_64";
+#elif defined(__aarch64__)
+ return "arm64-v8a";
+#elif defined(__arm__)
+ return "armeabi-v7a";
+#else
+ #error "unrecognized ABI"
+#endif
+ }
+
std::vector<std::string> installed_packages_;
std::unique_ptr<Workload> app_start_proc_;
TemporaryFile perf_data_file_;