Bug 1374333 - Make Pageloader use TalosParentProfiler. r=rwood
authorMike Conley <mconley@mozilla.com>
Fri, 16 Jun 2017 17:07:21 -0400
changeset 418172 6f6b8285c422a195d77d4aa9406d198b4fd588a8
parent 418171 98897becd7865b6539d6c88fc27c50ceaa04fd8c
child 418173 b06a06ed4dc7bf736f3f26993e54791079724247
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrwood
bugs1374333
milestone56.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 1374333 - Make Pageloader use TalosParentProfiler. r=rwood MozReview-Commit-ID: BgxsCdrmCKD
testing/talos/.eslintrc.js
testing/talos/talos/pageloader/chrome/pageloader.js
testing/talos/talos/pageloader/chrome/pageloader.xul
--- a/testing/talos/.eslintrc.js
+++ b/testing/talos/.eslintrc.js
@@ -16,16 +16,17 @@ module.exports = {
     "Services": false,
     "gBrowser": false,
     "removeMessageListener": false,
     "sendAsyncMessage": false,
     "sendSyncMessage": false,
     "TalosPowersContent": true,
     "TalosPowersParent": true,
     "TalosContentProfiler": true,
+    "TalosParentProfiler": true,
     "tpRecordTime": true
   },
 
   "plugins": [
     "mozilla"
   ],
 
   "rules": {
--- a/testing/talos/talos/pageloader/chrome/pageloader.js
+++ b/testing/talos/talos/pageloader/chrome/pageloader.js
@@ -151,17 +151,17 @@ function plInit() {
     if (args.mozafterpaint) useMozAfterPaint = true;
     if (args.rss) reportRSS = true;
     if (args.loadnocache) loadNoCache = true;
     if (args.scrolltest) scrollTest = true;
     if (args.disableE10S) gDisableE10S = true;
     if (args.profilinginfo) profilingInfo = JSON.parse(args.profilinginfo)
 
     if (profilingInfo) {
-      Profiler.initFromObject(profilingInfo);
+      TalosParentProfiler.initFromObject(profilingInfo);
     }
 
     forceCC = !args.noForceCC;
     doRenderTest = args.doRender;
 
     if (forceCC &&
         !window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                .getInterface(Components.interfaces.nsIDOMWindowUtils)
@@ -199,17 +199,17 @@ function plInit() {
     pageUrls = pages.map(function(p) { return p.url.spec.toString(); });
     report = new Report();
 
     if (doRenderTest)
       renderReport = new Report();
 
     pageIndex = 0;
     if (profilingInfo) {
-      Profiler.beginTest(getCurrentPageShortName());
+      TalosParentProfiler.beginTest(getCurrentPageShortName());
     }
 
     // Create a new chromed browser window for content
     var wwatch = Cc["@mozilla.org/embedcomp/window-watcher;1"]
       .getService(Ci.nsIWindowWatcher);
     var blank = Cc["@mozilla.org/supports-string;1"]
       .createInstance(Ci.nsISupportsString);
     blank.data = "about:blank";
@@ -285,17 +285,17 @@ function plInit() {
           }
           contentScript += "" +
             "  }" +
             "} " +
             "addEventListener('load', _contentLoadHandler, true); ";
           content.selectedBrowser.messageManager.loadFrameScript(contentScript, false, true);
           content.selectedBrowser.messageManager.loadFrameScript("chrome://pageloader/content/talos-content.js", false);
           content.selectedBrowser.messageManager.loadFrameScript("chrome://pageloader/content/tscroll.js", false, true);
-          content.selectedBrowser.messageManager.loadFrameScript("chrome://pageloader/content/Profiler.js", false, true);
+          content.selectedBrowser.messageManager.loadFrameScript("chrome://talos-powers-content/content/TalosContentProfiler.js", false, true);
         }
 
         if (reportRSS) {
           initializeMemoryCollector(plLoadPage, 100);
         } else {
           setTimeout(plLoadPage, 100);
         }
       }, 500);
@@ -375,32 +375,33 @@ function plLoadPage() {
       mm.removeMessageListener("PageLoader:LoadEvent", ContentListener);
       mm.removeMessageListener("PageLoader:RecordTime", ContentListener);
     };
   }
 
   failTimeout.register(loadFail, timeout);
 
   // record which page we are about to open
