From 4f244c3506222493b6bc1d03270478e771bc2fd4 Mon Sep 17 00:00:00 2001 From: Jordan Santell Date: Thu, 6 Aug 2015 11:15:51 -0700 Subject: [PATCH] Bug 1190594 - Disable memory flame graphs in performance tool. r=vp --- browser/app/profile/firefox.js | 4 ++++ browser/devtools/performance/modules/global.js | 2 ++ browser/devtools/performance/test/head.js | 4 ++++ browser/devtools/performance/views/details.js | 10 +++++++--- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index fd70598c1fd..86ddf55097d 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1446,6 +1446,10 @@ 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); diff --git a/browser/devtools/performance/modules/global.js b/browser/devtools/performance/modules/global.js index 1da0b762622..ccc1f028aee 100644 --- a/browser/devtools/performance/modules/global.js +++ b/browser/devtools/performance/modules/global.js @@ -24,6 +24,8 @@ const PREFS = new ViewHelpers.Prefs("devtools.performance", { "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 }); diff --git a/browser/devtools/performance/test/head.js b/browser/devtools/performance/test/head.js index 6119e0abec5..34844cd24b6 100644 --- a/browser/devtools/performance/test/head.js +++ b/browser/devtools/performance/test/head.js @@ -79,6 +79,10 @@ Services.prefs.setBoolPref("devtools.performance.enabled", true); // 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). diff --git a/browser/devtools/performance/views/details.js b/browser/devtools/performance/views/details.js index dfa3d0084c3..1effefb9a3d 100644 --- a/browser/devtools/performance/views/details.js +++ b/browser/devtools/performance/views/details.js @@ -34,7 +34,8 @@ let DetailsView = { "memory-flamegraph": { id: "memory-flamegraph-view", view: MemoryFlameGraphView, - features: ["withAllocations"] + features: ["withAllocations"], + prefs: ["enable-memory-flame"], }, "optimizations": { id: "optimizations-view", @@ -126,14 +127,17 @@ let DetailsView = { * @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; }, /**