diff options
| author | 2018-11-16 16:32:40 +0000 | |
|---|---|---|
| committer | 2018-11-16 16:32:40 +0000 | |
| commit | 4d57c69ab7753690738d9dc802b5b640cb6af491 (patch) | |
| tree | a26e2840a559a0214c532293166d3bd03a9dac0f | |
| parent | fe21070898e13cb5e6111d8749a97a679994eb5d (diff) | |
Revert "ART: add GC time ratio metrics to GC performance"
This reverts commit fe21070898e13cb5e6111d8749a97a679994eb5d.
Reason for revert: Segfaults when CC is not enabled.
Bug: 112187497
Change-Id: I9757097981a8120d893b0dbbd630ac4a87090a1d
Test: TreeHugger
| -rw-r--r-- | runtime/gc/collector/garbage_collector.cc | 13 | ||||
| -rw-r--r-- | runtime/gc/collector/garbage_collector.h | 4 | ||||
| -rw-r--r-- | runtime/gc/heap.cc | 6 | ||||
| -rw-r--r-- | runtime/gc/heap.h | 2 | ||||
| -rw-r--r-- | runtime/runtime.cc | 10 | ||||
| -rw-r--r-- | runtime/runtime.h | 3 |
6 files changed, 4 insertions, 34 deletions
diff --git a/runtime/gc/collector/garbage_collector.cc b/runtime/gc/collector/garbage_collector.cc index 0294db7b7e..5e3692ea9a 100644 --- a/runtime/gc/collector/garbage_collector.cc +++ b/runtime/gc/collector/garbage_collector.cc @@ -77,9 +77,8 @@ void GarbageCollector::RegisterPause(uint64_t nano_length) { void GarbageCollector::ResetCumulativeStatistics() { cumulative_timings_.Reset(); - total_thread_cpu_time_ns_ = 0u; - total_time_ns_ = 0u; - total_freed_objects_ = 0u; + total_time_ns_ = 0; + total_freed_objects_ = 0; total_freed_bytes_ = 0; MutexLock mu(Thread::Current(), pause_histogram_lock_); pause_histogram_.Reset(); @@ -89,7 +88,6 @@ void GarbageCollector::Run(GcCause gc_cause, bool clear_soft_references) { ScopedTrace trace(android::base::StringPrintf("%s %s GC", PrettyCause(gc_cause), GetName())); Thread* self = Thread::Current(); uint64_t start_time = NanoTime(); - uint64_t thread_cpu_start_time = ThreadCpuNanoTime(); Iteration* current_iteration = GetCurrentIteration(); current_iteration->Reset(gc_cause, clear_soft_references); // Note transaction mode is single-threaded and there's no asynchronous GC and this flag doesn't @@ -104,8 +102,6 @@ void GarbageCollector::Run(GcCause gc_cause, bool clear_soft_references) { total_freed_bytes_ += current_iteration->GetFreedBytes() + current_iteration->GetFreedLargeObjectBytes(); uint64_t end_time = NanoTime(); - uint64_t thread_cpu_end_time = ThreadCpuNanoTime(); - total_thread_cpu_time_ns_ += thread_cpu_end_time - thread_cpu_start_time; current_iteration->SetDurationNs(end_time - start_time); if (Locks::mutator_lock_->IsExclusiveHeld(self)) { // The entire GC was paused, clear the fake pauses which might be in the pause times and add @@ -163,9 +159,8 @@ void GarbageCollector::ResetMeasurements() { pause_histogram_.Reset(); } cumulative_timings_.Reset(); - total_thread_cpu_time_ns_ = 0u; - total_time_ns_ = 0u; - total_freed_objects_ = 0u; + total_time_ns_ = 0; + total_freed_objects_ = 0; total_freed_bytes_ = 0; } diff --git a/runtime/gc/collector/garbage_collector.h b/runtime/gc/collector/garbage_collector.h index 2857881456..f722e8d855 100644 --- a/runtime/gc/collector/garbage_collector.h +++ b/runtime/gc/collector/garbage_collector.h @@ -81,9 +81,6 @@ class GarbageCollector : public RootVisitor, public IsMarkedVisitor, public Mark void SwapBitmaps() REQUIRES(Locks::heap_bitmap_lock_) REQUIRES_SHARED(Locks::mutator_lock_); - uint64_t GetTotalCpuTime() const { - return total_thread_cpu_time_ns_; - } uint64_t GetTotalPausedTimeNs() REQUIRES(!pause_histogram_lock_); int64_t GetTotalFreedBytes() const { return total_freed_bytes_; @@ -149,7 +146,6 @@ class GarbageCollector : public RootVisitor, public IsMarkedVisitor, public Mark std::string name_; // Cumulative statistics. Histogram<uint64_t> pause_histogram_ GUARDED_BY(pause_histogram_lock_); - uint64_t total_thread_cpu_time_ns_; uint64_t total_time_ns_; uint64_t total_freed_objects_; int64_t total_freed_bytes_; diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc index 71c23926d3..f0f81fc67e 100644 --- a/runtime/gc/heap.cc +++ b/runtime/gc/heap.cc @@ -1062,12 +1062,6 @@ void Heap::RemoveSpace(space::Space* space) { } } -uint64_t Heap::GetTotalGcCpuTime() { - uint64_t sum = 0; - sum += young_concurrent_copying_collector_->GetTotalCpuTime(); - sum += concurrent_copying_collector_->GetTotalCpuTime(); - return sum; -} void Heap::DumpGcPerformanceInfo(std::ostream& os) { // Dump cumulative timings. os << "Dumping cumulative Gc timings\n"; diff --git a/runtime/gc/heap.h b/runtime/gc/heap.h index a43f3156f5..c3ee5267b5 100644 --- a/runtime/gc/heap.h +++ b/runtime/gc/heap.h @@ -395,8 +395,6 @@ class Heap { REQUIRES(!Locks::heap_bitmap_lock_) REQUIRES(Locks::mutator_lock_); - uint64_t GetTotalGcCpuTime(); - // Set target ideal heap utilization ratio, implements // dalvik.system.VMRuntime.setTargetHeapUtilization. void SetTargetHeapUtilization(float target); diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 7367706deb..3dfa0c4b6a 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -279,7 +279,6 @@ Runtime::Runtime() // Initially assume we perceive jank in case the process state is never updated. process_state_(kProcessStateJankPerceptible), zygote_no_threads_(false), - process_cpu_start_time_(ProcessCpuNanoTime()), verifier_logging_threshold_ms_(100) { static_assert(Runtime::kCalleeSaveSize == static_cast<uint32_t>(CalleeSaveType::kLastCalleeSaveType), "Unexpected size"); @@ -323,20 +322,11 @@ Runtime::~Runtime() { } if (dump_gc_performance_on_shutdown_) { - process_cpu_end_time_ = ProcessCpuNanoTime(); ScopedLogSeverity sls(LogSeverity::INFO); // This can't be called from the Heap destructor below because it // could call RosAlloc::InspectAll() which needs the thread_list // to be still alive. heap_->DumpGcPerformanceInfo(LOG_STREAM(INFO)); - - uint64_t process_cpu_time = process_cpu_end_time_ - process_cpu_start_time_; - uint64_t gc_cpu_time = heap_->GetTotalGcCpuTime(); - float ratio = static_cast<float>(gc_cpu_time) / process_cpu_time; - LOG_STREAM(INFO) << "GC CPU time " << PrettyDuration(gc_cpu_time) - << " out of process CPU time " << PrettyDuration(process_cpu_time) - << " (" << ratio << ")" - << "\n"; } if (jit_ != nullptr) { diff --git a/runtime/runtime.h b/runtime/runtime.h index e2176c2117..ad4d3bb0d7 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -1127,9 +1127,6 @@ class Runtime { MemMap protected_fault_page_; - uint64_t process_cpu_start_time_; - uint64_t process_cpu_end_time_; - uint32_t verifier_logging_threshold_ms_; DISALLOW_COPY_AND_ASSIGN(Runtime); |