-  Profiler.mark("Opening " + pages[pageIndex].url.path);
+  TalosParentProfiler.mark("Opening " + pages[pageIndex].url.path);
 
   if (reportRSS) {
     collectMemory(startAndLoadURI, pageName);
   } else {
     startAndLoadURI(pageName);
   }
 }
 
 function startAndLoadURI(pageName) {
   if (!(plPageFlags() & TEST_DOES_OWN_TIMING)) {
     // Resume the profiler because we're really measuring page load time.
     // If the test is doing its own timing, it'll also need to do its own
     // profiler pausing / resuming.
-    Profiler.resume("Starting to load URI " + pageName, true);
+    TalosParentProfiler.resume("Starting to load URI " + pageName);
   }
+
   start_time = Date.now();
   if (loadNoCache) {
     content.loadURIWithFlags(pageName, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
   } else {
     content.loadURI(pageName);
   }
 }
 
@@ -424,18 +425,19 @@ function getCurrentPageShortName() {
 
 function loadFail() {
   var pageName = pages[pageIndex].url.spec;
   numRetries++;
 
   if (numRetries >= maxRetries) {
     dumpLine("__FAILTimeout in " + getTestName() + "__FAIL");
     dumpLine("__FAILTimeout (" + numRetries + "/" + maxRetries + ") exceeded on " + pageName + "__FAIL");
-    Profiler.finishTest();
-    plStop(true);
+    TalosParentProfiler.finishTest().then(() => {
+      plStop(true);
+    });
   } else {
     dumpLine("__WARNTimeout (" + numRetries + "/" + maxRetries + ") exceeded on " + pageName + "__WARN");
     // TODO: make this a cleaner cleanup
     pageCycle--;
     content.removeEventListener("load", plLoadHandler, true);
     content.removeEventListener("load", plLoadHandlerCapturing, true);
     content.removeEventListener("MozAfterPaint", plPaintedCapturing, true);
     content.removeEventListener("MozAfterPaint", plPainted, true);
@@ -452,23 +454,23 @@ function loadFail() {
 
 var plNextPage = async function() {
   var doNextPage = false;
   if (pageCycle < numPageCycles) {
     pageCycle++;
     doNextPage = true;
   } else {
     if (profilingInfo) {
-      await Profiler.finishTestAsync();
+      await TalosParentProfiler.finishTest();
     }
 
     if (pageIndex < pages.length - 1) {
       pageIndex++;
       if (profilingInfo) {
-        Profiler.beginTest(getCurrentPageShortName());
+        TalosParentProfiler.beginTest(getCurrentPageShortName());
       }
       recordedName = null;
       pageCycle = 1;
       doNextPage = true;
     }
   }
 
   if (doNextPage == true) {
@@ -606,17 +608,17 @@ function _loadHandlerCapturing() {
     if (gStartTime != null && gStartTime >= 0) {
       gTime = (new Date()) - gStartTime;
       gStartTime = -1;
     }
   }
 
   if (gTime !== -1) {
     plRecordTime(gTime);
-    Profiler.pause("capturing load handler fired", true);
+    TalosParentProfiler.pause("capturing load handler fired");
     gTime = -1;
     recordedName = null;
     setTimeout(plNextPage, delay);
   }
 }
 
 // the onload handler
 function plLoadHandler(evt) {
@@ -652,17 +654,17 @@ function plPainted() {
 }
 
 function _loadHandler() {
   failTimeout.clear();
 
   var end_time = Date.now();
   var time = (end_time - start_time);
 
-  Profiler.pause("Bubbling load handler fired.", true);
+  TalosParentProfiler.pause("Bubbling load handler fired.");
 
   // does this page want to do its own timing?
   // if so, we shouldn't be here
   if (plPageFlags() & TEST_DOES_OWN_TIMING) {
     dumpLine("tp: Bubbling onload handler used with page that does its own timing?");
     plStop(true);
   }
 
--- a/testing/talos/talos/pageloader/chrome/pageloader.xul
+++ b/testing/talos/talos/pageloader/chrome/pageloader.xul
@@ -41,17 +41,17 @@
 <window
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
   title="pageloader"
   screenX="0" screenY="0"
   onload="plInit()">
 
   <script type="application/x-javascript" 
           src="chrome://global/content/globalOverlay.js"/>
-  <script type="application/x-javascript" src="Profiler.js"></script>
+  <script type="application/x-javascript" src="chrome://talos-powers-content/content/TalosParentProfiler.js"></script>
   <script type="application/x-javascript" src="MozillaFileLogger.js"></script>
   <script type="application/x-javascript" src="report.js"></script>
   <script type="application/x-javascript" src="pageloader.js"></script>
   <script type="application/x-javascript" src="quit.js"></script>
   <script type="application/x-javascript" src="memory.js"></script>
 
   <browser id="contentPageloader" src="about:blank" 
     type="content" flex="1"/>