ART: Dump less maps

Security has been tightened, so there are situations where we can't
load our files, and produce "log spam."

Bug: 27925454
Change-Id: Ia8c76184ea5087d625cf52d4459f8a557eebfafe
diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc
index 421641c..5d89c21 100644
--- a/runtime/mem_map.cc
+++ b/runtime/mem_map.cc
@@ -426,7 +426,9 @@
     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.",
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index 7c83715..c60962b 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -173,7 +173,7 @@
   }
   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: "