Add option to tune sample collection based on thread sensitivity

Bug: 28065407
Bug: 27865109

Change-Id: Icdb89f8f8874a41c07e73185523d18e8956620d3
diff --git a/runtime/interpreter/mterp/mterp.cc b/runtime/interpreter/mterp/mterp.cc
index 1da1181..0af72ce 100644
--- a/runtime/interpreter/mterp/mterp.cc
+++ b/runtime/interpreter/mterp/mterp.cc
@@ -665,6 +665,10 @@
     } else {
       countdown_value = jit::kJitCheckForOSR;
     }
+    if (jit::Jit::ShouldUsePriorityThreadWeight()) {
+      int32_t priority_thread_weight = cache->PriorityThreadWeight();
+      countdown_value = std::min(countdown_value, countdown_value / priority_thread_weight);
+    }
   }
   /*
    * The actual hotness threshold may exceed the range of our int16_t countdown value.  This is