mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-04 15:51:37 +00:00
Backed out changeset f937e8d943d8 (bug 1147945) for xpcshell failures.
This commit is contained in:
parent
1e9046f560
commit
522a492ff4
@ -1438,8 +1438,6 @@ pref("devtools.performance.enabled", true);
|
||||
pref("devtools.performance.memory.sample-probability", "0.05");
|
||||
pref("devtools.performance.memory.max-log-length", 2147483647); // Math.pow(2,31) - 1
|
||||
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-flame-graph", false);
|
||||
pref("devtools.performance.ui.flatten-tree-recursion", true);
|
||||
|
@ -247,7 +247,7 @@ PerformanceFront.prototype = {
|
||||
startRecording: Task.async(function*(options = {}) {
|
||||
// All actors are started asynchronously over the remote debugging protocol.
|
||||
// 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 memoryStartTime = yield this._startMemory(options);
|
||||
|
||||
@ -286,7 +286,7 @@ PerformanceFront.prototype = {
|
||||
/**
|
||||
* 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
|
||||
// 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
|
||||
@ -297,13 +297,10 @@ PerformanceFront.prototype = {
|
||||
return profilerStatus.currentTime;
|
||||
}
|
||||
|
||||
// Translate options from the recording model into profiler-specific
|
||||
// options for the nsIProfiler
|
||||
let profilerOptions = {
|
||||
entries: options.bufferSize,
|
||||
interval: options.sampleInterval
|
||||
};
|
||||
|
||||
// If this._customProfilerOptions is defined, use those to pass in
|
||||
// to the profiler actor. The profiler actor handles all the defaults
|
||||
// now, so this should only be used for tests.
|
||||
let profilerOptions = this._customProfilerOptions || {};
|
||||
yield this._request("profiler", "startProfiler", profilerOptions);
|
||||
|
||||
this.emit("profiler-activated");
|
||||
|
@ -26,9 +26,7 @@ const RecordingModel = function (options={}) {
|
||||
withMemory: options.withMemory || false,
|
||||
withAllocations: options.withAllocations || false,
|
||||
allocationsSampleProbability: options.allocationsSampleProbability || 0,
|
||||
allocationsMaxLogLength: options.allocationsMaxLogLength || 0,
|
||||
bufferSize: options.bufferSize || 0,
|
||||
sampleInterval: options.sampleInterval || 1
|
||||
allocationsMaxLogLength: options.allocationsMaxLogLength || 0
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -199,9 +199,7 @@ let PerformanceController = {
|
||||
this._nonBooleanPrefs = new ViewHelpers.Prefs("devtools.performance", {
|
||||
"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"]
|
||||
"memory-max-log-length": ["Int", "memory.max-log-length"]
|
||||
});
|
||||
|
||||
this._nonBooleanPrefs.registerObserver();
|
||||
@ -292,9 +290,7 @@ let PerformanceController = {
|
||||
withTicks: this.getOption("enable-framerate"),
|
||||
withAllocations: this.getOption("enable-memory"),
|
||||
allocationsSampleProbability: this.getPref("memory-sample-probability"),
|
||||
allocationsMaxLogLength: this.getPref("memory-max-log-length"),
|
||||
bufferSize: this.getPref("profiler-buffer-size"),
|
||||
sampleInterval: 1 / (this.getPref("profiler-sample-frequency") || 1)
|
||||
allocationsMaxLogLength: this.getPref("memory-max-log-length")
|
||||
});
|
||||
|
||||
this.emit(EVENTS.RECORDING_WILL_START, recording);
|
||||
|
@ -63,7 +63,6 @@ support-files =
|
||||
[browser_perf-options-enable-memory-02.js]
|
||||
[browser_perf-options-enable-framerate.js]
|
||||
[browser_perf-options-allocations.js]
|
||||
[browser_perf-options-profiler.js]
|
||||
[browser_perf-overview-render-01.js]
|
||||
[browser_perf-overview-render-02.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;
|
||||
|
||||
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 { Promise } = Cu.import("resource://gre/modules/Promise.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_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 MEMORY_PREF = "devtools.performance.ui.enable-memory";
|
||||
@ -52,12 +50,8 @@ let DEFAULT_PREFS = [
|
||||
"devtools.performance.ui.enable-memory",
|
||||
"devtools.performance.ui.enable-framerate",
|
||||
"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) => {
|
||||
prefs[pref] = Preferences.get(pref);
|
||||
prefs[pref] = Services.prefs.getBoolPref(pref);
|
||||
return prefs;
|
||||
}, {});
|
||||
|
||||
@ -84,7 +78,7 @@ registerCleanupFunction(() => {
|
||||
|
||||
// Rollback any pref changes
|
||||
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.
|
||||
|
@ -7,16 +7,10 @@ const {Cc, Ci, Cu, Cr} = require("chrome");
|
||||
const Services = require("Services");
|
||||
const DevToolsUtils = require("devtools/toolkit/DevToolsUtils.js");
|
||||
|
||||
let DEFAULT_PROFILER_BUFFER_SIZE = Services.prefs.getIntPref("devtools.performance.profiler.buffer-size");
|
||||
let DEFAULT_PROFILER_FREQ_KHZ = Services.prefs.getIntPref("devtools.performance.profiler.sample-frequency-khz");
|
||||
let DEFAULT_PROFILER_INTERVAL = 1 / (DEFAULT_PROFILER_FREQ_KHZ || 1);
|
||||
|
||||
let DEFAULT_PROFILER_OPTIONS = {
|
||||
entries: DEFAULT_PROFILER_BUFFER_SIZE,
|
||||
interval: DEFAULT_PROFILER_INTERVAL,
|
||||
features: ["js"],
|
||||
threadFilters: ["GeckoMain"]
|
||||
};
|
||||
let DEFAULT_PROFILER_ENTRIES = 10000000;
|
||||
let DEFAULT_PROFILER_INTERVAL = 1;
|
||||
let DEFAULT_PROFILER_FEATURES = ["js"];
|
||||
let DEFAULT_PROFILER_THREADFILTERS = ["GeckoMain"];
|
||||
|
||||
/**
|
||||
* The nsIProfiler is target agnostic and interacts with the whole platform.
|
||||
@ -62,14 +56,6 @@ ProfilerActor.prototype = {
|
||||
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
|
||||
* that might have been accumulated so far.
|
||||
@ -80,21 +66,13 @@ ProfilerActor.prototype = {
|
||||
* @param array:string threadFilters [description]
|
||||
*/
|
||||
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(
|
||||
options.entries,
|
||||
options.interval,
|
||||
options.features,
|
||||
options.features.length,
|
||||
options.threadFilters,
|
||||
options.threadFilters.length
|
||||
);
|
||||
(request.entries || DEFAULT_PROFILER_ENTRIES),
|
||||
(request.interval || DEFAULT_PROFILER_INTERVAL),
|
||||
(request.features || DEFAULT_PROFILER_FEATURES),
|
||||
(request.features || DEFAULT_PROFILER_FEATURES).length,
|
||||
(request.threadFilters || DEFAULT_PROFILER_THREADFILTERS),
|
||||
(request.threadFilters || DEFAULT_PROFILER_THREADFILTERS).length);
|
||||
|
||||
return { started: true };
|
||||
},
|
||||
@ -353,6 +331,5 @@ ProfilerActor.prototype.requestTypes = {
|
||||
"getSharedLibraryInformation": ProfilerActor.prototype.onGetSharedLibraryInformation,
|
||||
"getProfile": ProfilerActor.prototype.onGetProfile,
|
||||
"registerEventNotifications": ProfilerActor.prototype.onRegisterEventNotifications,
|
||||
"unregisterEventNotifications": ProfilerActor.prototype.onUnregisterEventNotifications,
|
||||
"getStartOptions": ProfilerActor.prototype.onGetStartOptions
|
||||
"unregisterEventNotifications": ProfilerActor.prototype.onUnregisterEventNotifications
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user