зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1168566 - Separate memory over time and allocation recording in perftools as two different preferences. r=fitzgen
This commit is contained in:
Родитель
e94a941a29
Коммит
bab68c6529
|
@ -1461,6 +1461,7 @@ 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.show-jit-optimizations", false);
|
||||
|
||||
|
|
|
@ -528,7 +528,7 @@ function getRecordingModelPrefs () {
|
|||
withMarkers: true,
|
||||
withMemory: Services.prefs.getBoolPref("devtools.performance.ui.enable-memory"),
|
||||
withTicks: Services.prefs.getBoolPref("devtools.performance.ui.enable-framerate"),
|
||||
withAllocations: Services.prefs.getBoolPref("devtools.performance.ui.enable-memory"),
|
||||
withAllocations: Services.prefs.getBoolPref("devtools.performance.ui.enable-allocations"),
|
||||
allocationsSampleProbability: +Services.prefs.getCharPref("devtools.performance.memory.sample-probability"),
|
||||
allocationsMaxLogLength: Services.prefs.getIntPref("devtools.performance.memory.max-log-length")
|
||||
};
|
||||
|
|
|
@ -297,7 +297,7 @@ let PerformanceController = {
|
|||
withMarkers: true,
|
||||
withMemory: this.getOption("enable-memory"),
|
||||
withTicks: this.getOption("enable-framerate"),
|
||||
withAllocations: this.getOption("enable-memory"),
|
||||
withAllocations: this.getOption("enable-allocations"),
|
||||
allocationsSampleProbability: this.getPref("memory-sample-probability"),
|
||||
allocationsMaxLogLength: this.getPref("memory-max-log-length"),
|
||||
bufferSize: this.getPref("profiler-buffer-size"),
|
||||
|
|
|
@ -43,6 +43,12 @@
|
|||
data-pref="enable-memory"
|
||||
label="&profilerUI.enableMemory;"
|
||||
tooltiptext="&profilerUI.enableMemory.tooltiptext;"/>
|
||||
<menuitem id="option-enable-allocations"
|
||||
class="experimental-option"
|
||||
type="checkbox"
|
||||
data-pref="enable-allocations"
|
||||
label="&profilerUI.enableAllocations;"
|
||||
tooltiptext="&profilerUI.enableAllocations.tooltiptext;"/>
|
||||
<menuitem id="option-enable-framerate"
|
||||
type="checkbox"
|
||||
data-pref="enable-framerate"
|
||||
|
|
|
@ -13,6 +13,7 @@ function* spawnTest() {
|
|||
TEST_MOCK_TIMELINE_ACTOR: true
|
||||
});
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
|
||||
let { memory, timeline } = front.getActorSupport();
|
||||
ok(!memory, "memory should be mocked.");
|
||||
|
|
|
@ -12,6 +12,7 @@ function* spawnTest() {
|
|||
TEST_MOCK_MEMORY_ACTOR: true
|
||||
});
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
|
||||
let { memory, timeline } = front.getActorSupport();
|
||||
ok(!memory, "memory should be mocked.");
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
*/
|
||||
function* spawnTest() {
|
||||
let { panel } = yield initPerformance(SIMPLE_URL);
|
||||
let { EVENTS, PerformanceController, OverviewView, DetailsView } = panel.panelWin;
|
||||
let { EVENTS, PerformanceController, DetailsView } = panel.panelWin;
|
||||
let { $, RecordingsView, WaterfallView, MemoryCallTreeView, MemoryFlameGraphView } = panel.panelWin;
|
||||
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, false);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, false);
|
||||
yield startRecording(panel);
|
||||
yield stopRecording(panel);
|
||||
|
||||
ok(DetailsView.isViewSelected(WaterfallView),
|
||||
"The waterfall view is selected by default in the details view.");
|
||||
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
// The toolbar buttons will always be hidden when a recording isn't available,
|
||||
// so make sure we have one that's finished.
|
||||
yield startRecording(panel);
|
||||
|
|
|
@ -9,7 +9,7 @@ function* spawnTest() {
|
|||
let { EVENTS, DetailsView, MemoryCallTreeView } = panel.panelWin;
|
||||
|
||||
// Enable memory to test.
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
|
||||
yield startRecording(panel);
|
||||
yield busyWait(100);
|
||||
|
|
|
@ -9,7 +9,7 @@ function* spawnTest() {
|
|||
let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin;
|
||||
|
||||
// Enable memory to test.
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
|
||||
yield startRecording(panel);
|
||||
yield busyWait(100);
|
||||
|
|
|
@ -10,7 +10,7 @@ let WAIT_TIME = 1000;
|
|||
|
||||
function* spawnTest() {
|
||||
let { target, front } = yield initBackend(SIMPLE_URL);
|
||||
let config = { withMarkers: true, withMemory: true, withTicks: true };
|
||||
let config = { withMarkers: true, withAllocations: true, withTicks: true };
|
||||
|
||||
yield front._request("memory", "attach");
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
function* spawnTest() {
|
||||
let { panel } = yield initPerformance(SIMPLE_URL);
|
||||
let { EVENTS, PerformanceController, $, gFront } = panel.panelWin;
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
|
||||
let originalProbability = Services.prefs.getCharPref(MEMORY_SAMPLE_PROB_PREF);
|
||||
let originalLogLength = Services.prefs.getIntPref(MEMORY_MAX_LOG_LEN_PREF);
|
||||
|
@ -25,7 +25,7 @@ function* spawnTest() {
|
|||
is(probability, 0.213, "allocations probability option is set on memory actor");
|
||||
is(maxLogLength, 777777, "allocations max log length option is set on memory actor");
|
||||
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, false);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, false);
|
||||
Services.prefs.setCharPref(MEMORY_SAMPLE_PROB_PREF, originalProbability);
|
||||
Services.prefs.setIntPref(MEMORY_MAX_LOG_LEN_PREF, originalLogLength);
|
||||
yield teardown(panel);
|
||||
|
|
|
@ -30,8 +30,8 @@ function* spawnTest() {
|
|||
ok(!$("#memory-overview").hidden, "memory graph is not hidden when memory enabled before recording");
|
||||
is(PerformanceController.getCurrentRecording().getConfiguration().withMemory, true,
|
||||
"PerformanceFront started with memory recording.");
|
||||
is(PerformanceController.getCurrentRecording().getConfiguration().withAllocations, true,
|
||||
"PerformanceFront started with allocations recording.");
|
||||
is(PerformanceController.getCurrentRecording().getConfiguration().withAllocations, false,
|
||||
"PerformanceFront did not record with allocations.");
|
||||
|
||||
yield teardown(panel);
|
||||
finish();
|
||||
|
|
|
@ -28,8 +28,8 @@ function* spawnTest() {
|
|||
|
||||
is(PerformanceController.getCurrentRecording().getConfiguration().withMemory, true,
|
||||
"The recording finished with tracking memory.");
|
||||
is(PerformanceController.getCurrentRecording().getConfiguration().withAllocations, true,
|
||||
"The recording finished with tracking allocations.");
|
||||
is(PerformanceController.getCurrentRecording().getConfiguration().withAllocations, false,
|
||||
"The recording still is not recording allocations.");
|
||||
|
||||
yield teardown(panel);
|
||||
finish();
|
||||
|
|
|
@ -9,7 +9,7 @@ function* spawnTest() {
|
|||
let { EVENTS, PerformanceController, DetailsView, MemoryFlameGraphView, RecordingUtils, FlameGraphUtils } = panel.panelWin;
|
||||
|
||||
// Enable memory to test
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
Services.prefs.setBoolPref(FLATTEN_PREF, true);
|
||||
|
||||
yield startRecording(panel);
|
||||
|
|
|
@ -9,7 +9,7 @@ function* spawnTest() {
|
|||
let { EVENTS, DetailsView, MemoryCallTreeView } = panel.panelWin;
|
||||
|
||||
// Enable memory to test
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
Services.prefs.setBoolPref(INVERT_PREF, true);
|
||||
|
||||
yield startRecording(panel);
|
||||
|
|
|
@ -8,7 +8,7 @@ function* spawnTest() {
|
|||
let { panel } = yield initPerformance(SIMPLE_URL);
|
||||
let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin;
|
||||
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
Services.prefs.setBoolPref(INVERT_FLAME_PREF, true);
|
||||
|
||||
yield startRecording(panel);
|
||||
|
|
|
@ -9,7 +9,7 @@ function* spawnTest() {
|
|||
let { EVENTS, DetailsView, MemoryFlameGraphView } = panel.panelWin;
|
||||
|
||||
// Enable memory to test
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
Services.prefs.setBoolPref(IDLE_PREF, true);
|
||||
|
||||
yield startRecording(panel);
|
||||
|
|
|
@ -10,8 +10,9 @@ let test = Task.async(function*() {
|
|||
let { target, panel, toolbox } = yield initPerformance(SIMPLE_URL);
|
||||
let { $, EVENTS, PerformanceController, DetailsView, DetailsSubview, RecordingsView } = panel.panelWin;
|
||||
|
||||
// Enable memory to test the memory-calltree and memory-flamegraph.
|
||||
// Enable allocations to test the memory-calltree and memory-flamegraph.
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
|
||||
// Need to allow widgets to be updated while hidden, otherwise we can't use
|
||||
// `waitForWidgetsRendered`.
|
||||
|
|
|
@ -30,6 +30,7 @@ function* spawnTest() {
|
|||
"The memory-flamegraph detail view should not have been created yet.");
|
||||
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
|
||||
ok(!(OverviewView.graphs.get("timeline")),
|
||||
"The markers graph should still not have been created yet.");
|
||||
|
|
|
@ -9,7 +9,8 @@ let test = Task.async(function*() {
|
|||
var { target, panel, toolbox } = yield initPerformance(SIMPLE_URL);
|
||||
var { EVENTS, PerformanceController, DetailsView, DetailsSubview } = panel.panelWin;
|
||||
|
||||
// Enable memory to test the memory-calltree and memory-flamegraph.
|
||||
// Enable allocations to test the memory-calltree and memory-flamegraph.
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(FRAMERATE_PREF, true);
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ let test = Task.async(function*() {
|
|||
let { $, EVENTS, PerformanceController, DetailsView, OverviewView, JsCallTreeView } = panel.panelWin;
|
||||
|
||||
// Enable memory to test the memory-calltree and memory-flamegraph.
|
||||
Services.prefs.setBoolPref(MEMORY_PREF, true);
|
||||
Services.prefs.setBoolPref(ALLOCATIONS_PREF, true);
|
||||
|
||||
// Create a structure from the data that mimics the old profiler's data.
|
||||
// Different name for `ticks`, different way of storing time,
|
||||
|
|
|
@ -31,6 +31,7 @@ const PROFILER_SAMPLE_RATE_PREF = "devtools.performance.profiler.sample-frequenc
|
|||
|
||||
const FRAMERATE_PREF = "devtools.performance.ui.enable-framerate";
|
||||
const MEMORY_PREF = "devtools.performance.ui.enable-memory";
|
||||
const ALLOCATIONS_PREF = "devtools.performance.ui.enable-allocations";
|
||||
|
||||
const PLATFORM_DATA_PREF = "devtools.performance.ui.show-platform-data";
|
||||
const IDLE_PREF = "devtools.performance.ui.show-idle-blocks";
|
||||
|
@ -52,6 +53,7 @@ let DEFAULT_PREFS = [
|
|||
"devtools.performance.ui.show-platform-data",
|
||||
"devtools.performance.ui.show-idle-blocks",
|
||||
"devtools.performance.ui.enable-memory",
|
||||
"devtools.performance.ui.enable-allocations",
|
||||
"devtools.performance.ui.enable-framerate",
|
||||
"devtools.performance.ui.show-jit-optimizations",
|
||||
"devtools.performance.memory.sample-probability",
|
||||
|
|
|
@ -130,6 +130,12 @@
|
|||
<!ENTITY profilerUI.enableMemory "Record Memory">
|
||||
<!ENTITY profilerUI.enableMemory.tooltiptext "Record memory consumption while profiling.">
|
||||
|
||||
<!-- LOCALIZATION NOTE (profilerUI.enableAllocations): This string
|
||||
- is displayed next to a checkbox determining whether or not allocation
|
||||
- measurements are enabled. -->
|
||||
<!ENTITY profilerUI.enableAllocations "Record Allocations">
|
||||
<!ENTITY profilerUI.enableAllocations.tooltiptext "Record Object allocations while profiling.">
|
||||
|
||||
<!-- LOCALIZATION NOTE (profilerUI.enableFramerate): This string
|
||||
- is displayed next to a checkbox determining whether or not framerate
|
||||
- is recorded. -->
|
||||
|
|
Загрузка…
Ссылка в новой задаче