Dump mutator lock for thread suspend timeout

Should help us see if thread suspend timeouts are due to someone
holding on the mutator lock for too long or if it is a missed
futex wake.

(cherry picked from commit f924d2381a5ea53967ba1e279766d601b9be05ea)

Bug: 17837911
Change-Id: I3417156a78f574076d5da17c86836c5a7c76084a
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc
index 4383a7c..cbcd408 100644
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -648,7 +648,13 @@
 void ReaderWriterMutex::Dump(std::ostream& os) const {
   os << name_
       << " level=" << static_cast<int>(level_)
-      << " owner=" << GetExclusiveOwnerTid() << " ";
+      << " owner=" << GetExclusiveOwnerTid()
+#if ART_USE_FUTEXES
+      << " state=" << state_.LoadSequentiallyConsistent()
+      << " num_pending_writers=" << num_pending_writers_.LoadSequentiallyConsistent()
+      << " num_pending_readers=" << num_pending_readers_.LoadSequentiallyConsistent()
+#endif
+      << " ";
   DumpContention(os);
 }
 
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index ec5b775..53c2859 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -199,6 +199,8 @@
   Runtime* runtime = Runtime::Current();
   std::ostringstream ss;
   ss << "Thread suspend timeout\n";
+  Locks::mutator_lock_->Dump(ss);
+  ss << "\n";
   runtime->GetThreadList()->Dump(ss);
   LOG(FATAL) << ss.str();
   exit(0);