summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/backtrace_helper.cc35
-rw-r--r--runtime/backtrace_helper.h4
-rw-r--r--runtime/deoptimization_kind.h2
-rw-r--r--runtime/entrypoints/runtime_asm_entrypoints.h4
4 files changed, 4 insertions, 41 deletions
diff --git a/runtime/backtrace_helper.cc b/runtime/backtrace_helper.cc
index 2d39270b53..98280c779f 100644
--- a/runtime/backtrace_helper.cc
+++ b/runtime/backtrace_helper.cc
@@ -26,8 +26,6 @@
#include "unwindstack/Memory.h"
#include "unwindstack/Unwinder.h"
-#include "base/bit_utils.h"
-#include "entrypoints/runtime_asm_entrypoints.h"
#include "thread-inl.h"
#else
@@ -58,9 +56,6 @@ struct UnwindHelper : public TLSData {
unwindstack::Elf::SetCachingEnabled(true);
}
- // Reparse process mmaps to detect newly loaded libraries.
- bool Reparse() { return maps_.Reparse(); }
-
static UnwindHelper* Get(Thread* self, size_t max_depth) {
UnwindHelper* tls = reinterpret_cast<UnwindHelper*>(self->GetCustomTLS(kTlsKey));
if (tls == nullptr) {
@@ -73,7 +68,7 @@ struct UnwindHelper : public TLSData {
unwindstack::Unwinder* Unwinder() { return &unwinder_; }
private:
- unwindstack::LocalUpdatableMaps maps_;
+ unwindstack::LocalMaps maps_;
std::shared_ptr<unwindstack::Memory> memory_;
unwindstack::JitDebug jit_;
unwindstack::DexFiles dex_;
@@ -81,41 +76,19 @@ struct UnwindHelper : public TLSData {
};
void BacktraceCollector::Collect() {
- if (!CollectImpl()) {
- // Reparse process mmaps to detect newly loaded libraries and retry.
- UnwindHelper::Get(Thread::Current(), max_depth_)->Reparse();
- if (!CollectImpl()) {
- // Failed to unwind stack. Ignore for now.
- }
- }
-}
-
-bool BacktraceCollector::CollectImpl() {
unwindstack::Unwinder* unwinder = UnwindHelper::Get(Thread::Current(), max_depth_)->Unwinder();
std::unique_ptr<unwindstack::Regs> regs(unwindstack::Regs::CreateFromLocal());
RegsGetLocal(regs.get());
unwinder->SetRegs(regs.get());
unwinder->Unwind();
-
num_frames_ = 0;
if (unwinder->NumFrames() > skip_count_) {
- for (auto it = unwinder->frames().begin() + skip_count_; it != unwinder->frames().end(); ++it) {
- CHECK_LT(num_frames_, max_depth_);
+ for (auto it = unwinder->frames().begin() + skip_count_;
+ max_depth_ > num_frames_ && it != unwinder->frames().end();
+ ++it) {
out_frames_[num_frames_++] = static_cast<uintptr_t>(it->pc);
-
- // Expected early end: Instrumentation breaks unwinding (b/138296821).
- size_t align = GetInstructionSetAlignment(kRuntimeISA);
- if (RoundUp(it->pc, align) == reinterpret_cast<uintptr_t>(GetQuickInstrumentationExitPc())) {
- return true;
- }
}
}
-
- if (unwinder->LastErrorCode() == unwindstack::ERROR_INVALID_MAP) {
- return false;
- }
-
- return true;
}
#else
diff --git a/runtime/backtrace_helper.h b/runtime/backtrace_helper.h
index 2fee62c23d..8eda3fa0a1 100644
--- a/runtime/backtrace_helper.h
+++ b/runtime/backtrace_helper.h
@@ -36,10 +36,6 @@ class BacktraceCollector {
void Collect();
private:
- // Try to collect backtrace. Returns false on failure.
- // It is used to retry backtrace on temporary failure.
- bool CollectImpl();
-
uintptr_t* const out_frames_ = nullptr;
size_t num_frames_ = 0u;
const size_t max_depth_ = 0u;
diff --git a/runtime/deoptimization_kind.h b/runtime/deoptimization_kind.h
index 5be6f3dab1..14e189c5d1 100644
--- a/runtime/deoptimization_kind.h
+++ b/runtime/deoptimization_kind.h
@@ -17,8 +17,6 @@
#ifndef ART_RUNTIME_DEOPTIMIZATION_KIND_H_
#define ART_RUNTIME_DEOPTIMIZATION_KIND_H_
-#include "base/logging.h"
-
namespace art {
enum class DeoptimizationKind {
diff --git a/runtime/entrypoints/runtime_asm_entrypoints.h b/runtime/entrypoints/runtime_asm_entrypoints.h
index f350ce458d..3f4e91ed91 100644
--- a/runtime/entrypoints/runtime_asm_entrypoints.h
+++ b/runtime/entrypoints/runtime_asm_entrypoints.h
@@ -19,12 +19,8 @@
#include "deoptimization_kind.h"
-#include "jni.h"
-
namespace art {
-class ArtMethod;
-
#ifndef BUILDING_LIBART
#error "File and symbols only for use within libart."
#endif