getRuntimeStat() support (ART).

Export some runtime stats (currently GC stats) via
VMDebug.getRuntimeStat().

Added several new GC stats such as blocking GC counts and GC count
histograms.

Bug: 19825248
Change-Id: I8ece9ed241dc3982dfd983d7159090ba82940dce
diff --git a/runtime/base/histogram-inl.h b/runtime/base/histogram-inl.h
index 812ed86..0f969b9 100644
--- a/runtime/base/histogram-inl.h
+++ b/runtime/base/histogram-inl.h
@@ -165,6 +165,23 @@
 }
 
 template <class Value>
+inline void Histogram<Value>::DumpBins(std::ostream& os) const {
+  DCHECK_GT(sample_size_, 0ull);
+  bool dumped_one = false;
+  for (size_t bin_idx = 0; bin_idx < frequency_.size(); ++bin_idx) {
+    if (frequency_[bin_idx] != 0U) {
+      if (dumped_one) {
+        // Prepend a comma if not the first bin.
+        os << ",";
+      } else {
+        dumped_one = true;
+      }
+      os << GetRange(bin_idx) << ":" << frequency_[bin_idx];
+    }
+  }
+}
+
+template <class Value>
 inline void Histogram<Value>::PrintConfidenceIntervals(std::ostream &os, double interval,
                                                        const CumulativeData& data) const {
   static constexpr size_t kFractionalDigits = 3;
@@ -249,4 +266,3 @@
 
 }  // namespace art
 #endif  // ART_RUNTIME_BASE_HISTOGRAM_INL_H_
-