Remove debug code added for b/280558212
The bug is fixed. There were several code changes around that area and
not sure if the bug is fixed because of the debug code we added or
because of other changes. Removing the debug code to see if it happens
again.
Bug: 280558212
Change-Id: I466377cf05a74d077f719f04422f5783bf859c4e
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 3a410ef..29f67f0 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -928,14 +928,7 @@
os << "gc-count=" << Runtime::Current()->GetStat(KIND_GC_INVOCATIONS) << "\n";
}
os << StringPrintf("%cthreads\n", kTraceTokenChar);
- {
- // TODO(b/280558212): Moving the Mutexlock out of DumpThreadList to try and
- // narrow down where seg fault is happening. Change this after the bug is
- // fixed.
- CHECK_NE(self, nullptr);
- MutexLock mu(self, tracing_lock_);
- DumpThreadList(os);
- }
+ DumpThreadList(os);
os << StringPrintf("%cmethods\n", kTraceTokenChar);
DumpMethodList(os);
os << StringPrintf("%cend\n", kTraceTokenChar);
@@ -1498,6 +1491,7 @@
}
void TraceWriter::DumpThreadList(std::ostream& os) {
+ MutexLock mu(Thread::Current(), tracing_lock_);
for (const auto& it : threads_list_) {
os << it.first << "\t" << it.second << "\n";
}
diff --git a/runtime/trace.h b/runtime/trace.h
index 7ff6813..b6f047e 100644
--- a/runtime/trace.h
+++ b/runtime/trace.h
@@ -253,7 +253,7 @@
// Methods to output traced methods and threads.
void DumpMethodList(std::ostream& os) REQUIRES_SHARED(Locks::mutator_lock_)
REQUIRES(!tracing_lock_);
- void DumpThreadList(std::ostream& os) REQUIRES(!Locks::thread_list_lock_) REQUIRES(tracing_lock_);
+ void DumpThreadList(std::ostream& os) REQUIRES(!Locks::thread_list_lock_, !tracing_lock_);
// File to write trace data out to, null if direct to ddms.
std::unique_ptr<File> trace_file_;