Only dump suspend all histogram if we have samples

Helps fix gcstress ThreadStress.

Bug: 18576985
Change-Id: Ibebc0fed8a21e7b149f4b6e5154fb86deddcc68f
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc
index 968e89d..9707c7b 100644
--- a/runtime/thread_list.cc
+++ b/runtime/thread_list.cc
@@ -101,9 +101,12 @@
 void ThreadList::DumpForSigQuit(std::ostream& os) {
   {
     ScopedObjectAccess soa(Thread::Current());
-    Histogram<uint64_t>::CumulativeData data;
-    suspend_all_historam_.CreateHistogram(&data);
-    suspend_all_historam_.PrintConfidenceIntervals(os, 0.99, data);  // Dump time to suspend.
+    // Only print if we have samples.
+    if (suspend_all_historam_.SampleSize() > 0) {
+      Histogram<uint64_t>::CumulativeData data;
+      suspend_all_historam_.CreateHistogram(&data);
+      suspend_all_historam_.PrintConfidenceIntervals(os, 0.99, data);  // Dump time to suspend.
+    }
   }
   Dump(os);
   DumpUnattachedThreads(os);