summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2019-10-28 13:34:03 -0700
committer Mathieu Chartier <mathieuc@google.com> 2019-11-04 23:42:59 +0000
commitccc75191d44f696c39262d3c774b2500d06bebb7 (patch)
tree4e30f0d47d916e2da7aebe1213c028d543095c79
parent5fd05e5cfd06c9e682d8b3a097bf0b30e2a85ed4 (diff)
Avoid making oat files executable for system server profiling
Done so that we will only use JIT + interpreter to get samples for services.jar. Bug: 139883463 Test: showmap `pid system_server` and verify Change-Id: I6f13446948fd92a43a9312988fd6e00ee4a0ed41
-rw-r--r--runtime/oat_file_manager.cc2
-rw-r--r--runtime/runtime.cc5
-rw-r--r--runtime/runtime.h4
3 files changed, 9 insertions, 2 deletions
diff --git a/runtime/oat_file_manager.cc b/runtime/oat_file_manager.cc
index e4c7dc3081..687ec544e3 100644
--- a/runtime/oat_file_manager.cc
+++ b/runtime/oat_file_manager.cc
@@ -473,7 +473,7 @@ std::vector<std::unique_ptr<const DexFile>> OatFileManager::OpenDexFilesFromOat(
OatFileAssistant oat_file_assistant(dex_location,
kRuntimeISA,
- !runtime->IsAotCompiler(),
+ runtime->GetOatFilesExecutable(),
only_use_system_oat_files_);
// Get the oat file on disk.
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index b6b7501010..c6d9bfdf25 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -986,7 +986,6 @@ void Runtime::InitNonZygoteOrPostFork(
UnloadNativeBridge();
is_native_bridge_loaded_ = false;
break;
-
case NativeBridgeAction::kInitialize:
InitializeNativeBridge(env, isa);
break;
@@ -2965,4 +2964,8 @@ void Runtime::SetJniIdType(JniIdType t) {
WellKnownClasses::HandleJniIdTypeChange(Thread::Current()->GetJniEnv());
}
+bool Runtime::GetOatFilesExecutable() const {
+ return !IsAotCompiler() && !(IsSystemServer() && jit_options_->GetSaveProfilingInfo());
+}
+
} // namespace art
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 71eb7eae12..ac84d32b82 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -92,6 +92,7 @@ class InternTable;
class IsMarkedVisitor;
class JavaVMExt;
class LinearAlloc;
+class MethodInspectionCallback;
class MonitorList;
class MonitorPool;
class NullPointerHandler;
@@ -942,6 +943,9 @@ class Runtime {
return verifier_missing_kthrow_fatal_;
}
+ // Return true if we should load oat files as executable or not.
+ bool GetOatFilesExecutable() const;
+
private:
static void InitPlatformSignalHandlers();