diff options
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 28 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.h | 2 | ||||
| -rw-r--r-- | compiler/image_writer.cc | 6 |
3 files changed, 20 insertions, 16 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 7ae25082a4..b99aca17a5 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -508,7 +508,7 @@ void CompilerDriver::CompileAll(jobject class_loader, TimingLogger* timings) { DCHECK(!Runtime::Current()->IsStarted()); std::unique_ptr<ThreadPool> thread_pool(new ThreadPool("Compiler driver thread pool", thread_count_ - 1)); - VLOG(compiler) << "Before precompile " << GetMemoryUsageString(); + VLOG(compiler) << "Before precompile " << GetMemoryUsageString(false); PreCompile(class_loader, dex_files, thread_pool.get(), timings); Compile(class_loader, dex_files, thread_pool.get(), timings); if (dump_stats_) { @@ -605,10 +605,10 @@ void CompilerDriver::Resolve(jobject class_loader, const std::vector<const DexFi void CompilerDriver::PreCompile(jobject class_loader, const std::vector<const DexFile*>& dex_files, ThreadPool* thread_pool, TimingLogger* timings) { LoadImageClasses(timings); - VLOG(compiler) << "LoadImageClasses: " << GetMemoryUsageString(); + VLOG(compiler) << "LoadImageClasses: " << GetMemoryUsageString(false); Resolve(class_loader, dex_files, thread_pool, timings); - VLOG(compiler) << "Resolve: " << GetMemoryUsageString(); + VLOG(compiler) << "Resolve: " << GetMemoryUsageString(false); if (!compiler_options_->IsVerificationEnabled()) { VLOG(compiler) << "Verify none mode specified, skipping verification."; @@ -617,13 +617,13 @@ void CompilerDriver::PreCompile(jobject class_loader, const std::vector<const De } Verify(class_loader, dex_files, thread_pool, timings); - VLOG(compiler) << "Verify: " << GetMemoryUsageString(); + VLOG(compiler) << "Verify: " << GetMemoryUsageString(false); InitializeClasses(class_loader, dex_files, thread_pool, timings); - VLOG(compiler) << "InitializeClasses: " << GetMemoryUsageString(); + VLOG(compiler) << "InitializeClasses: " << GetMemoryUsageString(false); UpdateImageClasses(timings); - VLOG(compiler) << "UpdateImageClasses: " << GetMemoryUsageString(); + VLOG(compiler) << "UpdateImageClasses: " << GetMemoryUsageString(false); } bool CompilerDriver::IsImageClass(const char* descriptor) const { @@ -1985,7 +1985,7 @@ void CompilerDriver::Compile(jobject class_loader, const std::vector<const DexFi CHECK(dex_file != nullptr); CompileDexFile(class_loader, *dex_file, dex_files, thread_pool, timings); } - VLOG(compiler) << "Compile: " << GetMemoryUsageString(); + VLOG(compiler) << "Compile: " << GetMemoryUsageString(false); } void CompilerDriver::CompileClass(const ParallelCompilationManager* manager, size_t class_def_index) { @@ -2298,7 +2298,7 @@ bool CompilerDriver::SkipCompilation(const std::string& method_name) { return !compile; } -std::string CompilerDriver::GetMemoryUsageString() const { +std::string CompilerDriver::GetMemoryUsageString(bool extended) const { std::ostringstream oss; const ArenaPool* arena_pool = GetArenaPool(); gc::Heap* heap = Runtime::Current()->GetHeap(); @@ -2314,11 +2314,13 @@ std::string CompilerDriver::GetMemoryUsageString() const { if (swap_space_.get() != nullptr) { oss << " swap=" << PrettySize(swap_space_->GetSize()); } - oss << "\nCode dedupe: " << dedupe_code_.DumpStats(); - oss << "\nMapping table dedupe: " << dedupe_mapping_table_.DumpStats(); - oss << "\nVmap table dedupe: " << dedupe_vmap_table_.DumpStats(); - oss << "\nGC map dedupe: " << dedupe_gc_map_.DumpStats(); - oss << "\nCFI info dedupe: " << dedupe_cfi_info_.DumpStats(); + if (extended) { + oss << "\nCode dedupe: " << dedupe_code_.DumpStats(); + oss << "\nMapping table dedupe: " << dedupe_mapping_table_.DumpStats(); + oss << "\nVmap table dedupe: " << dedupe_vmap_table_.DumpStats(); + oss << "\nGC map dedupe: " << dedupe_gc_map_.DumpStats(); + oss << "\nCFI info dedupe: " << dedupe_cfi_info_.DumpStats(); + } return oss.str(); } diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 58285cc888..db07a61085 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -665,7 +665,7 @@ class CompilerDriver { bool SkipCompilation(const std::string& method_name); // Get memory usage during compilation. - std::string GetMemoryUsageString() const; + std::string GetMemoryUsageString(bool extended) const; private: // These flags are internal to CompilerDriver for collecting INVOKE resolution statistics. diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index a20592c469..1b7ac0648e 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -592,8 +592,10 @@ void ImageWriter::ProcessStrings() { for (size_t i = 0; i < total_strings; ++i) { strings->GetWithoutChecks(i)->SetArray(array); } - LOG(INFO) << "Total # image strings=" << total_strings << " combined length=" - << total_length << " prefix saved chars=" << prefix_saved_chars; + if (kIsDebugBuild || VLOG_IS_ON(compiler)) { + LOG(INFO) << "Total # image strings=" << total_strings << " combined length=" + << total_length << " prefix saved chars=" << prefix_saved_chars; + } ComputeEagerResolvedStrings(); } |