OSDN Git Service

Dump oat file information as part of DumpForSigQuit.
authorNicolas Geoffray <ngeoffray@google.com>
Thu, 17 Mar 2016 11:56:54 +0000 (11:56 +0000)
committerNicolas Geoffray <ngeoffray@google.com>
Thu, 17 Mar 2016 13:51:47 +0000 (13:51 +0000)
Change-Id: Ie8d256d8fa16565105cfe5c39cc96826983469da

runtime/oat_file_manager.cc
runtime/oat_file_manager.h
runtime/runtime.cc

index e57125b..3ec3826 100644 (file)
@@ -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<const OatFile*> boot_oat_files = GetBootOatFiles();
+  for (const std::unique_ptr<const OatFile>& 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
index c508c4b..a541d10 100644 (file)
@@ -108,6 +108,8 @@ class OatFileManager {
       /*out*/ std::vector<std::string>* 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.
index 364ae5d..901f2f5 100644 (file)
@@ -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 {