summaryrefslogtreecommitdiffstats
path: root/runtime/base
diff options
context:
space:
mode:
authorHiroshi Yamauchi <yamauchi@google.com>2015-04-02 10:18:12 -0700
committerHiroshi Yamauchi <yamauchi@google.com>2015-04-13 15:37:40 -0700
commita1c9f013c034fbddb9337cc5c7ecf0e5a8b77547 (patch)
tree77a722cae515f6b3c7ea54f5b0fd2435682ae55b /runtime/base
parent67592a44cd5600b3c007b9215e3e5296a61118e8 (diff)
downloadart-a1c9f013c034fbddb9337cc5c7ecf0e5a8b77547.zip
art-a1c9f013c034fbddb9337cc5c7ecf0e5a8b77547.tar.gz
art-a1c9f013c034fbddb9337cc5c7ecf0e5a8b77547.tar.bz2
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
Diffstat (limited to 'runtime/base')
-rw-r--r--runtime/base/histogram-inl.h18
-rw-r--r--runtime/base/histogram.h1
2 files changed, 18 insertions, 1 deletions
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 @@ inline void Histogram<Value>::PrintBins(std::ostream& os, const CumulativeData&
}
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 @@ inline double Histogram<Value>::Percentile(double per, const CumulativeData& dat
} // namespace art
#endif // ART_RUNTIME_BASE_HISTOGRAM_INL_H_
-
diff --git a/runtime/base/histogram.h b/runtime/base/histogram.h
index 78f6e1c..c312fb2 100644
--- a/runtime/base/histogram.h
+++ b/runtime/base/histogram.h
@@ -61,6 +61,7 @@ template <class Value> class Histogram {
void PrintConfidenceIntervals(std::ostream& os, double interval,
const CumulativeData& data) const;
void PrintBins(std::ostream& os, const CumulativeData& data) const;
+ void DumpBins(std::ostream& os) const;
Value GetRange(size_t bucket_idx) const;
size_t GetBucketCount() const;