Bug 1642677 - Pause the profiler before capturing a profile with remote profiling. r=gregtatum
authorNazım Can Altınova <canaltinova@gmail.com>
Wed, 03 Jun 2020 14:22:28 +0000
changeset 533856 9d25fef91ab12ba23193958ddae616811d728ac6
parent 533855 e592218473ff8f259d492db86c1f6dd6c98b5d54
child 533857 080cd03c38fd6f070cbc258dc8bd3077a356aeef
push id37479
push userapavel@mozilla.com
push dateThu, 04 Jun 2020 15:32:20 +0000
treeherdermozilla-central@0d21bdf3fc01 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgregtatum
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 - Pause the profiler before capturing a profile with remote profiling. r=gregtatum Differential Revision: https://phabricator.services.mozilla.com/D78036
devtools/shared/performance-new/gecko-profiler-interface.js
--- a/devtools/shared/performance-new/gecko-profiler-interface.js
+++ b/devtools/shared/performance-new/gecko-profiler-interface.js
@@ -145,16 +145,20 @@ class ActorReadyGeckoProfilerInterface {
     return [Array.from(addr), Array.from(index), Array.from(buffer)];
   }
 
   async getProfileAndStopProfiler() {
     if (!IS_SUPPORTED_PLATFORM) {
       return null;
     }
 
+    // Pause profiler before we collect the profile, so that we don't capture
+    // more samples while the parent process or android threads wait for subprocess profiles.
+    Services.profiler.PauseSampling();
+
     let profile;
     try {
       // Attempt to pull out the data.
       if (this.gzipped) {
         profile = await Services.profiler.getProfileDataAsGzippedArrayBuffer();
       } else {
         profile = await Services.profiler.getProfileDataAsync();