From 83597d06cd4707b19c1985353418bd99f3aca6c7 Mon Sep 17 00:00:00 2001 From: Ian Rogers Date: Thu, 20 Nov 2014 10:29:00 -0800 Subject: Re-enable DumpNativeStack. Bug: 15446488 Change-Id: Icdd0b90c8abe2a361a488fc1742c6896605ddc41 --- runtime/utils.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'runtime/utils.cc') diff --git a/runtime/utils.cc b/runtime/utils.cc index 9a4c8759b8..ad46be644f 100644 --- a/runtime/utils.cc +++ b/runtime/utils.cc @@ -1120,13 +1120,20 @@ std::string GetSchedulerGroupName(pid_t tid) { void DumpNativeStack(std::ostream& os, pid_t tid, const char* prefix, mirror::ArtMethod* current_method) { - // TODO: enable on __linux__ b/15446488. -#if 0 +#if __linux__ // b/18119146 if (RUNNING_ON_VALGRIND != 0) { return; } +#if !defined(HAVE_ANDROID_OS) + if (GetTid() != tid) { + // TODO: dumping of other threads is disabled to avoid crashes during stress testing. + // b/15446488. + return; + } +#endif + std::unique_ptr backtrace(Backtrace::Create(BACKTRACE_CURRENT_PROCESS, tid)); if (!backtrace->Unwind(0)) { os << prefix << "(backtrace::Unwind failed for thread " << tid << ")\n"; -- cgit v1.2.3-59-g8ed1b