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.

Bug: 17837911
Change-Id: I3417156a78f574076d5da17c86836c5a7c76084a
diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc
index 9b97411..495ea5c 100644
--- a/runtime/base/mutex.cc
+++ b/runtime/base/mutex.cc
@@ -647,7 +647,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 ceed254..b4462c3 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -160,6 +160,8 @@
   Runtime* runtime = Runtime::Current();
   std::ostringstream ss;
   ss << "Thread suspend timeout\n";
+  Locks::mutator_lock_->Dump(ss);
+  ss << "\n";
   runtime->GetThreadList()->DumpLocked(ss);
   LOG(FATAL) << ss.str();
   exit(0);