Bug 1359176 - [1.1] Add consistent performance logs across the GeckoView example app and Fennec. r=bc
authorEugen Sawin <esawin@mozilla.com>
Tue, 25 Apr 2017 22:10:50 +0200
changeset 403211 f811e55616db6d917478a6e7e738a7d96382310b
parent 403210 ed7ab136d74efd51e7a72c2433ac7660fa25f4bb
child 403212 99440ee674fe8dff6336119e3f3cc360e52301ca
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbc
bugs1359176
milestone55.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 1359176 - [1.1] Add consistent performance logs across the GeckoView example app and Fennec. r=bc
mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
mobile/android/chrome/content/browser.js
mobile/android/chrome/geckoview/geckoview.js
mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApplication.java
@@ -142,17 +142,18 @@ public class GeckoApplication extends Ap
             GeckoNetworkManager.getInstance().start(this);
         }
 
         mInBackground = false;
     }
 
     @Override
     public void onCreate() {
-        Log.i(LOG_TAG, "zerdatime " + SystemClock.uptimeMillis() + " - Fennec application start");
+        Log.i(LOG_TAG, "zerdatime " + SystemClock.elapsedRealtime() +
+              " - application start");
 
         // PRNG is a pseudorandom number generator.
         // We need to apply PRNG Fixes before any use of Java Cryptography Architecture.
         // We make use of various JCA methods in data providers for generating GUIDs, as part of FxA
         // flow and during syncing. Note that this is a no-op for devices running API>18, and so we
         // accept the performance penalty on older devices.
         try {
             PRNGFixes.apply();
--- a/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
+++ b/mobile/android/base/java/org/mozilla/gecko/toolbar/ToolbarDisplayLayout.java
@@ -440,23 +440,25 @@ public class ToolbarDisplayLayout extend
 
     private void updateUiMode(UIMode uiMode) {
         if (mUiMode == uiMode) {
             return;
         }
 
         mUiMode = uiMode;
 
-        // The "Throbber start" and "Throbber stop" log messages in this method
+        // The "page load start" and "page load stop" log messages in this method
         // are needed by S1/S2 tests (http://mrcote.info/phonedash/#).
         // See discussion in Bug 804457. Bug 805124 tracks paring these down.
         if (mUiMode == UIMode.PROGRESS) {
-            Log.i(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - Throbber start");
+            Log.i(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() +
+                  " - page load start");
         } else {
-            Log.i(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - Throbber stop");
+            Log.i(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() +
+                  " - page load stop");
         }
 
         updatePageActions();
     }
 
     private void updatePageActions() {
         final boolean isShowingProgress = (mUiMode == UIMode.PROGRESS);
 
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -376,17 +376,16 @@ var BrowserApp = {
 
   // Note that the deck list order does not necessarily reflect the user visible tab order (see
   // bug 1331154 for the reason), so deck.selectedIndex should not be used (though
   // deck.selectedPanel is still valid) - use selectedTabIndex instead.
   deck: null,
 
   startup: function startup() {
     window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow = new nsBrowserAccess();
-    dump("zerdatime " + Date.now() + " - browser chrome startup finished.");
     Services.obs.notifyObservers(this.browser, "BrowserChrome:Ready");
 
     this.deck = document.getElementById("browsers");
 
     BrowserEventHandler.init();
 
     Services.androidBridge.browserApp = this;
 
--- a/mobile/android/chrome/geckoview/geckoview.js
+++ b/mobile/android/chrome/geckoview/geckoview.js
@@ -51,11 +51,9 @@ function startup() {
   ModuleManager.add("resource://gre/modules/GeckoViewSettings.jsm",
                     "GeckoViewSettings");
   ModuleManager.add("resource://gre/modules/GeckoViewContent.jsm",
                     "GeckoViewContent");
   ModuleManager.add("resource://gre/modules/GeckoViewNavigation.jsm",
                     "GeckoViewNavigation");
   ModuleManager.add("resource://gre/modules/GeckoViewProgress.jsm",
                     "GeckoViewProgress");
-
-  dump("zerdatime " + Date.now() + " - geckoview chrome startup finished.");
 }
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoThread.java
@@ -396,17 +396,18 @@ public class GeckoThread extends Thread 
 
         if (mDebugging) {
             try {
                 Thread.sleep(5 * 1000 /* 5 seconds */);
             } catch (final InterruptedException e) {
             }
         }
 
-        Log.w(LOGTAG, "zerdatime " + SystemClock.uptimeMillis() + " - runGecko");
+        Log.w(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() +
+              " - runGecko");
 
         final GeckoAppShell.GeckoInterface gi = GeckoAppShell.getGeckoInterface();
         if (gi == null || !gi.isOfficial()) {
             Log.i(LOGTAG, "RunGecko - args = " + TextUtils.join(" ", args));
         }
 
         // And go.
         GeckoLoader.nativeRun(args, mCrashFileDescriptor, mIPCFileDescriptor);
--- a/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
+++ b/mobile/android/geckoview_example/src/main/java/org/mozilla/geckoview_example/GeckoViewActivity.java
@@ -4,31 +4,34 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.geckoview_example;
 
 import android.app.Activity;
 import android.content.Intent;
 import android.net.Uri;
 import android.os.Bundle;
+import android.os.SystemClock;
 import android.util.Log;
 
 import org.mozilla.gecko.GeckoView;
 
 public class GeckoViewActivity extends Activity {
     private static final String LOGTAG = "GeckoViewActivity";
     private static final String DEFAULT_URL = "https://mozilla.org";
 
     /* package */ static final int REQUEST_FILE_PICKER = 1;
 
     private GeckoView mGeckoView;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+        Log.i(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() +
+              " - application start");
 
         setContentView(R.layout.geckoview_activity);
 
         mGeckoView = (GeckoView) findViewById(R.id.gecko_view);
         mGeckoView.setContentListener(new MyGeckoViewContent());
         mGeckoView.setProgressListener(new MyGeckoViewProgress());
 
         final BasicGeckoViewPrompt prompt = new BasicGeckoViewPrompt();
@@ -71,21 +74,25 @@ public class GeckoViewActivity extends A
             Log.i(LOGTAG, "Content title changed to " + title);
         }
     }
 
     private class MyGeckoViewProgress implements GeckoView.ProgressListener {
         @Override
         public void onPageStart(GeckoView view, String url) {
             Log.i(LOGTAG, "Starting to load page at " + url);
+            Log.i(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() +
+                  " - page load start");
         }
 
         @Override
         public void onPageStop(GeckoView view, boolean success) {
             Log.i(LOGTAG, "Stopping page load " + (success ? "successfully" : "unsuccessfully"));
+            Log.i(LOGTAG, "zerdatime " + SystemClock.elapsedRealtime() +
+                  " - page load stop");
         }
 
         @Override
         public void onSecurityChange(GeckoView view, int status) {
             String statusString;
             if ((status & STATE_IS_BROKEN) != 0) {
                 statusString = "broken";
             } else if ((status & STATE_IS_SECURE) != 0) {