Bug 1190594 - Disable memory flame graphs in performance tool. r=vp
authorJordan Santell <jsantell@mozilla.com>
Thu, 06 Aug 2015 11:15:51 -0700
changeset 293421 23f1554d94b84e95711a4e9605e9c8b82b2309f3
parent 293420 cebf9a1b7e47f22749a06b433591b5437366223f
child 293422 cfc5cf4fdc518c593a0237124650b38d71c4dba7
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvp
bugs1190594
milestone43.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 1190594 - Disable memory flame graphs in performance tool. r=vp
browser/app/profile/firefox.js
browser/devtools/performance/modules/global.js
browser/devtools/performance/test/head.js
browser/devtools/performance/views/details.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1441,16 +1441,20 @@ pref("devtools.performance.ui.invert-fla
 pref("devtools.performance.ui.flatten-tree-recursion", true);
 pref("devtools.performance.ui.show-platform-data", false);
 pref("devtools.performance.ui.show-idle-blocks", true);
 pref("devtools.performance.ui.enable-memory", false);
 pref("devtools.performance.ui.enable-allocations", false);
 pref("devtools.performance.ui.enable-framerate", true);
 pref("devtools.performance.ui.enable-jit-optimizations", false);
 
+// Temporary pref disabling memory flame views
+// TODO remove once we have flame charts via bug 1148663
+pref("devtools.performance.ui.enable-memory-flame", false);
+
 // Enable experimental options in the UI only in Nightly
 #if defined(NIGHTLY_BUILD)
 pref("devtools.performance.ui.experimental", true);
 #else
 pref("devtools.performance.ui.experimental", false);
 #endif
 
 // The default cache UI setting
--- a/browser/devtools/performance/modules/global.js
+++ b/browser/devtools/performance/modules/global.js
@@ -19,16 +19,18 @@ const L10N = new ViewHelpers.MultiL10N([
  */
 const PREFS = new ViewHelpers.Prefs("devtools.performance", {
   "show-platform-data": ["Bool", "ui.show-platform-data"],
   "hidden-markers": ["Json", "timeline.hidden-markers"],
   "memory-sample-probability": ["Float", "memory.sample-probability"],
   "memory-max-log-length": ["Int", "memory.max-log-length"],
   "profiler-buffer-size": ["Int", "profiler.buffer-size"],
   "profiler-sample-frequency": ["Int", "profiler.sample-frequency-khz"],
+  // TODO re-enable once we flame charts via bug 1148663
+  "enable-memory-flame": ["Bool", "ui.enable-memory-flame"],
 }, {
   monitorChanges: true
 });
 
 /**
  * Details about each profile entry cateogry.
  * @see CATEGORY_MAPPINGS.
  */
--- a/browser/devtools/performance/test/head.js
+++ b/browser/devtools/performance/test/head.js
@@ -74,16 +74,20 @@ let DEFAULT_PREFS = [
 }, {});
 
 // Enable the new performance panel for all tests.
 Services.prefs.setBoolPref("devtools.performance.enabled", true);
 // Enable logging for all the tests. Both the debugger server and frontend will
 // be affected by this pref.
 Services.prefs.setBoolPref("devtools.debugger.log", false);
 
+// By default, enable memory flame graphs for tests for now
+// TODO remove when we have flame charts via bug 1148663
+Services.prefs.setBoolPref("devtools.performance.ui.enable-memory-flame", true);
+
 /**
  * Call manually in tests that use frame script utils after initializing
  * the tool. Must be called after initializing (once we have a tab).
  */
 function loadFrameScripts () {
   mm = gBrowser.selectedBrowser.messageManager;
   mm.loadFrameScript(FRAME_SCRIPT_UTILS_URL, false);
 }
--- a/browser/devtools/performance/views/details.js
+++ b/browser/devtools/performance/views/details.js
@@ -29,17 +29,18 @@ let DetailsView = {
     "memory-calltree": {
       id: "memory-calltree-view",
       view: MemoryCallTreeView,
       features: ["withAllocations"]
     },
     "memory-flamegraph": {
       id: "memory-flamegraph-view",
       view: MemoryFlameGraphView,
-      features: ["withAllocations"]
+      features: ["withAllocations"],
+      prefs: ["enable-memory-flame"],
     },
     "optimizations": {
       id: "optimizations-view",
       view: OptimizationsView,
       features: ["withJITOptimizations"],
     }
   },
 
@@ -121,24 +122,27 @@ let DetailsView = {
   /**
    * Takes a view name and determines if the current recording 
    * can support the view.
    *
    * @param {string} viewName
    * @return {boolean}
    */
   _isViewSupported: function (viewName) {
-    let { features } = this.components[viewName];
+    let { features, prefs } = this.components[viewName];
     let recording = PerformanceController.getCurrentRecording();
 
     if (!recording || !recording.isCompleted()) {
       return false;
     }
 
-    return PerformanceController.isFeatureSupported(features);
+    let prefSupported = (prefs && prefs.length) ?
+                        prefs.every(p => PerformanceController.getPref(p)) :
+                        true;
+    return PerformanceController.isFeatureSupported(features) && prefSupported;
   },
 
   /**
    * Select one of the DetailView's subviews to be rendered,
    * hiding the others.
    *
    * @param String viewName
    *        Name of the view to be shown.