From 23f6e69e374ce4a7fd0d45f633a3c9efcc8e8a07 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 18 Dec 2014 18:24:39 -0800 Subject: Only dump suspend all histogram if we have samples Helps fix gcstress ThreadStress. Bug: 18576985 Change-Id: Ibebc0fed8a21e7b149f4b6e5154fb86deddcc68f --- runtime/thread_list.cc | 9 ++++++--- 1 file 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::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::CumulativeData data; + suspend_all_historam_.CreateHistogram(&data); + suspend_all_historam_.PrintConfidenceIntervals(os, 0.99, data); // Dump time to suspend. + } } Dump(os); DumpUnattachedThreads(os); -- cgit v1.1