Add option to tune sample collection based on thread sensitivity

Bug: 28065407
Bug: 27865109

Change-Id: Icdb89f8f8874a41c07e73185523d18e8956620d3
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 0a65b6b..37bb4c1 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -903,8 +903,8 @@
 
   oat_file_manager_ = new OatFileManager;
 
-  Monitor::Init(runtime_options.GetOrDefault(Opt::LockProfThreshold),
-                runtime_options.GetOrDefault(Opt::HookIsSensitiveThread));
+  Thread::SetSensitiveThreadHook(runtime_options.GetOrDefault(Opt::HookIsSensitiveThread));
+  Monitor::Init(runtime_options.GetOrDefault(Opt::LockProfThreshold));
 
   boot_class_path_string_ = runtime_options.ReleaseOrDefault(Opt::BootClassPath);
   class_path_string_ = runtime_options.ReleaseOrDefault(Opt::ClassPath);
@@ -1924,7 +1924,8 @@
   if (jit_.get() != nullptr) {
     jit_->CreateInstrumentationCache(jit_options_->GetCompileThreshold(),
                                      jit_options_->GetWarmupThreshold(),
-                                     jit_options_->GetOsrThreshold());
+                                     jit_options_->GetOsrThreshold(),
+                                     jit_options_->GetPriorityThreadWeight());
     jit_->CreateThreadPool();
 
     // Notify native debugger about the classes already loaded before the creation of the jit.