OSDN Git Service

ART: Dump less maps
authorAndreas Gampe <agampe@google.com>
Sat, 2 Apr 2016 00:20:49 +0000 (17:20 -0700)
committerAndreas Gampe <agampe@google.com>
Mon, 4 Apr 2016 21:22:38 +0000 (14:22 -0700)
Security has been tightened, so there are situations where we can't
load our files, and produce "log spam."

Bug: 27925454

(cherry picked from commit dfd7b70bbab8157fb385e4a6d6e4b55ae2e4e892)

Change-Id: Ia8c76184ea5087d625cf52d4459f8a557eebfafe

runtime/mem_map.cc
runtime/oat_file.cc

index 421641c..5d89c21 100644 (file)
@@ -426,7 +426,9 @@ MemMap* MemMap::MapFileAtAddress(uint8_t* expected_ptr,
     if (error_msg != nullptr) {
       auto saved_errno = errno;
 
-      PrintFileToLog("/proc/self/maps", LogSeverity::WARNING);
+      if (kIsDebugBuild || VLOG_IS_ON(oat)) {
+        PrintFileToLog("/proc/self/maps", LogSeverity::WARNING);
+      }
 
       *error_msg = StringPrintf("mmap(%p, %zd, 0x%x, 0x%x, %d, %" PRId64
                                 ") of file '%s' failed: %s. See process maps in the log.",
index 7c83715..c60962b 100644 (file)
@@ -173,7 +173,7 @@ bool OatFileBase::ComputeFields(uint8_t* requested_base,
   }
   if (requested_base != nullptr && begin_ != requested_base) {
     // Host can fail this check. Do not dump there to avoid polluting the output.
-    if (kIsTargetBuild) {
+    if (kIsTargetBuild && (kIsDebugBuild || VLOG_IS_ON(oat))) {
       PrintFileToLog("/proc/self/maps", LogSeverity::WARNING);
     }
     *error_msg = StringPrintf("Failed to find oatdata symbol at expected address: "