Add RosAlloc stats dump.
For better understanding of the RosAlloc space.
(cherrypick commit 565c2d9bce43c430d4267c82f5702160d971e712)
Bug: 27744947
Bug: 9986565
Change-Id: I8309761a68fbc143bbcd8458a9194085aace7c3e
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index a96847f..01db90a 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -116,6 +116,8 @@
// For deterministic compilation, we need the heap to be at a well-known address.
static constexpr uint32_t kAllocSpaceBeginForDeterministicAoT = 0x40000000;
+// Dump the rosalloc stats on SIGQUIT.
+static constexpr bool kDumpRosAllocStatsOnSigQuit = false;
static inline bool CareAboutPauseTimes() {
return Runtime::Current()->InJankPerceptibleProcessState();
@@ -1179,6 +1181,10 @@
}
}
+ if (kDumpRosAllocStatsOnSigQuit && rosalloc_space_ != nullptr) {
+ rosalloc_space_->DumpStats(os);
+ }
+
BaseMutex::DumpAll(os);
}