summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2020-04-27 21:57:41 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-04-27 21:57:41 +0000
commit12f716a5719f8daa22c660227116a87b8d368d85 (patch)
tree8cea14064600005543d4dd428e23d97a48d89dae
parentbc7e29b9165fb883bedb2a197fa1e2f9b7c9cc66 (diff)
parent6ce3e08d009ef343d787ab254885df9e399f7eb3 (diff)
downloadextras-platform-tools-30.0.1.tar.gz
Merge "Snap for 6435660 from 546a5481f37d7420939fb26dd950afd786b262f6 to sdk-release" into sdk-releaseplatform-tools-30.0.1
-rw-r--r--partition_tools/aidl/Android.bp1
-rw-r--r--simpleperf/cmd_inject_test.cpp18
-rw-r--r--simpleperf/cmd_record_test.cpp3
3 files changed, 13 insertions, 9 deletions
diff --git a/partition_tools/aidl/Android.bp b/partition_tools/aidl/Android.bp
index 60be072f..f031150f 100644
--- a/partition_tools/aidl/Android.bp
+++ b/partition_tools/aidl/Android.bp
@@ -16,6 +16,7 @@
aidl_interface {
name: "liblpdump_interface",
+ unstable: true,
srcs: [
"android/lpdump/ILpdump.aidl",
],
diff --git a/simpleperf/cmd_inject_test.cpp b/simpleperf/cmd_inject_test.cpp
index ab20afdb..64a32b87 100644
--- a/simpleperf/cmd_inject_test.cpp
+++ b/simpleperf/cmd_inject_test.cpp
@@ -45,15 +45,20 @@ static bool RunInjectCmd(std::vector<std::string>&& args, std::string* output) {
return android::base::ReadFileToString(tmpfile.path, output);
}
+static void CheckMatchingExpectedData(std::string& data) {
+ std::string expected_data;
+ ASSERT_TRUE(android::base::ReadFileToString(
+ GetTestData(std::string("etm") + OS_PATH_SEPARATOR + "perf_inject.data"), &expected_data));
+ data.erase(std::remove(data.begin(), data.end(), '\r'), data.end());
+ ASSERT_EQ(data, expected_data);
+}
+
TEST(cmd_inject, smoke) {
std::string data;
ASSERT_TRUE(RunInjectCmd({}, &data));
// Test that we can find instr range in etm_test_loop binary.
ASSERT_NE(data.find("etm_test_loop"), std::string::npos);
- std::string expected_data;
- ASSERT_TRUE(android::base::ReadFileToString(
- GetTestData(std::string("etm") + OS_PATH_SEPARATOR + "perf_inject.data"), &expected_data));
- ASSERT_EQ(data, expected_data);
+ CheckMatchingExpectedData(data);
}
TEST(cmd_inject, binary_option) {
@@ -81,10 +86,7 @@ TEST(cmd_inject, output_option) {
ASSERT_TRUE(RunInjectCmd({"--output", "branch-list", "-o", tmpfile.path}));
std::string autofdo_data;
ASSERT_TRUE(RunInjectCmd({"-i", tmpfile.path, "--output", "autofdo"}, &autofdo_data));
- std::string expected_data;
- ASSERT_TRUE(android::base::ReadFileToString(
- GetTestData(std::string("etm") + OS_PATH_SEPARATOR + "perf_inject.data"), &expected_data));
- ASSERT_EQ(autofdo_data, expected_data);
+ CheckMatchingExpectedData(autofdo_data);
}
TEST(cmd_inject, branch_to_proto_string) {
diff --git a/simpleperf/cmd_record_test.cpp b/simpleperf/cmd_record_test.cpp
index 25b7f9c2..161f8239 100644
--- a/simpleperf/cmd_record_test.cpp
+++ b/simpleperf/cmd_record_test.cpp
@@ -302,7 +302,8 @@ bool HasHardwareCounter() {
std::string hardware = GetHardwareFromCpuInfo(cpu_info);
if (std::regex_search(hardware, std::regex(R"(i\.MX6.*Quad)")) ||
std::regex_search(hardware, std::regex(R"(SC7731e)")) ||
- std::regex_search(hardware, std::regex(R"(Qualcomm Technologies, Inc MSM8909)"))) {
+ std::regex_search(hardware, std::regex(R"(Qualcomm Technologies, Inc MSM8909)")) ||
+ std::regex_search(hardware, std::regex(R"(Broadcom STB \(Flattened Device Tree\))"))) {
has_hw_counter = 0;
}
}