summaryrefslogtreecommitdiff
path: root/simpleperf/dwarf_unwind.cpp
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-03-31 14:39:19 -0700
committerYabin Cui <yabinc@google.com>2016-04-01 10:54:47 -0700
commit4b6720d137c15b9485318255e89ffcd3c76ab579 (patch)
tree4c624d63da960690396c0c9e8d03d9fb84d96443 /simpleperf/dwarf_unwind.cpp
parenteaa9c1dc0c2c7bd4570e0b7c605bac207e6ab3a3 (diff)
downloadextras-4b6720d137c15b9485318255e89ffcd3c76ab579.tar.gz
simpleperf: loosen unwinding arch check for system wide collection.
When doing system wide collection, it is possible that there are 32-bit compat processes running on 64-bit devices. It is not proper to abort in this situation. So loosen the check to allow it. Also add corresponding test. Bug: 27927427 Change-Id: I5c9253eb6e474497e4f37e234e0e523e141fab20
Diffstat (limited to 'simpleperf/dwarf_unwind.cpp')
-rw-r--r--simpleperf/dwarf_unwind.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/simpleperf/dwarf_unwind.cpp b/simpleperf/dwarf_unwind.cpp
index 39bbef17..10baeb64 100644
--- a/simpleperf/dwarf_unwind.cpp
+++ b/simpleperf/dwarf_unwind.cpp
@@ -95,11 +95,12 @@ static ucontext_t BuildUContextFromRegs(const RegSet& regs __attribute__((unused
}
std::vector<uint64_t> UnwindCallChain(ArchType arch, const ThreadEntry& thread,
- const RegSet& regs, const std::vector<char>& stack) {
+ const RegSet& regs, const std::vector<char>& stack,
+ bool strict_arch_check) {
std::vector<uint64_t> result;
- if (arch != GetBuildArch()) {
+ if (!IsArchTheSame(arch, GetBuildArch(), strict_arch_check)) {
LOG(FATAL) << "simpleperf is built in arch " << GetArchString(GetBuildArch())
- << ", and can't do stack unwinding for arch " << GetArchString(arch);
+ << ", and can't do stack unwinding for arch " << GetArchString(arch);
return result;
}
uint64_t sp_reg_value;