Bug 1642677 - Make the profiler_{pause,resume} control android sampler as well. r=gerald
authorNazım Can Altınova <canaltinova@gmail.com>
Wed, 03 Jun 2020 12:48:26 +0000
changeset 533874 080cd03c38fd6f070cbc258dc8bd3077a356aeef
parent 533873 9d25fef91ab12ba23193958ddae616811d728ac6
child 533875 06661f12888f6f02682d60b387769d81c35ccf78
push id118014
push usercanaltinova@gmail.com
push dateThu, 04 Jun 2020 09:37:28 +0000
treeherderautoland@06661f12888f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald
bugs1642677
milestone79.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1642677 - Make the profiler_{pause,resume} control android sampler as well. r=gerald Depends on D78036 Differential Revision: https://phabricator.services.mozilla.com/D78037
tools/profiler/core/platform.cpp
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -4541,16 +4541,22 @@ void profiler_pause() {
 
     if (!ActivePS::Exists(lock)) {
       return;
     }
 
     RacyFeatures::SetPaused();
     ActivePS::SetIsPaused(lock, true);
     ActivePS::Buffer(lock).AddEntry(ProfileBufferEntry::Pause(profiler_time()));
+
+#if defined(GP_OS_android)
+    if (ActivePS::FeatureJava(lock)) {
+      java::GeckoJavaSampler::Pause();
+    }
+#endif
   }
 
   // gPSMutex must be unlocked when we notify, to avoid potential deadlocks.
   ProfilerParent::ProfilerPaused();
   NotifyObservers("profiler-paused");
 }
 
 void profiler_resume() {
@@ -4564,16 +4570,22 @@ void profiler_resume() {
     if (!ActivePS::Exists(lock)) {
       return;
     }
 
     ActivePS::Buffer(lock).AddEntry(
         ProfileBufferEntry::Resume(profiler_time()));
     ActivePS::SetIsPaused(lock, false);
     RacyFeatures::SetUnpaused();
+
+#if defined(GP_OS_android)
+    if (ActivePS::FeatureJava(lock)) {
+      java::GeckoJavaSampler::Unpause();
+    }
+#endif
   }
 
   // gPSMutex must be unlocked when we notify, to avoid potential deadlocks.
   ProfilerParent::ProfilerResumed();
   NotifyObservers("profiler-resumed");
 }
 
 bool profiler_feature_active(uint32_t aFeature) {