From 04680f3d7b021a0afb460266d442f564186a3b6f Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Thu, 17 Mar 2016 11:56:54 +0000 Subject: [PATCH] Dump oat file information as part of DumpForSigQuit. Change-Id: Ie8d256d8fa16565105cfe5c39cc96826983469da --- runtime/oat_file_manager.cc | 19 +++++++++++++++++++ runtime/oat_file_manager.h | 2 ++ runtime/runtime.cc | 1 + 3 files changed, 22 insertions(+) diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc index e57125bef..3ec382637 100644 --- a/runtime/oat_file_manager.cc +++ b/runtime/oat_file_manager.cc @@ -477,4 +477,23 @@ void OatFileManager::UnRegisterOatFileLocation(const std::string& oat_location) } } +void OatFileManager::DumpForSigQuit(std::ostream& os) { + ReaderMutexLock mu(Thread::Current(), *Locks::oat_file_manager_lock_); + std::vector boot_oat_files = GetBootOatFiles(); + for (const std::unique_ptr& oat_file : oat_files_) { + if (ContainsElement(boot_oat_files, oat_file.get())) { + continue; + } + // Use "platform-default" if it's neither extract nor profile guided. + // Saying 'full' could be misleading if for example the platform uses + // compiler filters. + const char* status = oat_file->IsExtractOnly() + ? OatHeader::kExtractOnlyValue + : oat_file->IsProfileGuideCompiled() + ? OatHeader::kProfileGuideCompiledValue + : "platform-default"; + os << oat_file->GetLocation() << ": " << status << "\n"; + } +} + } // namespace art diff --git a/runtime/oat_file_manager.h b/runtime/oat_file_manager.h index c508c4bf0..a541d1022 100644 --- a/runtime/oat_file_manager.h +++ b/runtime/oat_file_manager.h @@ -108,6 +108,8 @@ class OatFileManager { /*out*/ std::vector* error_msgs) REQUIRES(!Locks::oat_file_manager_lock_, !Locks::mutator_lock_); + void DumpForSigQuit(std::ostream& os); + private: // Check for duplicate class definitions of the given oat file against all open oat files. // Return true if there are any class definition collisions in the oat_file. diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 364ae5d21..901f2f552 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -1363,6 +1363,7 @@ void Runtime::DumpForSigQuit(std::ostream& os) { GetInternTable()->DumpForSigQuit(os); GetJavaVM()->DumpForSigQuit(os); GetHeap()->DumpForSigQuit(os); + oat_file_manager_->DumpForSigQuit(os); if (GetJit() != nullptr) { GetJit()->DumpForSigQuit(os); } else { -- 2.11.0