Remove debug code added for b/280558212 am: 01d49e00c1 am: a21053b9aa

Original change: https://android-review.googlesource.com/c/platform/art/+/2965055

Change-Id: I5c723d8aa09590d638fc43d446230d936c661617
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
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_;