diff options
author | Yabin Cui <yabinc@google.com> | 2019-11-01 22:23:43 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-11-01 22:23:43 +0000 |
commit | 16f464c22672bfead26433af4e061e0bcbfa054f (patch) | |
tree | cd762306a7599ab655b83cc4642415d5d2535923 | |
parent | 3abdb9286007b6412885510f7642ad8a00adc6ec (diff) | |
parent | 03317bbcf52b5f7eca07cf0a32d30d757703fd99 (diff) | |
download | extras-16f464c22672bfead26433af4e061e0bcbfa054f.tar.gz |
Merge "simpleperf: test profiling apps with the same abi."
-rw-r--r-- | simpleperf/cmd_record_test.cpp | 16 |
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_; |