diff options
-rw-r--r-- | runtime/thread_list.cc | 9 |
1 files changed, 6 insertions, 3 deletions
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::DumpNativeStacks(std::ostream& os) { 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); |