Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 17 | #include "OfflineUnwinder.h" |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 18 | |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 19 | #include <sys/mman.h> |
| 20 | |
Elliott Hughes | 66dd09e | 2015-12-04 14:00:57 -0800 | [diff] [blame] | 21 | #include <android-base/logging.h> |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 22 | #include <unwindstack/MachineArm.h> |
| 23 | #include <unwindstack/MachineArm64.h> |
| 24 | #include <unwindstack/MachineX86.h> |
| 25 | #include <unwindstack/MachineX86_64.h> |
Yabin Cui | cdc11a3 | 2018-03-20 15:29:03 -0700 | [diff] [blame] | 26 | #include <unwindstack/Maps.h> |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 27 | #include <unwindstack/Regs.h> |
| 28 | #include <unwindstack/RegsArm.h> |
| 29 | #include <unwindstack/RegsArm64.h> |
| 30 | #include <unwindstack/RegsX86.h> |
| 31 | #include <unwindstack/RegsX86_64.h> |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 32 | #include <unwindstack/Unwinder.h> |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 33 | #include <unwindstack/UserArm.h> |
| 34 | #include <unwindstack/UserArm64.h> |
| 35 | #include <unwindstack/UserX86.h> |
| 36 | #include <unwindstack/UserX86_64.h> |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 37 | |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 38 | #include "environment.h" |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 39 | #include "perf_regs.h" |
Christopher Ferris | 1101768 | 2017-12-14 15:53:37 -0800 | [diff] [blame] | 40 | #include "read_apk.h" |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 41 | #include "thread_tree.h" |
| 42 | |
Yabin Cui | cdc11a3 | 2018-03-20 15:29:03 -0700 | [diff] [blame] | 43 | static_assert(simpleperf::map_flags::PROT_JIT_SYMFILE_MAP == |
| 44 | unwindstack::MAPS_FLAGS_JIT_SYMFILE_MAP, ""); |
| 45 | |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 46 | namespace simpleperf { |
| 47 | |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 48 | // Max frames seen so far is 463, in http://b/110923759. |
| 49 | static constexpr size_t MAX_UNWINDING_FRAMES = 512; |
| 50 | |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 51 | static unwindstack::Regs* GetBacktraceRegs(const RegSet& regs) { |
| 52 | switch (regs.arch) { |
| 53 | case ARCH_ARM: { |
| 54 | unwindstack::arm_user_regs arm_user_regs; |
| 55 | memset(&arm_user_regs, 0, sizeof(arm_user_regs)); |
| 56 | static_assert( |
| 57 | static_cast<int>(unwindstack::ARM_REG_R0) == static_cast<int>(PERF_REG_ARM_R0), ""); |
| 58 | static_assert( |
| 59 | static_cast<int>(unwindstack::ARM_REG_LAST) == static_cast<int>(PERF_REG_ARM_MAX), ""); |
| 60 | for (size_t i = unwindstack::ARM_REG_R0; i < unwindstack::ARM_REG_LAST; ++i) { |
| 61 | arm_user_regs.regs[i] = static_cast<uint32_t>(regs.data[i]); |
| 62 | } |
| 63 | return unwindstack::RegsArm::Read(&arm_user_regs); |
| 64 | } |
| 65 | case ARCH_ARM64: { |
| 66 | unwindstack::arm64_user_regs arm64_user_regs; |
| 67 | memset(&arm64_user_regs, 0, sizeof(arm64_user_regs)); |
| 68 | static_assert( |
| 69 | static_cast<int>(unwindstack::ARM64_REG_R0) == static_cast<int>(PERF_REG_ARM64_X0), ""); |
| 70 | static_assert( |
| 71 | static_cast<int>(unwindstack::ARM64_REG_R30) == static_cast<int>(PERF_REG_ARM64_LR), ""); |
| 72 | memcpy(&arm64_user_regs.regs[unwindstack::ARM64_REG_R0], ®s.data[PERF_REG_ARM64_X0], |
| 73 | sizeof(uint64_t) * (PERF_REG_ARM64_LR - PERF_REG_ARM64_X0 + 1)); |
| 74 | arm64_user_regs.sp = regs.data[PERF_REG_ARM64_SP]; |
| 75 | arm64_user_regs.pc = regs.data[PERF_REG_ARM64_PC]; |
| 76 | return unwindstack::RegsArm64::Read(&arm64_user_regs); |
| 77 | } |
| 78 | case ARCH_X86_32: { |
| 79 | unwindstack::x86_user_regs x86_user_regs; |
| 80 | memset(&x86_user_regs, 0, sizeof(x86_user_regs)); |
| 81 | x86_user_regs.eax = static_cast<uint32_t>(regs.data[PERF_REG_X86_AX]); |
| 82 | x86_user_regs.ebx = static_cast<uint32_t>(regs.data[PERF_REG_X86_BX]); |
| 83 | x86_user_regs.ecx = static_cast<uint32_t>(regs.data[PERF_REG_X86_CX]); |
| 84 | x86_user_regs.edx = static_cast<uint32_t>(regs.data[PERF_REG_X86_DX]); |
| 85 | x86_user_regs.ebp = static_cast<uint32_t>(regs.data[PERF_REG_X86_BP]); |
| 86 | x86_user_regs.edi = static_cast<uint32_t>(regs.data[PERF_REG_X86_DI]); |
| 87 | x86_user_regs.esi = static_cast<uint32_t>(regs.data[PERF_REG_X86_SI]); |
| 88 | x86_user_regs.esp = static_cast<uint32_t>(regs.data[PERF_REG_X86_SP]); |
| 89 | x86_user_regs.eip = static_cast<uint32_t>(regs.data[PERF_REG_X86_IP]); |
| 90 | return unwindstack::RegsX86::Read(&x86_user_regs); |
| 91 | } |
| 92 | case ARCH_X86_64: { |
| 93 | unwindstack::x86_64_user_regs x86_64_user_regs; |
| 94 | memset(&x86_64_user_regs, 0, sizeof(x86_64_user_regs)); |
| 95 | x86_64_user_regs.rax = regs.data[PERF_REG_X86_AX]; |
| 96 | x86_64_user_regs.rbx = regs.data[PERF_REG_X86_BX]; |
| 97 | x86_64_user_regs.rcx = regs.data[PERF_REG_X86_CX]; |
| 98 | x86_64_user_regs.rdx = regs.data[PERF_REG_X86_DX]; |
| 99 | x86_64_user_regs.r8 = regs.data[PERF_REG_X86_R8]; |
| 100 | x86_64_user_regs.r9 = regs.data[PERF_REG_X86_R9]; |
| 101 | x86_64_user_regs.r10 = regs.data[PERF_REG_X86_R10]; |
| 102 | x86_64_user_regs.r11 = regs.data[PERF_REG_X86_R11]; |
| 103 | x86_64_user_regs.r12 = regs.data[PERF_REG_X86_R12]; |
| 104 | x86_64_user_regs.r13 = regs.data[PERF_REG_X86_R13]; |
| 105 | x86_64_user_regs.r14 = regs.data[PERF_REG_X86_R14]; |
| 106 | x86_64_user_regs.r15 = regs.data[PERF_REG_X86_R15]; |
| 107 | x86_64_user_regs.rdi = regs.data[PERF_REG_X86_DI]; |
| 108 | x86_64_user_regs.rsi = regs.data[PERF_REG_X86_SI]; |
| 109 | x86_64_user_regs.rbp = regs.data[PERF_REG_X86_BP]; |
| 110 | x86_64_user_regs.rsp = regs.data[PERF_REG_X86_SP]; |
| 111 | x86_64_user_regs.rip = regs.data[PERF_REG_X86_IP]; |
| 112 | return unwindstack::RegsX86_64::Read(&x86_64_user_regs); |
| 113 | } |
| 114 | default: |
| 115 | return nullptr; |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 116 | } |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 117 | } |
| 118 | |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 119 | static unwindstack::MapInfo* CreateMapInfo(const MapEntry* entry) { |
| 120 | const char* name = entry->dso->GetDebugFilePath().c_str(); |
| 121 | uint64_t pgoff = entry->pgoff; |
| 122 | if (entry->pgoff == 0) { |
| 123 | auto tuple = SplitUrlInApk(entry->dso->GetDebugFilePath()); |
| 124 | if (std::get<0>(tuple)) { |
| 125 | // The unwinder does not understand the ! format, so change back to |
| 126 | // the previous format (apk, offset). |
| 127 | EmbeddedElf* elf = ApkInspector::FindElfInApkByName(std::get<1>(tuple), std::get<2>(tuple)); |
| 128 | if (elf != nullptr) { |
| 129 | name = elf->filepath().c_str(); |
| 130 | pgoff = elf->entry_offset(); |
| 131 | } |
| 132 | } |
| 133 | } |
Christopher Ferris | 2fed0f1 | 2018-10-03 14:14:36 -0700 | [diff] [blame] | 134 | return new unwindstack::MapInfo(nullptr, entry->start_addr, entry->get_end_addr(), pgoff, |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 135 | PROT_READ | PROT_EXEC | entry->flags, name); |
| 136 | } |
| 137 | |
| 138 | void UnwindMaps::UpdateMaps(const MapSet& map_set) { |
| 139 | if (version_ == map_set.version) { |
| 140 | return; |
| 141 | } |
| 142 | version_ = map_set.version; |
| 143 | size_t i = 0; |
| 144 | size_t old_size = entries_.size(); |
| 145 | for (auto it = map_set.maps.begin(); it != map_set.maps.end();) { |
| 146 | const MapEntry* entry = it->second; |
| 147 | if (i < old_size && entry == entries_[i]) { |
| 148 | i++; |
| 149 | ++it; |
| 150 | } else if (i == old_size || entry->start_addr <= entries_[i]->start_addr) { |
| 151 | // Add an entry. |
| 152 | entries_.push_back(entry); |
Florian Mayer | 50818b7 | 2019-02-27 19:35:01 +0000 | [diff] [blame] | 153 | maps_.emplace_back(CreateMapInfo(entry)); |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 154 | ++it; |
| 155 | } else { |
| 156 | // Remove an entry. |
| 157 | entries_[i] = nullptr; |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 158 | maps_[i++] = nullptr; |
| 159 | } |
| 160 | } |
| 161 | while (i < old_size) { |
| 162 | entries_[i] = nullptr; |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 163 | maps_[i++] = nullptr; |
| 164 | } |
Florian Mayer | 50818b7 | 2019-02-27 19:35:01 +0000 | [diff] [blame] | 165 | std::sort(entries_.begin(), entries_.end(), [](const auto& e1, const auto& e2) { |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 166 | if (e1 == nullptr || e2 == nullptr) { |
| 167 | return e1 != nullptr; |
| 168 | } |
| 169 | return e1->start_addr < e2->start_addr; |
| 170 | }); |
| 171 | std::sort(maps_.begin(), maps_.end(), |
Florian Mayer | 50818b7 | 2019-02-27 19:35:01 +0000 | [diff] [blame] | 172 | [](const auto& m1, const auto& m2) { |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 173 | if (m1 == nullptr || m2 == nullptr) { |
| 174 | return m1 != nullptr; |
| 175 | } |
| 176 | return m1->start < m2->start; |
| 177 | }); |
| 178 | entries_.resize(map_set.maps.size()); |
| 179 | maps_.resize(map_set.maps.size()); |
| 180 | } |
| 181 | |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 182 | OfflineUnwinder::OfflineUnwinder(bool collect_stat) : collect_stat_(collect_stat) { |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 183 | unwindstack::Elf::SetCachingEnabled(true); |
Christopher Ferris | 1101768 | 2017-12-14 15:53:37 -0800 | [diff] [blame] | 184 | } |
| 185 | |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 186 | bool OfflineUnwinder::UnwindCallChain(const ThreadEntry& thread, const RegSet& regs, |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 187 | const char* stack, size_t stack_size, |
| 188 | std::vector<uint64_t>* ips, std::vector<uint64_t>* sps) { |
| 189 | uint64_t start_time; |
| 190 | if (collect_stat_) { |
| 191 | start_time = GetSystemClock(); |
| 192 | } |
Yabin Cui | 5d5c01a | 2018-08-27 10:30:20 -0700 | [diff] [blame] | 193 | is_callchain_broken_for_incomplete_jit_debug_info_ = false; |
| 194 | ips->clear(); |
| 195 | sps->clear(); |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 196 | std::vector<uint64_t> result; |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 197 | uint64_t sp_reg_value; |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 198 | if (!regs.GetSpRegValue(&sp_reg_value)) { |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 199 | LOG(ERROR) << "can't get sp reg value"; |
Yabin Cui | 81a9d33 | 2017-12-10 13:09:07 -0800 | [diff] [blame] | 200 | return false; |
| 201 | } |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 202 | uint64_t stack_addr = sp_reg_value; |
| 203 | |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 204 | UnwindMaps& cached_map = cached_maps_[thread.pid]; |
| 205 | cached_map.UpdateMaps(*thread.maps); |
| 206 | std::shared_ptr<unwindstack::MemoryOfflineBuffer> stack_memory( |
| 207 | new unwindstack::MemoryOfflineBuffer(reinterpret_cast<const uint8_t*>(stack), |
| 208 | stack_addr, stack_addr + stack_size)); |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 209 | std::unique_ptr<unwindstack::Regs> unwind_regs(GetBacktraceRegs(regs)); |
Christopher Ferris | 15933b6 | 2018-02-22 19:06:42 -0800 | [diff] [blame] | 210 | if (!unwind_regs) { |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 211 | return false; |
Christopher Ferris | 1101768 | 2017-12-14 15:53:37 -0800 | [diff] [blame] | 212 | } |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 213 | unwindstack::Unwinder unwinder(MAX_UNWINDING_FRAMES, &cached_map, unwind_regs.get(), |
| 214 | stack_memory); |
| 215 | unwinder.SetResolveNames(false); |
| 216 | unwinder.Unwind(); |
Yabin Cui | 5d5c01a | 2018-08-27 10:30:20 -0700 | [diff] [blame] | 217 | size_t last_jit_method_frame = UINT_MAX; |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 218 | for (auto& frame : unwinder.frames()) { |
| 219 | // Unwinding in arm architecture can return 0 pc address. |
Yabin Cui | 1848010 | 2018-04-19 17:34:18 -0700 | [diff] [blame] | 220 | |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 221 | // If frame.map.start == 0, this frame doesn't hit any map, it could be: |
| 222 | // 1. In an executable map not backed by a file. Note that RecordCommand::ShouldOmitRecord() |
| 223 | // may omit maps only exist memory. |
| 224 | // 2. An incorrectly unwound frame. Like caused by invalid stack data, as in |
Yabin Cui | 5d5c01a | 2018-08-27 10:30:20 -0700 | [diff] [blame] | 225 | // SampleRecord::GetValidStackSize(). Or caused by incomplete JIT debug info. |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 226 | // We want to remove this frame and callchains following it in either case. |
| 227 | if (frame.pc == 0 || frame.map_start == 0) { |
Yabin Cui | 5d5c01a | 2018-08-27 10:30:20 -0700 | [diff] [blame] | 228 | is_callchain_broken_for_incomplete_jit_debug_info_ = true; |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 229 | break; |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 230 | } |
Yabin Cui | 5d5c01a | 2018-08-27 10:30:20 -0700 | [diff] [blame] | 231 | if (frame.map_flags & unwindstack::MAPS_FLAGS_JIT_SYMFILE_MAP) { |
| 232 | last_jit_method_frame = ips->size(); |
| 233 | } |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 234 | ips->push_back(frame.pc); |
| 235 | sps->push_back(frame.sp); |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 236 | } |
Yabin Cui | 5d5c01a | 2018-08-27 10:30:20 -0700 | [diff] [blame] | 237 | // If the unwound frames stop near to a JITed method, it may be caused by incomplete JIT debug |
| 238 | // info. |
| 239 | if (last_jit_method_frame != UINT_MAX && last_jit_method_frame + 3 > ips->size()) { |
| 240 | is_callchain_broken_for_incomplete_jit_debug_info_ = true; |
| 241 | } |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 242 | |
| 243 | uint64_t ip_reg_value; |
| 244 | if (!regs.GetIpRegValue(&ip_reg_value)) { |
| 245 | LOG(ERROR) << "can't get ip reg value"; |
| 246 | return false; |
| 247 | } |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 248 | if (ips->empty()) { |
Yabin Cui | 43dabd5 | 2018-01-22 15:11:07 -0800 | [diff] [blame] | 249 | ips->push_back(ip_reg_value); |
| 250 | sps->push_back(sp_reg_value); |
Yabin Cui | 6e75e1b | 2018-02-06 13:42:16 -0800 | [diff] [blame] | 251 | } else { |
| 252 | // Check if the unwinder returns ip reg value as the first ip address in callstack. |
| 253 | CHECK_EQ((*ips)[0], ip_reg_value); |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 254 | } |
| 255 | if (collect_stat_) { |
| 256 | unwinding_result_.used_time = GetSystemClock() - start_time; |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 257 | switch (unwinder.LastErrorCode()) { |
| 258 | case unwindstack::ERROR_MAX_FRAMES_EXCEEDED: |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 259 | unwinding_result_.stop_reason = UnwindingResult::EXCEED_MAX_FRAMES_LIMIT; |
| 260 | break; |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 261 | case unwindstack::ERROR_MEMORY_INVALID: { |
| 262 | uint64_t addr = unwinder.LastErrorAddress(); |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 263 | // Because we don't have precise stack range here, just guess an addr is in stack |
| 264 | // if sp - 128K <= addr <= sp. |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 265 | if (addr <= stack_addr && addr >= stack_addr - 128 * 1024) { |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 266 | unwinding_result_.stop_reason = UnwindingResult::ACCESS_STACK_FAILED; |
| 267 | } else { |
| 268 | unwinding_result_.stop_reason = UnwindingResult::ACCESS_MEM_FAILED; |
| 269 | } |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 270 | unwinding_result_.stop_info.addr = addr; |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 271 | break; |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 272 | } |
| 273 | case unwindstack::ERROR_INVALID_MAP: |
Yabin Cui | 750b373 | 2017-12-18 17:46:36 -0800 | [diff] [blame] | 274 | unwinding_result_.stop_reason = UnwindingResult::MAP_MISSING; |
| 275 | break; |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 276 | default: |
| 277 | unwinding_result_.stop_reason = UnwindingResult::UNKNOWN_REASON; |
| 278 | break; |
| 279 | } |
Yabin Cui | a6a0420 | 2018-07-23 15:32:47 -0700 | [diff] [blame] | 280 | unwinding_result_.stack_start = stack_addr; |
| 281 | unwinding_result_.stack_end = stack_addr + stack_size; |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 282 | } |
| 283 | return true; |
Yabin Cui | 3c8c213 | 2015-08-13 20:30:20 -0700 | [diff] [blame] | 284 | } |
Yabin Cui | 0338145 | 2017-12-13 11:31:53 -0800 | [diff] [blame] | 285 | |
| 286 | } // namespace simpleperf |