summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/trace.cc10
-rw-r--r--runtime/trace.h2
2 files changed, 3 insertions, 9 deletions
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 3a410ef9d4..29f67f075e 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -928,14 +928,7 @@ void TraceWriter::FinishTracing(int flags, bool flush_entries) {
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::DumpMethodList(std::ostream& os) {
}
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 7ff68132fc..b6f047e63e 100644
--- a/runtime/trace.h
+++ b/runtime/trace.h
@@ -253,7 +253,7 @@ class TraceWriter {
// 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_;