summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2019-11-01 15:46:32 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-11-01 15:46:32 -0700
commitd24f22a9504d39f64b7f5d2ac949226ca68711ba (patch)
treecd762306a7599ab655b83cc4642415d5d2535923
parent7dfbc49b0ec1e4bcf0a41c206d398407ecc9f8b9 (diff)
parent16f464c22672bfead26433af4e061e0bcbfa054f (diff)
downloadextras-d24f22a9504d39f64b7f5d2ac949226ca68711ba.tar.gz
Merge "simpleperf: test profiling apps with the same abi."
am: 16f464c226 Change-Id: I33d4f7c58ac0ce4e04b88eb0732ebd0ff892be30
-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_;