summaryrefslogtreecommitdiff
path: root/simpleperf/cmd_record.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-04-12 17:42:59 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-04-12 17:42:59 +0000
commita6ee510913c53783875a5512ff0d00a26b31eaad (patch)
treeef5b40452a30b0ced61313d64bae177255835e3e /simpleperf/cmd_record.cpp
parent7f1b4927bfe7b2e816cd95445e47476cf8fffd50 (diff)
parent40b70ffb58d830edefad2c82a9d33e1c7ce91138 (diff)
downloadextras-a6ee510913c53783875a5512ff0d00a26b31eaad.tar.gz
Merge "simpleperf: Improve the way downloading native libs on device."
Diffstat (limited to 'simpleperf/cmd_record.cpp')
-rw-r--r--simpleperf/cmd_record.cpp21
1 files changed, 4 insertions, 17 deletions
diff --git a/simpleperf/cmd_record.cpp b/simpleperf/cmd_record.cpp
index 75d17ff2..203943b4 100644
--- a/simpleperf/cmd_record.cpp
+++ b/simpleperf/cmd_record.cpp
@@ -1396,26 +1396,13 @@ bool RecordCommand::DumpBuildIdFeature() {
continue;
}
build_id_records.push_back(BuildIdRecord(true, UINT_MAX, build_id, path));
- } else {
+ } else if (dso->type() == DSO_ELF_FILE) {
if (dso->Path() == DEFAULT_EXECNAME_FOR_THREAD_MMAP) {
continue;
}
- auto tuple = SplitUrlInApk(dso->Path());
- if (std::get<0>(tuple)) {
- ElfStatus result = GetBuildIdFromApkFile(std::get<1>(tuple),
- std::get<2>(tuple), &build_id);
- if (result != ElfStatus::NO_ERROR) {
- LOG(DEBUG) << "can't read build_id from file " << dso->Path() << ": "
- << result;
- continue;
- }
- } else {
- ElfStatus result = GetBuildIdFromElfFile(dso->Path(), &build_id);
- if (result != ElfStatus::NO_ERROR) {
- LOG(DEBUG) << "can't read build_id from file " << dso->Path() << ": "
- << result;
- continue;
- }
+ if (!GetBuildIdFromDsoPath(dso->Path(), &build_id)) {
+ LOG(DEBUG) << "Can't read build_id from file " << dso->Path();
+ continue;
}
build_id_records.push_back(
BuildIdRecord(false, UINT_MAX, build_id, dso->Path()));