summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/gc/heap.h3
-rw-r--r--runtime/native/dalvik_system_VMDebug.cc10
2 files changed, 13 insertions, 0 deletions
diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h
index 5d0ba8ff89..53eed6be19 100644
--- a/runtime/gc/heap.h
+++ b/runtime/gc/heap.h
@@ -850,6 +850,9 @@ class Heap {
uint64_t GetBlockingGcTime() const;
void DumpGcCountRateHistogram(std::ostream& os) const REQUIRES(!*gc_complete_lock_);
void DumpBlockingGcCountRateHistogram(std::ostream& os) const REQUIRES(!*gc_complete_lock_);
+ uint64_t GetTotalTimeWaitingForGC() const {
+ return total_wait_time_;
+ }
// Perfetto Art Heap Profiler Support.
HeapSampler& GetHeapSampler() {
diff --git a/runtime/native/dalvik_system_VMDebug.cc b/runtime/native/dalvik_system_VMDebug.cc
index d1683a92e6..5c8bd8431a 100644
--- a/runtime/native/dalvik_system_VMDebug.cc
+++ b/runtime/native/dalvik_system_VMDebug.cc
@@ -313,6 +313,8 @@ enum class VMDebugRuntimeStatId {
kArtGcBlockingGcTime,
kArtGcGcCountRateHistogram,
kArtGcBlockingGcCountRateHistogram,
+ kArtGcObjectsAllocated,
+ kArtGcTotalTimeWaitingForGc,
kNumRuntimeStats,
};
@@ -353,6 +355,14 @@ static jstring VMDebug_getRuntimeStatInternal(JNIEnv* env, jclass, jint statId)
heap->DumpBlockingGcCountRateHistogram(output);
return env->NewStringUTF(output.str().c_str());
}
+ case VMDebugRuntimeStatId::kArtGcObjectsAllocated: {
+ std::string output = std::to_string(heap->GetObjectsAllocated());
+ return env->NewStringUTF(output.c_str());
+ }
+ case VMDebugRuntimeStatId::kArtGcTotalTimeWaitingForGc: {
+ std::string output = std::to_string(heap->GetTotalTimeWaitingForGC());
+ return env->NewStringUTF(output.c_str());
+ }
default:
return nullptr;
}