diff options
author | 2023-11-06 16:01:07 +0000 | |
---|---|---|
committer | 2023-11-10 18:47:18 +0000 | |
commit | 5c2d8163984e6eceac5bf210d50bc48287d23ef1 (patch) | |
tree | 9b8e084e0bd49e9c090376f60c4ef459ff5bc402 | |
parent | 4e84e552e0386430cd2cc2cef48515736c7d3ac0 (diff) |
Add a system property to disable odrefresh.
This change adds a system property "dalvik.vm.disable-odrefresh", which
disables odrefresh.
This option can be used for making the boot quicker, for faster
iteration during development. It should never be enabled for production.
Bug: 309011617
Test: Set the property to true and see no dex2oat invoked by odrefresh.
Change-Id: I000403ee09cf0393402bc124fa0e94c19913ee39
-rw-r--r-- | odrefresh/odrefresh_main.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/odrefresh/odrefresh_main.cc b/odrefresh/odrefresh_main.cc index f954dfce90..e482095566 100644 --- a/odrefresh/odrefresh_main.cc +++ b/odrefresh/odrefresh_main.cc @@ -296,6 +296,11 @@ int main(int argc, char** argv) { metrics.SetEnabled(exit_code != ExitCode::kOkay); return exit_code; } + if (config.GetSystemProperties().GetBool("dalvik.vm.disable-odrefresh", + /*default_value=*/false)) { + LOG(INFO) << "Compilation skipped because it's disabled by system property"; + return ExitCode::kOkay; + } OdrCompilationLog compilation_log; if (!compilation_log.ShouldAttemptCompile(metrics.GetTrigger())) { LOG(INFO) << "Compilation skipped because it was attempted recently"; |