summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Calin Juravle <calin@google.com> 2018-02-20 16:03:34 -0800
committer Calin Juravle <calin@google.com> 2018-02-20 16:03:34 -0800
commit2bce0763cbbd8cf35ab4e14a1920afce735e9b89 (patch)
tree702989f754d38b7251d9116fc67c9087416c1440
parenta1322f062616c7979da49d2c2198eabb6b7b259d (diff)
Register tests for profiling after the runtime has started
Ensure that the profile saver thread starts after the runtime finishes starting. In test mode (when -Xps-profile-path is passed) we were registering the app info to early. Test: run-test 927-timers Change-Id: Iede588524dda3ff60aa3e2c61ed1d906f63a6c70
-rw-r--r--runtime/runtime.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index d0aec116a4..2074f1e5f5 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -844,6 +844,18 @@ bool Runtime::Start() {
0);
}
+ // In case we have a profile path passed as a command line argument,
+ // register the current class path for profiling now. Note that we cannot do
+ // this before we create the JIT and having it here is the most convenient way.
+ // This is used when testing profiles with dalvikvm command as there is no
+ // framework to register the dex files for profiling.
+ if (jit_.get() != nullptr && jit_options_->GetSaveProfilingInfo() &&
+ !jit_options_->GetProfileSaverOptions().GetProfilePath().empty()) {
+ std::vector<std::string> dex_filenames;
+ Split(class_path_string_, ':', &dex_filenames);
+ RegisterAppInfo(dex_filenames, jit_options_->GetProfileSaverOptions().GetProfilePath());
+ }
+
return true;
}
@@ -2410,18 +2422,6 @@ void Runtime::CreateJit() {
LOG(WARNING) << "Failed to create JIT " << error_msg;
return;
}
-
- // In case we have a profile path passed as a command line argument,
- // register the current class path for profiling now. Note that we cannot do
- // this before we create the JIT and having it here is the most convenient way.
- // This is used when testing profiles with dalvikvm command as there is no
- // framework to register the dex files for profiling.
- if (jit_options_->GetSaveProfilingInfo() &&
- !jit_options_->GetProfileSaverOptions().GetProfilePath().empty()) {
- std::vector<std::string> dex_filenames;
- Split(class_path_string_, ':', &dex_filenames);
- RegisterAppInfo(dex_filenames, jit_options_->GetProfileSaverOptions().GetProfilePath());
- }
}
bool Runtime::CanRelocate() const {