diff options
| author | 2017-02-03 15:06:00 -0800 | |
|---|---|---|
| committer | 2017-02-06 16:06:58 -0800 | |
| commit | 02f365f0fb74acf09ffb8f04a80d32ca1152ed8b (patch) | |
| tree | 7658baab9ac5c3c86b974d8dd5238f3cf2d9f2f0 /runtime/stack.cc | |
| parent | 7b220d60e3cb58c384a0d245106406080c6f3e37 (diff) | |
Force stack dump to diagnose empty checkpoint timeout (2).
Bug: 33006388
Bug: 12687968
Test: test-art-host
Test: Thread dumping in a simulated empty checkpoint timeout.
Change-Id: I06641396b8f3d7a1a98366a01807aab2e6f31bd5
Diffstat (limited to 'runtime/stack.cc')
| -rw-r--r-- | runtime/stack.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/runtime/stack.cc b/runtime/stack.cc index 6e0569bb5d..c737fe49ea 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -96,13 +96,17 @@ bool ManagedStack::ShadowFramesContain(StackReference<mirror::Object>* shadow_fr return false; } -StackVisitor::StackVisitor(Thread* thread, Context* context, StackWalkKind walk_kind) - : StackVisitor(thread, context, walk_kind, 0) {} +StackVisitor::StackVisitor(Thread* thread, + Context* context, + StackWalkKind walk_kind, + bool check_suspended) + : StackVisitor(thread, context, walk_kind, 0, check_suspended) {} StackVisitor::StackVisitor(Thread* thread, Context* context, StackWalkKind walk_kind, - size_t num_frames) + size_t num_frames, + bool check_suspended) : thread_(thread), walk_kind_(walk_kind), cur_shadow_frame_(nullptr), @@ -112,8 +116,11 @@ StackVisitor::StackVisitor(Thread* thread, num_frames_(num_frames), cur_depth_(0), current_inlining_depth_(0), - context_(context) { - DCHECK(thread == Thread::Current() || thread->IsSuspended()) << *thread; + context_(context), + check_suspended_(check_suspended) { + if (check_suspended_) { + DCHECK(thread == Thread::Current() || thread->IsSuspended()) << *thread; + } } InlineInfo StackVisitor::GetCurrentInlineInfo() const { @@ -788,7 +795,9 @@ QuickMethodFrameInfo StackVisitor::GetCurrentQuickFrameInfo() const { template <StackVisitor::CountTransitions kCount> void StackVisitor::WalkStack(bool include_transitions) { - DCHECK(thread_ == Thread::Current() || thread_->IsSuspended()); + if (check_suspended_) { + DCHECK(thread_ == Thread::Current() || thread_->IsSuspended()); + } CHECK_EQ(cur_depth_, 0U); bool exit_stubs_installed = Runtime::Current()->GetInstrumentation()->AreExitStubsInstalled(); uint32_t instrumentation_stack_depth = 0; |