Backed out changeset f937e8d943d8 (bug 1147945) for xpcshell failures.
This commit is contained in:
@@ -1438,8 +1438,6 @@ pref("devtools.performance.enabled", true);
|
|||||||
pref("devtools.performance.memory.sample-probability", "0.05");
|
pref("devtools.performance.memory.sample-probability", "0.05");
|
||||||
pref("devtools.performance.memory.max-log-length", 2147483647); // Math.pow(2,31) - 1
|
pref("devtools.performance.memory.max-log-length", 2147483647); // Math.pow(2,31) - 1
|
||||||
pref("devtools.performance.timeline.hidden-markers", "[]");
|
pref("devtools.performance.timeline.hidden-markers", "[]");
|
||||||
pref("devtools.performance.profiler.buffer-size", 10000000);
|
|
||||||
pref("devtools.performance.profiler.sample-frequency-khz", 1);
|
|
||||||
pref("devtools.performance.ui.invert-call-tree", true);
|
pref("devtools.performance.ui.invert-call-tree", true);
|
||||||
pref("devtools.performance.ui.invert-flame-graph", false);
|
pref("devtools.performance.ui.invert-flame-graph", false);
|
||||||
pref("devtools.performance.ui.flatten-tree-recursion", true);
|
pref("devtools.performance.ui.flatten-tree-recursion", true);
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ PerformanceFront.prototype = {
|
|||||||
startRecording: Task.async(function*(options = {}) {
|
startRecording: Task.async(function*(options = {}) {
|
||||||
// All actors are started asynchronously over the remote debugging protocol.
|
// All actors are started asynchronously over the remote debugging protocol.
|
||||||
// Get the corresponding start times from each one of them.
|
// Get the corresponding start times from each one of them.
|
||||||
let profilerStartTime = yield this._startProfiler(options);
|
let profilerStartTime = yield this._startProfiler();
|
||||||
let timelineStartTime = yield this._startTimeline(options);
|
let timelineStartTime = yield this._startTimeline(options);
|
||||||
let memoryStartTime = yield this._startMemory(options);
|
let memoryStartTime = yield this._startMemory(options);
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ PerformanceFront.prototype = {
|
|||||||
/**
|
/**
|
||||||
* Starts the profiler actor, if necessary.
|
* Starts the profiler actor, if necessary.
|
||||||
*/
|
*/
|
||||||
_startProfiler: Task.async(function *(options={}) {
|
_startProfiler: Task.async(function *() {
|
||||||
// Start the profiler only if it wasn't already active. The built-in
|
// Start the profiler only if it wasn't already active. The built-in
|
||||||
// nsIPerformance module will be kept recording, because it's the same instance
|
// nsIPerformance module will be kept recording, because it's the same instance
|
||||||
// for all targets and interacts with the whole platform, so we don't want
|
// for all targets and interacts with the whole platform, so we don't want
|
||||||
@@ -297,13 +297,10 @@ PerformanceFront.prototype = {
|
|||||||
return profilerStatus.currentTime;
|
return profilerStatus.currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Translate options from the recording model into profiler-specific
|
// If this._customProfilerOptions is defined, use those to pass in
|
||||||
// options for the nsIProfiler
|
// to the profiler actor. The profiler actor handles all the defaults
|
||||||
let profilerOptions = {
|
// now, so this should only be used for tests.
|
||||||
entries: options.bufferSize,
|
let profilerOptions = this._customProfilerOptions || {};
|
||||||
interval: options.sampleInterval
|
|
||||||
};
|
|
||||||
|
|
||||||
yield this._request("profiler", "startProfiler", profilerOptions);
|
yield this._request("profiler", "startProfiler", profilerOptions);
|
||||||
|
|
||||||
this.emit("profiler-activated");
|
this.emit("profiler-activated");
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ const RecordingModel = function (options={}) {
|
|||||||
withMemory: options.withMemory || false,
|
withMemory: options.withMemory || false,
|
||||||
withAllocations: options.withAllocations || false,
|
withAllocations: options.withAllocations || false,
|
||||||
allocationsSampleProbability: options.allocationsSampleProbability || 0,
|
allocationsSampleProbability: options.allocationsSampleProbability || 0,
|
||||||
allocationsMaxLogLength: options.allocationsMaxLogLength || 0,
|
allocationsMaxLogLength: options.allocationsMaxLogLength || 0
|
||||||
bufferSize: options.bufferSize || 0,
|
|
||||||
sampleInterval: options.sampleInterval || 1
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -199,9 +199,7 @@ let PerformanceController = {
|
|||||||
this._nonBooleanPrefs = new ViewHelpers.Prefs("devtools.performance", {
|
this._nonBooleanPrefs = new ViewHelpers.Prefs("devtools.performance", {
|
||||||
"hidden-markers": ["Json", "timeline.hidden-markers"],
|
"hidden-markers": ["Json", "timeline.hidden-markers"],
|
||||||
"memory-sample-probability": ["Float", "memory.sample-probability"],
|
"memory-sample-probability": ["Float", "memory.sample-probability"],
|
||||||
"memory-max-log-length": ["Int", "memory.max-log-length"],
|
"memory-max-log-length": ["Int", "memory.max-log-length"]
|
||||||
"profiler-buffer-size": ["Int", "profiler.buffer-size"],
|
|
||||||
"profiler-sample-frequency": ["Int", "profiler.sample-frequency-khz"]
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this._nonBooleanPrefs.registerObserver();
|
this._nonBooleanPrefs.registerObserver();
|
||||||
@@ -292,9 +290,7 @@ let PerformanceController = {
|
|||||||
withTicks: this.getOption("enable-framerate"),
|
withTicks: this.getOption("enable-framerate"),
|
||||||
withAllocations: this.getOption("enable-memory"),
|
withAllocations: this.getOption("enable-memory"),
|
||||||
allocationsSampleProbability: this.getPref("memory-sample-probability"),
|
allocationsSampleProbability: this.getPref("memory-sample-probability"),
|
||||||
allocationsMaxLogLength: this.getPref("memory-max-log-length"),
|
allocationsMaxLogLength: this.getPref("memory-max-log-length")
|
||||||
bufferSize: this.getPref("profiler-buffer-size"),
|
|
||||||
sampleInterval: 1 / (this.getPref("profiler-sample-frequency") || 1)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.emit(EVENTS.RECORDING_WILL_START, recording);
|
this.emit(EVENTS.RECORDING_WILL_START, recording);
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ support-files =
|
|||||||
[browser_perf-options-enable-memory-02.js]
|
[browser_perf-options-enable-memory-02.js]
|
||||||
[browser_perf-options-enable-framerate.js]
|
[browser_perf-options-enable-framerate.js]
|
||||||
[browser_perf-options-allocations.js]
|
[browser_perf-options-allocations.js]
|
||||||
[browser_perf-options-profiler.js]
|
|
||||||
[browser_perf-overview-render-01.js]
|
[browser_perf-overview-render-01.js]
|
||||||
[browser_perf-overview-render-02.js]
|
[browser_perf-overview-render-02.js]
|
||||||
[browser_perf-overview-render-03.js]
|
[browser_perf-overview-render-03.js]
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
/* Any copyright is dedicated to the Public Domain.
|
|
||||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tests that setting the `devtools.performance.profiler.` prefs propagate to the profiler actor.
|
|
||||||
*/
|
|
||||||
function spawnTest () {
|
|
||||||
let { panel } = yield initPerformance(SIMPLE_URL);
|
|
||||||
let { gFront } = panel.panelWin;
|
|
||||||
|
|
||||||
ok(!nsIProfilerModule.IsActive(),
|
|
||||||
"ensure profiler is stopped.");
|
|
||||||
|
|
||||||
Services.prefs.setIntPref(PROFILER_BUFFER_SIZE_PREF, 1000);
|
|
||||||
Services.prefs.setIntPref(PROFILER_SAMPLE_RATE_PREF, 2);
|
|
||||||
|
|
||||||
yield startRecording(panel);
|
|
||||||
|
|
||||||
let { entries, interval } = yield gFront._request("profiler", "getStartOptions");
|
|
||||||
|
|
||||||
yield stopRecording(panel);
|
|
||||||
|
|
||||||
is(entries, 1000, "profiler entries option is set on profiler");
|
|
||||||
is(interval, 0.5, "profiler interval option is set on profiler");
|
|
||||||
|
|
||||||
yield teardown(panel);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
||||||
|
|
||||||
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||||
let { Preferences } = Cu.import("resource://gre/modules/Preferences.jsm", {});
|
|
||||||
let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
let { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
||||||
let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
let { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||||
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||||
@@ -25,8 +25,6 @@ const SIMPLE_URL = EXAMPLE_URL + "doc_simple-test.html";
|
|||||||
|
|
||||||
const MEMORY_SAMPLE_PROB_PREF = "devtools.performance.memory.sample-probability";
|
const MEMORY_SAMPLE_PROB_PREF = "devtools.performance.memory.sample-probability";
|
||||||
const MEMORY_MAX_LOG_LEN_PREF = "devtools.performance.memory.max-log-length";
|
const MEMORY_MAX_LOG_LEN_PREF = "devtools.performance.memory.max-log-length";
|
||||||
const PROFILER_BUFFER_SIZE_PREF = "devtools.performance.profiler.buffer-size";
|
|
||||||
const PROFILER_SAMPLE_RATE_PREF = "devtools.performance.profiler.sample-frequency-khz";
|
|
||||||
|
|
||||||
const FRAMERATE_PREF = "devtools.performance.ui.enable-framerate";
|
const FRAMERATE_PREF = "devtools.performance.ui.enable-framerate";
|
||||||
const MEMORY_PREF = "devtools.performance.ui.enable-memory";
|
const MEMORY_PREF = "devtools.performance.ui.enable-memory";
|
||||||
@@ -52,12 +50,8 @@ let DEFAULT_PREFS = [
|
|||||||
"devtools.performance.ui.enable-memory",
|
"devtools.performance.ui.enable-memory",
|
||||||
"devtools.performance.ui.enable-framerate",
|
"devtools.performance.ui.enable-framerate",
|
||||||
"devtools.performance.ui.show-jit-optimizations",
|
"devtools.performance.ui.show-jit-optimizations",
|
||||||
"devtools.performance.memory.sample-probability",
|
|
||||||
"devtools.performance.memory.max-log-length",
|
|
||||||
"devtools.performance.profiler.buffer-size",
|
|
||||||
"devtools.performance.profiler.sample-frequency-khz",
|
|
||||||
].reduce((prefs, pref) => {
|
].reduce((prefs, pref) => {
|
||||||
prefs[pref] = Preferences.get(pref);
|
prefs[pref] = Services.prefs.getBoolPref(pref);
|
||||||
return prefs;
|
return prefs;
|
||||||
}, {});
|
}, {});
|
||||||
|
|
||||||
@@ -84,7 +78,7 @@ registerCleanupFunction(() => {
|
|||||||
|
|
||||||
// Rollback any pref changes
|
// Rollback any pref changes
|
||||||
Object.keys(DEFAULT_PREFS).forEach(pref => {
|
Object.keys(DEFAULT_PREFS).forEach(pref => {
|
||||||
Preferences.set(pref, DEFAULT_PREFS[pref]);
|
Services.prefs.setBoolPref(pref, DEFAULT_PREFS[pref]);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Make sure the profiler module is stopped when the test finishes.
|
// Make sure the profiler module is stopped when the test finishes.
|
||||||
|
|||||||
@@ -7,16 +7,10 @@ const {Cc, Ci, Cu, Cr} = require("chrome");
|
|||||||
const Services = require("Services");
|
const Services = require("Services");
|
||||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils.js");
|
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils.js");
|
||||||
|
|
||||||
let DEFAULT_PROFILER_BUFFER_SIZE = Services.prefs.getIntPref("devtools.performance.profiler.buffer-size");
|
let DEFAULT_PROFILER_ENTRIES = 10000000;
|
||||||
let DEFAULT_PROFILER_FREQ_KHZ = Services.prefs.getIntPref("devtools.performance.profiler.sample-frequency-khz");
|
let DEFAULT_PROFILER_INTERVAL = 1;
|
||||||
let DEFAULT_PROFILER_INTERVAL = 1 / (DEFAULT_PROFILER_FREQ_KHZ || 1);
|
let DEFAULT_PROFILER_FEATURES = ["js"];
|
||||||
|
let DEFAULT_PROFILER_THREADFILTERS = ["GeckoMain"];
|
||||||
let DEFAULT_PROFILER_OPTIONS = {
|
|
||||||
entries: DEFAULT_PROFILER_BUFFER_SIZE,
|
|
||||||
interval: DEFAULT_PROFILER_INTERVAL,
|
|
||||||
features: ["js"],
|
|
||||||
threadFilters: ["GeckoMain"]
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The nsIProfiler is target agnostic and interacts with the whole platform.
|
* The nsIProfiler is target agnostic and interacts with the whole platform.
|
||||||
@@ -62,14 +56,6 @@ ProfilerActor.prototype = {
|
|||||||
return { features: nsIProfilerModule.GetFeatures([]) };
|
return { features: nsIProfilerModule.GetFeatures([]) };
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the configuration used that was originally passed in to start up the
|
|
||||||
* profiler. Used for tests, and does not account for others using nsIProfiler.
|
|
||||||
*/
|
|
||||||
onGetStartOptions: function() {
|
|
||||||
return this._profilerStartOptions || {};
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Starts the nsIProfiler module. Doing so will discard any samples
|
* Starts the nsIProfiler module. Doing so will discard any samples
|
||||||
* that might have been accumulated so far.
|
* that might have been accumulated so far.
|
||||||
@@ -80,21 +66,13 @@ ProfilerActor.prototype = {
|
|||||||
* @param array:string threadFilters [description]
|
* @param array:string threadFilters [description]
|
||||||
*/
|
*/
|
||||||
onStartProfiler: function(request = {}) {
|
onStartProfiler: function(request = {}) {
|
||||||
let options = this._profilerStartOptions = {
|
|
||||||
entries: request.entries || DEFAULT_PROFILER_OPTIONS.entries,
|
|
||||||
interval: request.interval || DEFAULT_PROFILER_OPTIONS.interval,
|
|
||||||
features: request.features || DEFAULT_PROFILER_OPTIONS.features,
|
|
||||||
threadFilters: request.threadFilters || DEFAULT_PROFILER_OPTIONS.threadFilters,
|
|
||||||
};
|
|
||||||
|
|
||||||
nsIProfilerModule.StartProfiler(
|
nsIProfilerModule.StartProfiler(
|
||||||
options.entries,
|
(request.entries || DEFAULT_PROFILER_ENTRIES),
|
||||||
options.interval,
|
(request.interval || DEFAULT_PROFILER_INTERVAL),
|
||||||
options.features,
|
(request.features || DEFAULT_PROFILER_FEATURES),
|
||||||
options.features.length,
|
(request.features || DEFAULT_PROFILER_FEATURES).length,
|
||||||
options.threadFilters,
|
(request.threadFilters || DEFAULT_PROFILER_THREADFILTERS),
|
||||||
options.threadFilters.length
|
(request.threadFilters || DEFAULT_PROFILER_THREADFILTERS).length);
|
||||||
);
|
|
||||||
|
|
||||||
return { started: true };
|
return { started: true };
|
||||||
},
|
},
|
||||||
@@ -353,6 +331,5 @@ ProfilerActor.prototype.requestTypes = {
|
|||||||
"getSharedLibraryInformation": ProfilerActor.prototype.onGetSharedLibraryInformation,
|
"getSharedLibraryInformation": ProfilerActor.prototype.onGetSharedLibraryInformation,
|
||||||
"getProfile": ProfilerActor.prototype.onGetProfile,
|
"getProfile": ProfilerActor.prototype.onGetProfile,
|
||||||
"registerEventNotifications": ProfilerActor.prototype.onRegisterEventNotifications,
|
"registerEventNotifications": ProfilerActor.prototype.onRegisterEventNotifications,
|
||||||
"unregisterEventNotifications": ProfilerActor.prototype.onUnregisterEventNotifications,
|
"unregisterEventNotifications": ProfilerActor.prototype.onUnregisterEventNotifications
|
||||||
"getStartOptions": ProfilerActor.prototype.onGetStartOptions
|
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user