From fc2ed6e92a33188bbc18a633f8581536250cb92b Mon Sep 17 00:00:00 2001 From: Csoregi Natalia Date: Fri, 1 Jun 2018 23:42:00 +0300 Subject: [PATCH] Backed out 18 changesets (bug 1462784) for ESlint failure on FlameGraph.js:1297. CLOSED TREE Backed out changeset 79556798ff9f (bug 1462784) Backed out changeset 88321efb673b (bug 1462784) Backed out changeset 7880f9dc7023 (bug 1462784) Backed out changeset 71fe35fd1f7e (bug 1462784) Backed out changeset a543b94b049a (bug 1462784) Backed out changeset d1ca8b0f2221 (bug 1462784) Backed out changeset 68eabfbf3c16 (bug 1462784) Backed out changeset 34e71c789903 (bug 1462784) Backed out changeset 6fe79d1ca1bd (bug 1462784) Backed out changeset e5ad2e525ea9 (bug 1462784) Backed out changeset 329645ff1e23 (bug 1462784) Backed out changeset e09c38853172 (bug 1462784) Backed out changeset 0663d1a6d2da (bug 1462784) Backed out changeset 106967fc29d2 (bug 1462784) Backed out changeset 99b4a433a8e5 (bug 1462784) Backed out changeset 1d38a4cf5a4a (bug 1462784) Backed out changeset 692017229de6 (bug 1462784) Backed out changeset c2911a626671 (bug 1462784) --- .../locales/en-US/performance.properties | 6 +- .../client/performance/modules/categories.js | 105 +++++++-- .../performance/modules/logic/frame-utils.js | 15 +- .../test/browser_perf-tree-view-02.js | 2 +- .../test/browser_perf-tree-view-08.js | 8 +- .../performance/test/helpers/synth-utils.js | 34 +-- .../test/unit/test_profiler-categories.js | 10 +- .../test/unit/test_tree-model-07.js | 35 ++- .../test/unit/test_tree-model-08.js | 4 +- .../test/unit/test_tree-model-09.js | 15 +- devtools/client/shared/widgets/FlameGraph.js | 7 +- dom/base/nsDOMWindowUtils.cpp | 4 +- dom/base/nsFrameLoader.cpp | 2 +- dom/base/nsFrameMessageManager.cpp | 2 +- dom/base/nsJSEnvironment.cpp | 10 +- dom/bindings/Codegen.py | 2 +- dom/events/EventDispatcher.cpp | 2 +- dom/events/EventListenerManager.cpp | 2 +- dom/events/EventStateManager.cpp | 2 +- dom/indexedDB/ActorsChild.cpp | 4 +- dom/indexedDB/ActorsParent.cpp | 222 +++++++++--------- dom/ipc/ContentChild.cpp | 2 +- dom/ipc/TabChild.cpp | 2 +- dom/ipc/TabParent.cpp | 6 +- dom/ipc/nsIContentChild.cpp | 2 +- dom/ipc/nsIContentParent.cpp | 6 +- dom/storage/StorageDBThread.cpp | 2 +- dom/workers/WorkerPrivate.cpp | 2 - gfx/thebes/gfxWindowsPlatform.cpp | 2 +- ipc/chromium/src/base/message_pump_default.cc | 6 +- js/public/ProfilingStack.h | 41 ++-- js/src/gc/GC.cpp | 2 +- js/xpconnect/src/XPCComponents.cpp | 2 +- layout/base/PresShell.cpp | 4 +- layout/base/RestyleManager.cpp | 2 +- layout/base/nsLayoutUtils.cpp | 4 +- layout/base/nsRefreshDriver.cpp | 2 +- layout/style/ComputedStyle.cpp | 2 +- storage/mozStorageConnection.cpp | 10 +- storage/mozStorageStatement.cpp | 2 +- tools/profiler/core/platform.cpp | 46 +--- tools/profiler/tests/gtest/GeckoProfiler.cpp | 8 +- view/nsViewManager.cpp | 2 +- widget/android/nsAppShell.cpp | 4 +- widget/cocoa/nsAppShell.mm | 21 +- widget/cocoa/nsChildView.mm | 4 +- widget/gtk/nsAppShell.cpp | 1 - widget/gtk/nsWindow.cpp | 2 +- widget/uikit/nsWindow.mm | 4 +- widget/windows/nsAppShell.cpp | 1 - xpcom/base/nsCycleCollector.cpp | 8 +- xpcom/io/FileUtilsWin.cpp | 2 +- xpcom/threads/Scheduler.cpp | 1 - xpcom/threads/ThreadEventQueue.cpp | 1 - xpcom/threads/nsThreadPool.cpp | 2 - 55 files changed, 338 insertions(+), 363 deletions(-) diff --git a/devtools/client/locales/en-US/performance.properties b/devtools/client/locales/en-US/performance.properties index 71af642b6f57e..86ddc29b5e57e 100644 --- a/devtools/client/locales/en-US/performance.properties +++ b/devtools/client/locales/en-US/performance.properties @@ -63,13 +63,13 @@ graphs.memory=MB # as the legend for each block in every bar. These labels should be kept # AS SHORT AS POSSIBLE so they don't obstruct important parts of the graph. category.other=Gecko -category.layout=Layout +category.css=Styles category.js=JIT category.gc=GC category.network=Network category.graphics=Graphics -category.dom=DOM -category.idle=Idle +category.storage=Storage +category.events=Input & Events category.tools=Tools # LOCALIZATION NOTE (table.bytes): diff --git a/devtools/client/performance/modules/categories.js b/devtools/client/performance/modules/categories.js index d3032149c3f5e..accbc5ad6f87e 100644 --- a/devtools/client/performance/modules/categories.js +++ b/devtools/client/performance/modules/categories.js @@ -7,20 +7,16 @@ const { L10N } = require("devtools/client/performance/modules/global"); /** * Details about each label stack frame category. - * To be kept in sync with the js::ProfilingStackFrame::Category in ProfilingStack.h + * @see CATEGORY_MAPPINGS. */ const CATEGORIES = [{ - color: "#d99b28", - abbrev: "idle", - label: L10N.getStr("category.idle") -}, { color: "#5e88b0", abbrev: "other", label: L10N.getStr("category.other") }, { color: "#46afe3", - abbrev: "layout", - label: L10N.getStr("category.layout") + abbrev: "css", + label: L10N.getStr("category.css") }, { color: "#d96629", abbrev: "js", @@ -39,35 +35,94 @@ const CATEGORIES = [{ label: L10N.getStr("category.graphics") }, { color: "#8fa1b2", - abbrev: "dom", - label: L10N.getStr("category.dom") + abbrev: "storage", + label: L10N.getStr("category.storage") +}, { + color: "#d99b28", + abbrev: "events", + label: L10N.getStr("category.events") }, { - // The devtools-only "tools" category which gets computed by - // computeIsContentAndCategory and is not part of the category list in - // ProfilingStack.h. color: "#8fa1b2", abbrev: "tools", label: L10N.getStr("category.tools") }]; /** - * Get the numeric index for the given category abbreviation. - * See `CATEGORIES` above. + * Mapping from category bitmasks in the profiler data to additional details. + * To be kept in sync with the js::ProfilingStackFrame::Category in ProfilingStack.h */ -const CATEGORY_INDEX = (() => { - const indexForCategory = {}; - for (let categoryIndex = 0; categoryIndex < CATEGORIES.length; categoryIndex++) { - const category = CATEGORIES[categoryIndex]; - indexForCategory[category.abbrev] = categoryIndex; +const CATEGORY_MAPPINGS = { + // js::ProfilingStackFrame::Category::OTHER + "16": CATEGORIES[0], + // js::ProfilingStackFrame::Category::CSS + "32": CATEGORIES[1], + // js::ProfilingStackFrame::Category::JS + "64": CATEGORIES[2], + // js::ProfilingStackFrame::Category::GC + "128": CATEGORIES[3], + // js::ProfilingStackFrame::Category::CC + "256": CATEGORIES[3], + // js::ProfilingStackFrame::Category::NETWORK + "512": CATEGORIES[4], + // js::ProfilingStackFrame::Category::GRAPHICS + "1024": CATEGORIES[5], + // js::ProfilingStackFrame::Category::STORAGE + "2048": CATEGORIES[6], + // js::ProfilingStackFrame::Category::EVENTS + "4096": CATEGORIES[7], + // non-bitmasks for specially-assigned categories + "9000": CATEGORIES[8], +}; + +/** + * Get the numeric bitmask (or set of masks) for the given category + * abbreviation. See `CATEGORIES` and `CATEGORY_MAPPINGS` above. + * + * CATEGORY_MASK can be called with just a name if it is expected that the + * category is mapped to by exactly one bitmask. If the category is mapped + * to by multiple masks, CATEGORY_MASK for that name must be called with + * an additional argument specifying the desired id (in ascending order). + */ +const [CATEGORY_MASK, CATEGORY_MASK_LIST] = (() => { + const bitmasksForCategory = {}; + const all = Object.keys(CATEGORY_MAPPINGS); + + for (const category of CATEGORIES) { + bitmasksForCategory[category.abbrev] = all + .filter(mask => CATEGORY_MAPPINGS[mask] == category) + .map(mask => +mask) + .sort(); } - return function(name) { - if (!(name in indexForCategory)) { - throw new Error(`Category abbreviation "${name}" does not exist.`); + return [ + function(name, index) { + if (!(name in bitmasksForCategory)) { + throw new Error(`Category abbreviation "${name}" does not exist.`); + } + if (arguments.length == 1) { + if (bitmasksForCategory[name].length != 1) { + throw new Error(`Expected exactly one category number for "${name}".`); + } else { + return bitmasksForCategory[name][0]; + } + } else { + if (index > bitmasksForCategory[name].length) { + throw new Error(`Index "${index}" too high for category "${name}".`); + } + return bitmasksForCategory[name][index - 1]; + } + }, + + function(name) { + if (!(name in bitmasksForCategory)) { + throw new Error(`Category abbreviation "${name}" does not exist.`); + } + return bitmasksForCategory[name]; } - return indexForCategory[name]; - }; + ]; })(); exports.CATEGORIES = CATEGORIES; -exports.CATEGORY_INDEX = CATEGORY_INDEX; +exports.CATEGORY_MAPPINGS = CATEGORY_MAPPINGS; +exports.CATEGORY_MASK = CATEGORY_MASK; +exports.CATEGORY_MASK_LIST = CATEGORY_MASK_LIST; diff --git a/devtools/client/performance/modules/logic/frame-utils.js b/devtools/client/performance/modules/logic/frame-utils.js index 7ec57ff78b54a..47a0a5dd65e41 100644 --- a/devtools/client/performance/modules/logic/frame-utils.js +++ b/devtools/client/performance/modules/logic/frame-utils.js @@ -9,7 +9,7 @@ const { assert } = require("devtools/shared/DevToolsUtils"); const { isChromeScheme, isContentScheme, isWASM, parseURL } = require("devtools/client/shared/source-utils"); -const { CATEGORY_INDEX, CATEGORIES } = require("devtools/client/performance/modules/categories"); +const { CATEGORY_MASK, CATEGORY_MAPPINGS } = require("devtools/client/performance/modules/categories"); // Character codes used in various parsing helper functions. const CHAR_CODE_R = "r".charCodeAt(0); @@ -190,7 +190,7 @@ function parseLocation(location, fallbackLine, fallbackColumn) { */ function computeIsContentAndCategory(frame) { // Only C++ stack frames have associated category information. - if (frame.category !== null && frame.category !== undefined) { + if (frame.category) { return; } @@ -234,18 +234,18 @@ function computeIsContentAndCategory(frame) { isChromeScheme(location, j) && (location.includes("resource://devtools") || location.includes("resource://devtools"))) { - frame.category = CATEGORY_INDEX("tools"); + frame.category = CATEGORY_MASK("tools"); return; } } } if (location === "EnterJIT") { - frame.category = CATEGORY_INDEX("js"); + frame.category = CATEGORY_MASK("js"); return; } - frame.category = CATEGORY_INDEX("other"); + frame.category = CATEGORY_MASK("other"); } /** @@ -393,10 +393,7 @@ function getFrameInfo(node, options) { data.isMetaCategory = node.isMetaCategory; } data.samples = node.youngestFrameSamples; - const hasCategory = node.category !== null && node.category !== undefined; - data.categoryData = hasCategory - ? (CATEGORIES[node.category] || CATEGORIES[CATEGORY_INDEX("other")]) - : {}; + data.categoryData = CATEGORY_MAPPINGS[node.category] || {}; data.nodeType = node.nodeType; // Frame name (function location or some meta information) diff --git a/devtools/client/performance/test/browser_perf-tree-view-02.js b/devtools/client/performance/test/browser_perf-tree-view-02.js index 481e78e21ee41..3740e53e2aee0 100644 --- a/devtools/client/performance/test/browser_perf-tree-view-02.js +++ b/devtools/client/performance/test/browser_perf-tree-view-02.js @@ -124,7 +124,7 @@ add_task(function() { "The .A.B node's function cell displays the correct line."); is($fun(".call-tree-host", $$(".call-tree-item")[2]).textContent.trim(), "foo", "The .A.B node's function cell displays the correct host."); - is($fun(".call-tree-category", $$(".call-tree-item")[2]).textContent.trim(), "Layout", + is($fun(".call-tree-category", $$(".call-tree-item")[2]).textContent.trim(), "Styles", "The .A.B node's function cell displays the correct category."); is($$dur(3).textContent.trim(), "5 ms", diff --git a/devtools/client/performance/test/browser_perf-tree-view-08.js b/devtools/client/performance/test/browser_perf-tree-view-08.js index c2b05fc625a00..e7e631d33417e 100644 --- a/devtools/client/performance/test/browser_perf-tree-view-08.js +++ b/devtools/client/performance/test/browser_perf-tree-view-08.js @@ -9,7 +9,7 @@ const { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model"); const { CallView } = require("devtools/client/performance/modules/widgets/tree-view"); -const { CATEGORY_INDEX } = require("devtools/client/performance/modules/categories"); +const { CATEGORY_MASK } = require("devtools/client/performance/modules/categories"); const RecordingUtils = require("devtools/shared/performance/recording-utils"); add_task(function() { @@ -89,20 +89,20 @@ const gProfile = RecordingUtils.deflateProfile({ { location: "http://content/A" }, { location: "http://content/E" }, { location: "http://content/F" }, - { location: "platform_JS", category: CATEGORY_INDEX("js") }, + { location: "platform_JS", category: CATEGORY_MASK("js") }, ] }, { time: 1 + 1 + 2 + 3, frames: [ { location: "(root)" }, - { location: "platform_JS2", category: CATEGORY_INDEX("js") }, + { location: "platform_JS2", category: CATEGORY_MASK("js") }, ] }, { time: 1 + 1 + 2 + 3 + 5, frames: [ { location: "(root)" }, { location: "http://content/A" }, - { location: "platform_GC", category: CATEGORY_INDEX("gc") }, + { location: "platform_GC", category: CATEGORY_MASK("gc", 1) }, ] }] }] diff --git a/devtools/client/performance/test/helpers/synth-utils.js b/devtools/client/performance/test/helpers/synth-utils.js index c1acefc818a4f..25f2b2c026bed 100644 --- a/devtools/client/performance/test/helpers/synth-utils.js +++ b/devtools/client/performance/test/helpers/synth-utils.js @@ -6,7 +6,7 @@ * Generates a generalized profile with some samples. */ exports.synthesizeProfile = () => { - const { CATEGORY_INDEX } = require("devtools/client/performance/modules/categories"); + const { CATEGORY_MASK } = require("devtools/client/performance/modules/categories"); const RecordingUtils = require("devtools/shared/performance/recording-utils"); return RecordingUtils.deflateProfile({ @@ -15,34 +15,34 @@ exports.synthesizeProfile = () => { samples: [{ time: 1, frames: [ - { category: CATEGORY_INDEX("other"), location: "(root)" }, - { category: CATEGORY_INDEX("other"), location: "A (http://foo/bar/baz:12)" }, - { category: CATEGORY_INDEX("layout"), location: "B (http://foo/bar/baz:34)" }, - { category: CATEGORY_INDEX("js"), location: "C (http://foo/bar/baz:56)" } + { category: CATEGORY_MASK("other"), location: "(root)" }, + { category: CATEGORY_MASK("other"), location: "A (http://foo/bar/baz:12)" }, + { category: CATEGORY_MASK("css"), location: "B (http://foo/bar/baz:34)" }, + { category: CATEGORY_MASK("js"), location: "C (http://foo/bar/baz:56)" } ] }, { time: 1 + 1, frames: [ - { category: CATEGORY_INDEX("other"), location: "(root)" }, - { category: CATEGORY_INDEX("other"), location: "A (http://foo/bar/baz:12)" }, - { category: CATEGORY_INDEX("layout"), location: "B (http://foo/bar/baz:34)" }, - { category: CATEGORY_INDEX("gc"), location: "D (http://foo/bar/baz:78:9)" } + { category: CATEGORY_MASK("other"), location: "(root)" }, + { category: CATEGORY_MASK("other"), location: "A (http://foo/bar/baz:12)" }, + { category: CATEGORY_MASK("css"), location: "B (http://foo/bar/baz:34)" }, + { category: CATEGORY_MASK("gc", 1), location: "D (http://foo/bar/baz:78:9)" } ] }, { time: 1 + 1 + 2, frames: [ - { category: CATEGORY_INDEX("other"), location: "(root)" }, - { category: CATEGORY_INDEX("other"), location: "A (http://foo/bar/baz:12)" }, - { category: CATEGORY_INDEX("layout"), location: "B (http://foo/bar/baz:34)" }, - { category: CATEGORY_INDEX("gc"), location: "D (http://foo/bar/baz:78:9)" } + { category: CATEGORY_MASK("other"), location: "(root)" }, + { category: CATEGORY_MASK("other"), location: "A (http://foo/bar/baz:12)" }, + { category: CATEGORY_MASK("css"), location: "B (http://foo/bar/baz:34)" }, + { category: CATEGORY_MASK("gc", 1), location: "D (http://foo/bar/baz:78:9)" } ] }, { time: 1 + 1 + 2 + 3, frames: [ - { category: CATEGORY_INDEX("other"), location: "(root)" }, - { category: CATEGORY_INDEX("other"), location: "A (http://foo/bar/baz:12)" }, - { category: CATEGORY_INDEX("gc"), location: "E (http://foo/bar/baz:90)" }, - { category: CATEGORY_INDEX("network"), location: "F (http://foo/bar/baz:99)" } + { category: CATEGORY_MASK("other"), location: "(root)" }, + { category: CATEGORY_MASK("other"), location: "A (http://foo/bar/baz:12)" }, + { category: CATEGORY_MASK("gc", 2), location: "E (http://foo/bar/baz:90)" }, + { category: CATEGORY_MASK("network"), location: "F (http://foo/bar/baz:99)" } ] }] }] diff --git a/devtools/client/performance/test/unit/test_profiler-categories.js b/devtools/client/performance/test/unit/test_profiler-categories.js index 46b494dbe47f3..03f6c3a07042b 100644 --- a/devtools/client/performance/test/unit/test_profiler-categories.js +++ b/devtools/client/performance/test/unit/test_profiler-categories.js @@ -7,7 +7,7 @@ */ add_task(function() { - const { CATEGORIES } = require("devtools/client/performance/modules/categories"); + const { CATEGORIES, CATEGORY_MAPPINGS } = require("devtools/client/performance/modules/categories"); const { L10N } = require("devtools/client/performance/modules/global"); const count = CATEGORIES.length; @@ -22,4 +22,12 @@ add_task(function() { ok(CATEGORIES.every(e => e.label === L10N.getStr("category." + e.abbrev)), "All categories have a correctly localized label."); + + ok(Object.keys(CATEGORY_MAPPINGS).every(e => (Number(e) >= 9000 && Number(e) <= 9999) || + Number.isInteger(Math.log2(e))), + "All bitmask mappings keys are powers of 2, or between 9000-9999 for special " + + "categories."); + + ok(Object.keys(CATEGORY_MAPPINGS).every(e => CATEGORIES.includes(CATEGORY_MAPPINGS[e])), + "All bitmask mappings point to a category."); }); diff --git a/devtools/client/performance/test/unit/test_tree-model-07.js b/devtools/client/performance/test/unit/test_tree-model-07.js index 207b73b4f3956..3ce91e9a13565 100644 --- a/devtools/client/performance/test/unit/test_tree-model-07.js +++ b/devtools/client/performance/test/unit/test_tree-model-07.js @@ -6,7 +6,7 @@ * Tests that when displaying only content nodes, platform nodes are generalized. */ -var { CATEGORY_INDEX } = require("devtools/client/performance/modules/categories"); +var { CATEGORY_MASK } = require("devtools/client/performance/modules/categories"); add_task(function test() { const { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model"); @@ -35,29 +35,22 @@ add_task(function test() { equal(root.calls.length, 2, "root has 2 children"); ok(getFrameNodePath(root, url("A")), "root has content child"); - ok(getFrameNodePath(root, `${CATEGORY_INDEX("js")}`), - "root has platform generalized child"); - equal(getFrameNodePath(root, `${CATEGORY_INDEX("js")}`).calls.length, 0, + ok(getFrameNodePath(root, "64"), "root has platform generalized child"); + equal(getFrameNodePath(root, "64").calls.length, 0, "platform generalized child is a leaf."); - ok(getFrameNodePath(root, `${url("A")} > ${CATEGORY_INDEX("gc")}`), + ok(getFrameNodePath(root, `${url("A")} > 128`), "A has platform generalized child of another type"); - equal(getFrameNodePath(root, `${url("A")} > ${CATEGORY_INDEX("gc")}`).calls.length, 0, + equal(getFrameNodePath(root, `${url("A")} > 128`).calls.length, 0, "second generalized type is a leaf."); - ok(getFrameNodePath( - root, - `${url("A")} > ${url("E")} > ${url("F")} > ${CATEGORY_INDEX("js")}` - ), + ok(getFrameNodePath(root, `${url("A")} > ${url("E")} > ${url("F")} > 64`), "a second leaf of the first generalized type exists deep in the tree."); - ok(getFrameNodePath(root, `${url("A")} > ${CATEGORY_INDEX("gc")}`), + ok(getFrameNodePath(root, `${url("A")} > 128`), "A has platform generalized child of another type"); - equal(getFrameNodePath(root, `${CATEGORY_INDEX("js")}`).category, - getFrameNodePath( - root, - `${url("A")} > ${url("E")} > ${url("F")} > ${CATEGORY_INDEX("js")}` - ).category, + equal(getFrameNodePath(root, "64").category, + getFrameNodePath(root, `${url("A")} > ${url("E")} > ${url("F")} > 64`).category, "generalized frames of same type are duplicated in top-down view"); }); @@ -75,7 +68,7 @@ var gThread = synthesizeProfileForTest([{ { location: "(root)" }, { location: "http://content/A" }, { location: "http://content/B" }, - { location: "contentY", category: CATEGORY_INDEX("layout") }, + { location: "contentY", category: CATEGORY_MASK("css") }, { location: "http://content/D" } ] }, { @@ -83,22 +76,22 @@ var gThread = synthesizeProfileForTest([{ frames: [ { location: "(root)" }, { location: "http://content/A" }, - { location: "contentY", category: CATEGORY_INDEX("layout") }, + { location: "contentY", category: CATEGORY_MASK("css") }, { location: "http://content/E" }, { location: "http://content/F" }, - { location: "contentY", category: CATEGORY_INDEX("js") }, + { location: "contentY", category: CATEGORY_MASK("js") }, ] }, { time: 5 + 20, frames: [ { location: "(root)" }, - { location: "contentX", category: CATEGORY_INDEX("js") }, + { location: "contentX", category: CATEGORY_MASK("js") }, ] }, { time: 5 + 25, frames: [ { location: "(root)" }, { location: "http://content/A" }, - { location: "contentZ", category: CATEGORY_INDEX("gc") }, + { location: "contentZ", category: CATEGORY_MASK("gc", 1) }, ] }]); diff --git a/devtools/client/performance/test/unit/test_tree-model-08.js b/devtools/client/performance/test/unit/test_tree-model-08.js index 89a1ff3154c55..456297c95fea8 100644 --- a/devtools/client/performance/test/unit/test_tree-model-08.js +++ b/devtools/client/performance/test/unit/test_tree-model-08.js @@ -9,7 +9,7 @@ add_task(function test() { const FrameUtils = require("devtools/client/performance/modules/logic/frame-utils"); const { FrameNode } = require("devtools/client/performance/modules/logic/tree-model"); - const { CATEGORY_INDEX } = require("devtools/client/performance/modules/categories"); + const { CATEGORY_MASK } = require("devtools/client/performance/modules/categories"); const compute = frame => { FrameUtils.computeIsContentAndCategory(frame); return frame; @@ -39,7 +39,7 @@ add_task(function test() { new FrameNode("Foo::Bar::Baz", compute({ location: "Foo::Bar::Baz", line: 456, - category: CATEGORY_INDEX("other"), + category: CATEGORY_MASK("other"), }), false), new FrameNode("EnterJIT", compute({ location: "EnterJIT", diff --git a/devtools/client/performance/test/unit/test_tree-model-09.js b/devtools/client/performance/test/unit/test_tree-model-09.js index 82f45d3324dcf..457fe6615688d 100644 --- a/devtools/client/performance/test/unit/test_tree-model-09.js +++ b/devtools/client/performance/test/unit/test_tree-model-09.js @@ -6,8 +6,6 @@ * Tests that when displaying only content nodes, platform nodes are generalized. */ -var { CATEGORY_INDEX } = require("devtools/client/performance/modules/categories"); - add_task(function test() { const { ThreadNode } = require("devtools/client/performance/modules/logic/tree-model"); const url = (n) => `http://content/${n}`; @@ -34,19 +32,16 @@ add_task(function test() { equal(root.calls.length, 2, "root has 2 children"); ok(getFrameNodePath(root, url("A")), "root has content child"); - ok(getFrameNodePath(root, `${CATEGORY_INDEX("tools")}`), + ok(getFrameNodePath(root, "9000"), "root has platform generalized child from Chrome JS"); - equal(getFrameNodePath(root, `${CATEGORY_INDEX("tools")}`).calls.length, 0, + equal(getFrameNodePath(root, "9000").calls.length, 0, "platform generalized child is a leaf."); - ok(getFrameNodePath(root, - `${url("A")} > ${url("E")} > ${url("F")} > ${CATEGORY_INDEX("tools")}`), + ok(getFrameNodePath(root, `${url("A")} > ${url("E")} > ${url("F")} > 9000`), "a second leaf of the generalized Chrome JS exists."); - equal(getFrameNodePath(root, `${CATEGORY_INDEX("tools")}`).category, - getFrameNodePath(root, - `${url("A")} > ${url("E")} > ${url("F")} > ${CATEGORY_INDEX("tools")}` - ).category, + equal(getFrameNodePath(root, "9000").category, + getFrameNodePath(root, `${url("A")} > ${url("E")} > ${url("F")} > 9000`).category, "generalized frames of same type are duplicated in top-down view"); }); diff --git a/devtools/client/shared/widgets/FlameGraph.js b/devtools/client/shared/widgets/FlameGraph.js index b77936671b792..85a3c2dfe9305 100644 --- a/devtools/client/shared/widgets/FlameGraph.js +++ b/devtools/client/shared/widgets/FlameGraph.js @@ -13,9 +13,7 @@ loader.lazyRequireGetter(this, "EventEmitter", loader.lazyRequireGetter(this, "getColor", "devtools/client/shared/theme", true); -loader.lazyRequireGetter(this, "CATEGORIES", - "devtools/client/performance/modules/categories", true); -loader.lazyRequireGetter(this, "CATEGORY_INDEX", +loader.lazyRequireGetter(this, "CATEGORY_MAPPINGS", "devtools/client/performance/modules/categories", true); loader.lazyRequireGetter(this, "FrameUtils", "devtools/client/performance/modules/logic/frame-utils"); @@ -1294,8 +1292,7 @@ var FlameGraphUtils = { if (frameKey !== "" && frameKey !== "(root)") { // If the frame is a meta category, use the category label. if (mutableFrameKeyOptions.isMetaCategoryOut) { - let category = CATEGORIES[frameKey] || CATEGORIES[CATEGORY_INDEX("other")]; - frameKey = category.label; + frameKey = CATEGORY_MAPPINGS[frameKey].label; } sampleFrames[stackDepth] = inflatedFrame; diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 664c215cb44f8..8e58045a04a00 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -720,7 +720,7 @@ nsDOMWindowUtils::SendMouseEventToWindow(const nsAString& aType, uint32_t aIdentifier, uint8_t aOptionalArgCount) { - AUTO_PROFILER_LABEL("nsDOMWindowUtils::SendMouseEventToWindow", OTHER); + AUTO_PROFILER_LABEL("nsDOMWindowUtils::SendMouseEventToWindow", EVENTS); return SendMouseEventCommon(aType, aX, aY, aButton, aClickCount, aModifiers, aIgnoreRootScrollFrame, aPressure, @@ -1239,7 +1239,7 @@ nsDOMWindowUtils::GetWidgetForElement(Element* aElement) NS_IMETHODIMP nsDOMWindowUtils::GarbageCollect(nsICycleCollectorListener *aListener) { - AUTO_PROFILER_LABEL("nsDOMWindowUtils::GarbageCollect", GCCC); + AUTO_PROFILER_LABEL("nsDOMWindowUtils::GarbageCollect", GC); nsJSContext::GarbageCollectNow(JS::gcreason::DOM_UTILS); nsJSContext::CycleCollectNow(aListener); diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index 3cb6d28623fab..2b33d92b9bf80 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -921,7 +921,7 @@ bool nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size, nsSubDocumentFrame *aFrame) { - AUTO_PROFILER_LABEL("nsFrameLoader::ShowRemoteFrame", OTHER); + AUTO_PROFILER_LABEL("nsFrameLoader::ShowRemoteFrame", GRAPHICS); NS_ASSERTION(IsRemoteFrame(), "ShowRemote only makes sense on remote frames."); if (!mRemoteBrowser && !TryRemoteBrowser()) { diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp index 450bfbd55b414..28bcffcad3545 100644 --- a/dom/base/nsFrameMessageManager.cpp +++ b/dom/base/nsFrameMessageManager.cpp @@ -508,7 +508,7 @@ nsFrameMessageManager::SendMessage(JSContext* aCx, "Should not have parent manager in content!"); AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "nsFrameMessageManager::SendMessage", OTHER, aMessageName); + "nsFrameMessageManager::SendMessage", EVENTS, aMessageName); if (sSendingSyncMessage && aIsSync) { // No kind of blocking send should be issued on top of a sync message. diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 025b767d7d019..6ea601b8fea3b 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -1178,7 +1178,7 @@ nsJSContext::GarbageCollectNow(JS::gcreason::Reason aReason, IsShrinking aShrinking, int64_t aSliceMillis) { - AUTO_PROFILER_LABEL_DYNAMIC_CSTR("nsJSContext::GarbageCollectNow", GCCC, + AUTO_PROFILER_LABEL_DYNAMIC_CSTR("nsJSContext::GarbageCollectNow", GC, JS::gcreason::ExplainReason(aReason)); MOZ_ASSERT_IF(aSliceMillis, aIncremental == IncrementalGC); @@ -1231,7 +1231,7 @@ nsJSContext::GarbageCollectNow(JS::gcreason::Reason aReason, static void FinishAnyIncrementalGC() { - AUTO_PROFILER_LABEL("FinishAnyIncrementalGC", GCCC); + AUTO_PROFILER_LABEL("FinishAnyIncrementalGC", GC); if (sCCLockedOut) { AutoJSAPI jsapi; @@ -1482,7 +1482,7 @@ nsJSContext::CycleCollectNow(nsICycleCollectorListener *aListener) return; } - AUTO_PROFILER_LABEL("nsJSContext::CycleCollectNow", GCCC); + AUTO_PROFILER_LABEL("nsJSContext::CycleCollectNow", CC); gCCStats.PrepareForCycleCollectionSlice(TimeStamp()); nsCycleCollector_collect(aListener); @@ -1499,7 +1499,7 @@ nsJSContext::RunCycleCollectorSlice(TimeStamp aDeadline) AUTO_PROFILER_TRACING("CC", aDeadline.IsNull() ? "CCSlice" : "IdleCCSlice"); - AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorSlice", GCCC); + AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorSlice", CC); gCCStats.PrepareForCycleCollectionSlice(aDeadline); @@ -1557,7 +1557,7 @@ nsJSContext::RunCycleCollectorWorkSlice(int64_t aWorkBudget) return; } - AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorWorkSlice", GCCC); + AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorWorkSlice", CC); gCCStats.PrepareForCycleCollectionSlice(); diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 7f9fa73cf02af..8f6a6f0f838f2 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -1579,7 +1579,7 @@ def _decorators(self): def _auto_profiler_label(self): profiler_label_and_jscontext = self.profiler_label_and_jscontext() if profiler_label_and_jscontext: - return 'AUTO_PROFILER_LABEL_FAST("%s", DOM, %s);' % profiler_label_and_jscontext + return 'AUTO_PROFILER_LABEL_FAST("%s", OTHER, %s);' % profiler_label_and_jscontext return None def declare(self): diff --git a/dom/events/EventDispatcher.cpp b/dom/events/EventDispatcher.cpp index fd022fea6f883..9d6d45b01d76c 100644 --- a/dom/events/EventDispatcher.cpp +++ b/dom/events/EventDispatcher.cpp @@ -794,7 +794,7 @@ EventDispatcher::Dispatch(nsISupports* aTarget, EventDispatchingCallback* aCallback, nsTArray* aTargets) { - AUTO_PROFILER_LABEL("EventDispatcher::Dispatch", OTHER); + AUTO_PROFILER_LABEL("EventDispatcher::Dispatch", EVENTS); NS_ASSERTION(aEvent, "Trying to dispatch without WidgetEvent!"); NS_ENSURE_TRUE(!aEvent->mFlags.mIsBeingDispatched, diff --git a/dom/events/EventListenerManager.cpp b/dom/events/EventListenerManager.cpp index aad11582663a8..93c3d2e06875e 100644 --- a/dom/events/EventListenerManager.cpp +++ b/dom/events/EventListenerManager.cpp @@ -1273,7 +1273,7 @@ EventListenerManager::HandleEventInternal(nsPresContext* aPresContext, nsAutoString typeStr; (*aDOMEvent)->GetType(typeStr); AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "EventListenerManager::HandleEventInternal", OTHER, typeStr); + "EventListenerManager::HandleEventInternal", EVENTS, typeStr); uint16_t phase = (*aDOMEvent)->EventPhase(); profiler_add_marker( diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index 728f64f228771..048f3d997c23a 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -4182,7 +4182,7 @@ CreateMouseOrPointerWidgetEvent(WidgetMouseEvent* aMouseEvent, { WidgetPointerEvent* sourcePointer = aMouseEvent->AsPointerEvent(); if (sourcePointer) { - AUTO_PROFILER_LABEL("CreateMouseOrPointerWidgetEvent", OTHER); + AUTO_PROFILER_LABEL("CreateMouseOrPointerWidgetEvent", EVENTS); nsAutoPtr newPointerEvent; newPointerEvent = diff --git a/dom/indexedDB/ActorsChild.cpp b/dom/indexedDB/ActorsChild.cpp index 8c607e77b2a7b..fb994a51b8c97 100644 --- a/dom/indexedDB/ActorsChild.cpp +++ b/dom/indexedDB/ActorsChild.cpp @@ -731,7 +731,7 @@ DispatchErrorEvent(IDBRequest* aRequest, MOZ_ASSERT(NS_FAILED(aErrorCode)); MOZ_ASSERT(NS_ERROR_GET_MODULE(aErrorCode) == NS_ERROR_MODULE_DOM_INDEXEDDB); - AUTO_PROFILER_LABEL("IndexedDB:DispatchErrorEvent", DOM); + AUTO_PROFILER_LABEL("IndexedDB:DispatchErrorEvent", STORAGE); RefPtr request = aRequest; RefPtr transaction = aTransaction; @@ -804,7 +804,7 @@ DispatchSuccessEvent(ResultHelper* aResultHelper, { MOZ_ASSERT(aResultHelper); - AUTO_PROFILER_LABEL("IndexedDB:DispatchSuccessEvent", DOM); + AUTO_PROFILER_LABEL("IndexedDB:DispatchSuccessEvent", STORAGE); RefPtr request = aResultHelper->Request(); MOZ_ASSERT(request); diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 222c15a1c57ef..c4c5cdba1c863 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -762,7 +762,7 @@ MakeCompressedIndexDataValues( MOZ_ASSERT(!aCompressedIndexDataValues); MOZ_ASSERT(aCompressedIndexDataValuesLength); - AUTO_PROFILER_LABEL("MakeCompressedIndexDataValues", DOM); + AUTO_PROFILER_LABEL("MakeCompressedIndexDataValues", STORAGE); const uint32_t arrayLength = aIndexValues.Length(); if (!arrayLength) { @@ -854,7 +854,7 @@ ReadCompressedIndexDataValuesFromBlob(const uint8_t* aBlobData, MOZ_ASSERT(aBlobDataLength); MOZ_ASSERT(aIndexValues.IsEmpty()); - AUTO_PROFILER_LABEL("ReadCompressedIndexDataValuesFromBlob", DOM); + AUTO_PROFILER_LABEL("ReadCompressedIndexDataValuesFromBlob", STORAGE); if (uintptr_t(aBlobData) > UINTPTR_MAX - aBlobDataLength) { IDB_REPORT_INTERNAL_ERR(); @@ -995,7 +995,7 @@ CreateFileTables(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("CreateFileTables", DOM); + AUTO_PROFILER_LABEL("CreateFileTables", STORAGE); // Table `file` nsresult rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( @@ -1067,7 +1067,7 @@ CreateTables(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("CreateTables", DOM); + AUTO_PROFILER_LABEL("CreateTables", STORAGE); // Table `database` @@ -1215,7 +1215,7 @@ UpgradeSchemaFrom4To5(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom4To5", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom4To5", STORAGE); nsresult rv; @@ -1332,7 +1332,7 @@ UpgradeSchemaFrom5To6(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom5To6", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom5To6", STORAGE); // First, drop all the indexes we're no longer going to use. nsresult rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( @@ -1780,7 +1780,7 @@ UpgradeSchemaFrom6To7(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom6To7", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom6To7", STORAGE); nsresult rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( "CREATE TEMPORARY TABLE temp_upgrade (" @@ -1853,7 +1853,7 @@ UpgradeSchemaFrom7To8(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom7To8", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom7To8", STORAGE); nsresult rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( "CREATE TEMPORARY TABLE temp_upgrade (" @@ -1946,7 +1946,7 @@ class CompressDataBlobsFunction final MOZ_ASSERT(aArguments); MOZ_ASSERT(aResult); - AUTO_PROFILER_LABEL("CompressDataBlobsFunction::OnFunctionCall", DOM); + AUTO_PROFILER_LABEL("CompressDataBlobsFunction::OnFunctionCall", STORAGE); uint32_t argc; nsresult rv = aArguments->GetNumEntries(&argc); @@ -2005,7 +2005,7 @@ UpgradeSchemaFrom8To9_0(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom8To9_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom8To9_0", STORAGE); // We no longer use the dataVersion column. nsresult rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( @@ -2058,7 +2058,7 @@ UpgradeSchemaFrom9_0To10_0(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom9_0To10_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom9_0To10_0", STORAGE); nsresult rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( "ALTER TABLE object_data ADD COLUMN file_ids TEXT;" @@ -2093,7 +2093,7 @@ UpgradeSchemaFrom10_0To11_0(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom10_0To11_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom10_0To11_0", STORAGE); nsresult rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( "CREATE TEMPORARY TABLE temp_upgrade (" @@ -2271,7 +2271,7 @@ class EncodeKeysFunction final MOZ_ASSERT(aArguments); MOZ_ASSERT(aResult); - AUTO_PROFILER_LABEL("EncodeKeysFunction::OnFunctionCall", DOM); + AUTO_PROFILER_LABEL("EncodeKeysFunction::OnFunctionCall", STORAGE); uint32_t argc; nsresult rv = aArguments->GetNumEntries(&argc); @@ -2322,7 +2322,7 @@ UpgradeSchemaFrom11_0To12_0(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom11_0To12_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom11_0To12_0", STORAGE); NS_NAMED_LITERAL_CSTRING(encoderName, "encode"); @@ -2591,7 +2591,7 @@ UpgradeSchemaFrom12_0To13_0(mozIStorageConnection* aConnection, AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom12_0To13_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom12_0To13_0", STORAGE); nsresult rv; @@ -3577,7 +3577,7 @@ UpgradeSchemaFrom17_0To18_0(mozIStorageConnection* aConnection, MOZ_ASSERT(aConnection); MOZ_ASSERT(!aOrigin.IsEmpty()); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom17_0To18_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom17_0To18_0", STORAGE); return UpgradeSchemaFrom17_0To18_0Helper::DoUpgrade(aConnection, aOrigin); } @@ -3589,7 +3589,7 @@ UpgradeSchemaFrom18_0To19_0(mozIStorageConnection* aConnection) MOZ_ASSERT(aConnection); nsresult rv; - AUTO_PROFILER_LABEL("UpgradeSchemaFrom18_0To19_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom18_0To19_0", STORAGE); rv = aConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( "ALTER TABLE object_store_index " @@ -3688,7 +3688,7 @@ UpgradeSchemaFrom19_0To20_0(nsIFile* aFMDirectory, AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom19_0To20_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom19_0To20_0", STORAGE); nsCOMPtr stmt; nsresult rv = aConnection->CreateStatement(NS_LITERAL_CSTRING( @@ -3904,7 +3904,7 @@ UpgradeIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aArguments MOZ_ASSERT(aResult); AUTO_PROFILER_LABEL( - "UpgradeIndexDataValuesFunction::OnFunctionCall", DOM); + "UpgradeIndexDataValuesFunction::OnFunctionCall", STORAGE); uint32_t argc; nsresult rv = aArguments->GetNumEntries(&argc); @@ -3963,7 +3963,7 @@ UpgradeSchemaFrom20_0To21_0(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom20_0To21_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom20_0To21_0", STORAGE); RefPtr function = new UpgradeIndexDataValuesFunction(); @@ -4018,7 +4018,7 @@ UpgradeSchemaFrom22_0To23_0(mozIStorageConnection* aConnection, MOZ_ASSERT(aConnection); MOZ_ASSERT(!aOrigin.IsEmpty()); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom22_0To23_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom22_0To23_0", STORAGE); nsCOMPtr stmt; nsresult rv = aConnection->CreateStatement(NS_LITERAL_CSTRING( @@ -4092,7 +4092,7 @@ class StripObsoleteOriginAttributesFunction final MOZ_ASSERT(aResult); AUTO_PROFILER_LABEL( - "StripObsoleteOriginAttributesFunction::OnFunctionCall", DOM); + "StripObsoleteOriginAttributesFunction::OnFunctionCall", STORAGE); #ifdef DEBUG { @@ -4139,7 +4139,7 @@ UpgradeSchemaFrom25_0To26_0(mozIStorageConnection* aConnection) AssertIsOnIOThread(); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("UpgradeSchemaFrom25_0To26_0", DOM); + AUTO_PROFILER_LABEL("UpgradeSchemaFrom25_0To26_0", STORAGE); NS_NAMED_LITERAL_CSTRING(functionName, "strip_obsolete_attributes"); @@ -4482,7 +4482,7 @@ CreateStorageConnection(nsIFile* aDBFile, MOZ_ASSERT(aFMDirectory); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("CreateStorageConnection", DOM); + AUTO_PROFILER_LABEL("CreateStorageConnection", STORAGE); nsresult rv; bool exists; @@ -4947,7 +4947,7 @@ GetStorageConnection(nsIFile* aDatabaseFile, MOZ_ASSERT(aDatabaseFile); MOZ_ASSERT(aConnection); - AUTO_PROFILER_LABEL("GetStorageConnection", DOM); + AUTO_PROFILER_LABEL("GetStorageConnection", STORAGE); bool exists; nsresult rv = aDatabaseFile->Exists(&exists); @@ -10525,7 +10525,7 @@ DatabaseConnection::GetCachedStatement(const nsACString& aQuery, MOZ_ASSERT(aCachedStatement); MOZ_ASSERT(mStorageConnection); - AUTO_PROFILER_LABEL("DatabaseConnection::GetCachedStatement", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::GetCachedStatement", STORAGE); nsCOMPtr stmt; @@ -10562,7 +10562,7 @@ DatabaseConnection::BeginWriteTransaction() MOZ_ASSERT(mInReadTransaction); MOZ_ASSERT(!mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::BeginWriteTransaction", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::BeginWriteTransaction", STORAGE); // Release our read locks. CachedStatement rollbackStmt; @@ -10639,7 +10639,7 @@ DatabaseConnection::CommitWriteTransaction() MOZ_ASSERT(!mInReadTransaction); MOZ_ASSERT(mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::CommitWriteTransaction", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::CommitWriteTransaction", STORAGE); CachedStatement stmt; nsresult rv = GetCachedStatement(NS_LITERAL_CSTRING("COMMIT;"), &stmt); @@ -10663,7 +10663,7 @@ DatabaseConnection::RollbackWriteTransaction() MOZ_ASSERT(!mInReadTransaction); MOZ_ASSERT(mStorageConnection); - AUTO_PROFILER_LABEL("DatabaseConnection::RollbackWriteTransaction", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::RollbackWriteTransaction", STORAGE); if (!mInWriteTransaction) { return; @@ -10690,7 +10690,7 @@ DatabaseConnection::FinishWriteTransaction() MOZ_ASSERT(!mInReadTransaction); MOZ_ASSERT(!mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::FinishWriteTransaction", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::FinishWriteTransaction", STORAGE); if (mUpdateRefcountFunction) { mUpdateRefcountFunction->Reset(); @@ -10718,7 +10718,7 @@ DatabaseConnection::StartSavepoint() MOZ_ASSERT(mUpdateRefcountFunction); MOZ_ASSERT(mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::StartSavepoint", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::StartSavepoint", STORAGE); CachedStatement stmt; nsresult rv = GetCachedStatement(NS_LITERAL_CSTRING(SAVEPOINT_CLAUSE), &stmt); @@ -10749,7 +10749,7 @@ DatabaseConnection::ReleaseSavepoint() MOZ_ASSERT(mUpdateRefcountFunction); MOZ_ASSERT(mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::ReleaseSavepoint", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::ReleaseSavepoint", STORAGE); CachedStatement stmt; nsresult rv = GetCachedStatement( @@ -10778,7 +10778,7 @@ DatabaseConnection::RollbackSavepoint() MOZ_ASSERT(mUpdateRefcountFunction); MOZ_ASSERT(mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::RollbackSavepoint", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::RollbackSavepoint", STORAGE); #ifdef DEBUG MOZ_ASSERT(mDEBUGSavepointCount); @@ -10809,7 +10809,7 @@ DatabaseConnection::CheckpointInternal(CheckpointMode aMode) MOZ_ASSERT(!mInReadTransaction); MOZ_ASSERT(!mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::CheckpointInternal", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::CheckpointInternal", STORAGE); nsAutoCString stmtString; stmtString.AssignLiteral("PRAGMA wal_checkpoint("); @@ -10859,7 +10859,7 @@ DatabaseConnection::DoIdleProcessing(bool aNeedsCheckpoint) MOZ_ASSERT(mInReadTransaction); MOZ_ASSERT(!mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::DoIdleProcessing", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::DoIdleProcessing", STORAGE); DatabaseConnection::CachedStatement freelistStmt; uint32_t freelistCount; @@ -10938,7 +10938,7 @@ DatabaseConnection::ReclaimFreePagesWhileIdle( MOZ_ASSERT(!mInReadTransaction); MOZ_ASSERT(!mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::ReclaimFreePagesWhileIdle", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::ReclaimFreePagesWhileIdle", STORAGE); // Make sure we don't keep working if anything else needs this thread. nsIThread* currentThread = NS_GetCurrentThread(); @@ -11050,7 +11050,7 @@ DatabaseConnection::GetFreelistCount(CachedStatement& aCachedStatement, AssertIsOnConnectionThread(); MOZ_ASSERT(aFreelistCount); - AUTO_PROFILER_LABEL("DatabaseConnection::GetFreelistCount", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::GetFreelistCount", STORAGE); nsresult rv; @@ -11094,7 +11094,7 @@ DatabaseConnection::Close() MOZ_ASSERT(!mDEBUGSavepointCount); MOZ_ASSERT(!mInWriteTransaction); - AUTO_PROFILER_LABEL("DatabaseConnection::Close", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::Close", STORAGE); if (mUpdateRefcountFunction) { MOZ_ALWAYS_SUCCEEDS( @@ -11379,7 +11379,7 @@ UpdateRefcountFunction::WillCommit() MOZ_ASSERT(mConnection); mConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("DatabaseConnection::UpdateRefcountFunction::WillCommit", DOM); + AUTO_PROFILER_LABEL("DatabaseConnection::UpdateRefcountFunction::WillCommit", STORAGE); DatabaseUpdateFunction function(this); for (auto iter = mFileInfoEntries.ConstIter(); !iter.Done(); iter.Next()) { @@ -11413,7 +11413,7 @@ UpdateRefcountFunction::DidCommit() mConnection->AssertIsOnConnectionThread(); AUTO_PROFILER_LABEL( - "DatabaseConnection::UpdateRefcountFunction::DidCommit", DOM); + "DatabaseConnection::UpdateRefcountFunction::DidCommit", STORAGE); for (auto iter = mFileInfoEntries.ConstIter(); !iter.Done(); iter.Next()) { FileInfoEntry* value = iter.Data(); @@ -11438,7 +11438,7 @@ UpdateRefcountFunction::DidAbort() mConnection->AssertIsOnConnectionThread(); AUTO_PROFILER_LABEL( - "DatabaseConnection::UpdateRefcountFunction::DidAbort", DOM); + "DatabaseConnection::UpdateRefcountFunction::DidAbort", STORAGE); if (NS_FAILED(RemoveJournals(mJournalsToRemoveAfterAbort))) { NS_WARNING("RemoveJournals failed!"); @@ -11599,7 +11599,7 @@ UpdateRefcountFunction::ProcessValue(mozIStorageValueArray* aValues, MOZ_ASSERT(aValues); AUTO_PROFILER_LABEL( - "DatabaseConnection::UpdateRefcountFunction::ProcessValue", DOM); + "DatabaseConnection::UpdateRefcountFunction::ProcessValue", STORAGE); int32_t type; nsresult rv = aValues->GetTypeOfIndex(aIndex, &type); @@ -11668,7 +11668,7 @@ UpdateRefcountFunction::CreateJournals() mConnection->AssertIsOnConnectionThread(); AUTO_PROFILER_LABEL( - "DatabaseConnection::UpdateRefcountFunction::CreateJournals", DOM); + "DatabaseConnection::UpdateRefcountFunction::CreateJournals", STORAGE); nsCOMPtr journalDirectory = mFileManager->GetJournalDirectory(); if (NS_WARN_IF(!journalDirectory)) { @@ -11703,7 +11703,7 @@ UpdateRefcountFunction::RemoveJournals(const nsTArray& aJournals) mConnection->AssertIsOnConnectionThread(); AUTO_PROFILER_LABEL( - "DatabaseConnection::UpdateRefcountFunction::RemoveJournals", DOM); + "DatabaseConnection::UpdateRefcountFunction::RemoveJournals", STORAGE); nsCOMPtr journalDirectory = mFileManager->GetJournalDirectory(); if (NS_WARN_IF(!journalDirectory)) { @@ -11737,7 +11737,7 @@ UpdateRefcountFunction::OnFunctionCall(mozIStorageValueArray* aValues, MOZ_ASSERT(_retval); AUTO_PROFILER_LABEL( - "DatabaseConnection::UpdateRefcountFunction::OnFunctionCall", DOM); + "DatabaseConnection::UpdateRefcountFunction::OnFunctionCall", STORAGE); uint32_t numEntries; nsresult rv = aValues->GetNumEntries(&numEntries); @@ -11797,7 +11797,7 @@ DatabaseUpdateFunction::UpdateInternal(int64_t aId, AUTO_PROFILER_LABEL( "DatabaseConnection::UpdateRefcountFunction::" "DatabaseUpdateFunction::UpdateInternal", - DOM); + STORAGE); DatabaseConnection* connection = mFunction->mConnection; MOZ_ASSERT(connection); @@ -11944,7 +11944,7 @@ ConnectionPool::IdleTimerCallback(nsITimer* aTimer, void* aClosure) { MOZ_ASSERT(aTimer); - AUTO_PROFILER_LABEL("ConnectionPool::IdleTimerCallback", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::IdleTimerCallback", STORAGE); auto* self = static_cast(aClosure); MOZ_ASSERT(self); @@ -12008,7 +12008,7 @@ ConnectionPool::GetOrCreateConnection(const Database* aDatabase, MOZ_ASSERT(!IsOnBackgroundThread()); MOZ_ASSERT(aDatabase); - AUTO_PROFILER_LABEL("ConnectionPool::GetOrCreateConnection", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::GetOrCreateConnection", STORAGE); DatabaseInfo* dbInfo; { @@ -12073,7 +12073,7 @@ ConnectionPool::Start(const nsID& aBackgroundChildLoggingId, MOZ_ASSERT(mNextTransactionId < UINT64_MAX); MOZ_ASSERT(!mShutdownRequested); - AUTO_PROFILER_LABEL("ConnectionPool::Start", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::Start", STORAGE); const uint64_t transactionId = ++mNextTransactionId; @@ -12168,7 +12168,7 @@ ConnectionPool::Dispatch(uint64_t aTransactionId, nsIRunnable* aRunnable) AssertIsOnOwningThread(); MOZ_ASSERT(aRunnable); - AUTO_PROFILER_LABEL("ConnectionPool::Dispatch", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::Dispatch", STORAGE); TransactionInfo* transactionInfo = mTransactions.Get(aTransactionId); MOZ_ASSERT(transactionInfo); @@ -12201,7 +12201,7 @@ ConnectionPool::Finish(uint64_t aTransactionId, FinishCallback* aCallback) MOZ_ASSERT(!transactionInfo->mFinished); #endif - AUTO_PROFILER_LABEL("ConnectionPool::Finish", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::Finish", STORAGE); RefPtr wrapper = new FinishCallbackWrapper(this, aTransactionId, aCallback); @@ -12222,7 +12222,7 @@ ConnectionPool::WaitForDatabasesToComplete(nsTArray&& aDatabaseIds, MOZ_ASSERT(!aDatabaseIds.IsEmpty()); MOZ_ASSERT(aCallback); - AUTO_PROFILER_LABEL("ConnectionPool::WaitForDatabasesToComplete", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::WaitForDatabasesToComplete", STORAGE); bool mayRunCallbackImmediately = true; @@ -12254,7 +12254,7 @@ ConnectionPool::Shutdown() MOZ_ASSERT(!mShutdownRequested); MOZ_ASSERT(!mShutdownComplete); - AUTO_PROFILER_LABEL("ConnectionPool::Shutdown", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::Shutdown", STORAGE); mShutdownRequested = true; @@ -12289,7 +12289,7 @@ ConnectionPool::Cleanup() MOZ_ASSERT(!mTransactions.Count()); MOZ_ASSERT(mIdleThreads.IsEmpty()); - AUTO_PROFILER_LABEL("ConnectionPool::Cleanup", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::Cleanup", STORAGE); if (!mCompleteCallbacks.IsEmpty()) { // Run all callbacks manually now. @@ -12322,7 +12322,7 @@ ConnectionPool::AdjustIdleTimer() AssertIsOnOwningThread(); MOZ_ASSERT(mIdleTimer); - AUTO_PROFILER_LABEL("ConnectionPool::AdjustIdleTimer", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::AdjustIdleTimer", STORAGE); // Figure out the next time at which we should release idle resources. This // includes both databases and threads. @@ -12422,7 +12422,7 @@ ConnectionPool::CloseIdleDatabases() AssertIsOnOwningThread(); MOZ_ASSERT(mShutdownRequested); - AUTO_PROFILER_LABEL("ConnectionPool::CloseIdleDatabases", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::CloseIdleDatabases", STORAGE); if (!mIdleDatabases.IsEmpty()) { for (IdleDatabaseInfo& idleInfo : mIdleDatabases) { @@ -12446,7 +12446,7 @@ ConnectionPool::ShutdownIdleThreads() AssertIsOnOwningThread(); MOZ_ASSERT(mShutdownRequested); - AUTO_PROFILER_LABEL("ConnectionPool::ShutdownIdleThreads", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::ShutdownIdleThreads", STORAGE); if (!mIdleThreads.IsEmpty()) { for (uint32_t threadCount = mIdleThreads.Length(), threadIndex = 0; @@ -12465,7 +12465,7 @@ ConnectionPool::ScheduleTransaction(TransactionInfo* aTransactionInfo, AssertIsOnOwningThread(); MOZ_ASSERT(aTransactionInfo); - AUTO_PROFILER_LABEL("ConnectionPool::ScheduleTransaction", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::ScheduleTransaction", STORAGE); DatabaseInfo* dbInfo = aTransactionInfo->mDatabaseInfo; MOZ_ASSERT(dbInfo); @@ -12596,7 +12596,7 @@ ConnectionPool::NoteFinishedTransaction(uint64_t aTransactionId) { AssertIsOnOwningThread(); - AUTO_PROFILER_LABEL("ConnectionPool::NoteFinishedTransaction", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::NoteFinishedTransaction", STORAGE); TransactionInfo* transactionInfo = mTransactions.Get(aTransactionId); MOZ_ASSERT(transactionInfo); @@ -12682,7 +12682,7 @@ ConnectionPool::ScheduleQueuedTransactions(ThreadInfo& aThreadInfo) MOZ_ASSERT(!mQueuedTransactions.IsEmpty()); MOZ_ASSERT(!mIdleThreads.Contains(aThreadInfo)); - AUTO_PROFILER_LABEL("ConnectionPool::ScheduleQueuedTransactions", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::ScheduleQueuedTransactions", STORAGE); mIdleThreads.InsertElementSorted(aThreadInfo); @@ -12714,7 +12714,7 @@ ConnectionPool::NoteIdleDatabase(DatabaseInfo* aDatabaseInfo) MOZ_ASSERT(aDatabaseInfo->mThreadInfo.mRunnable); MOZ_ASSERT(!mIdleDatabases.Contains(aDatabaseInfo)); - AUTO_PROFILER_LABEL("ConnectionPool::NoteIdleDatabase", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::NoteIdleDatabase", STORAGE); const bool otherDatabasesWaiting = !mQueuedTransactions.IsEmpty(); @@ -12751,7 +12751,7 @@ ConnectionPool::NoteClosedDatabase(DatabaseInfo* aDatabaseInfo) MOZ_ASSERT(aDatabaseInfo->mClosing); MOZ_ASSERT(!mIdleDatabases.Contains(aDatabaseInfo)); - AUTO_PROFILER_LABEL("ConnectionPool::NoteClosedDatabase", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::NoteClosedDatabase", STORAGE); aDatabaseInfo->mClosing = false; @@ -12855,7 +12855,7 @@ ConnectionPool::MaybeFireCallback(DatabasesCompleteCallback* aCallback) MOZ_ASSERT(!aCallback->mDatabaseIds.IsEmpty()); MOZ_ASSERT(aCallback->mCallback); - AUTO_PROFILER_LABEL("ConnectionPool::MaybeFireCallback", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::MaybeFireCallback", STORAGE); for (uint32_t count = aCallback->mDatabaseIds.Length(), index = 0; index < count; @@ -12926,7 +12926,7 @@ ConnectionPool::CloseDatabaseWhenIdleInternal(const nsACString& aDatabaseId) AssertIsOnOwningThread(); MOZ_ASSERT(!aDatabaseId.IsEmpty()); - AUTO_PROFILER_LABEL("ConnectionPool::CloseDatabaseWhenIdleInternal", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::CloseDatabaseWhenIdleInternal", STORAGE); if (DatabaseInfo* dbInfo = mDatabases.Get(aDatabaseId)) { if (mIdleDatabases.RemoveElement(dbInfo) || @@ -13003,7 +13003,7 @@ CloseConnectionRunnable::Run() { MOZ_ASSERT(mDatabaseInfo); - AUTO_PROFILER_LABEL("ConnectionPool::CloseConnectionRunnable::Run", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::CloseConnectionRunnable::Run", STORAGE); if (mOwningEventTarget) { MOZ_ASSERT(mDatabaseInfo->mClosing); @@ -13132,7 +13132,7 @@ FinishCallbackWrapper::Run() MOZ_ASSERT(mCallback); MOZ_ASSERT(mOwningEventTarget); - AUTO_PROFILER_LABEL("ConnectionPool::FinishCallbackWrapper::Run", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::FinishCallbackWrapper::Run", STORAGE); if (!mHasRunOnce) { MOZ_ASSERT(!IsOnBackgroundThread()); @@ -13196,7 +13196,7 @@ ThreadRunnable::Run() { // Scope for the profiler label. - AUTO_PROFILER_LABEL("ConnectionPool::ThreadRunnable::Run", DOM); + AUTO_PROFILER_LABEL("ConnectionPool::ThreadRunnable::Run", STORAGE); DebugOnly currentThread = NS_GetCurrentThread(); MOZ_ASSERT(currentThread); @@ -14004,7 +14004,7 @@ Database::EnsureConnection() MOZ_ASSERT(!NS_IsMainThread()); MOZ_ASSERT(!IsOnBackgroundThread()); - AUTO_PROFILER_LABEL("Database::EnsureConnection", DOM); + AUTO_PROFILER_LABEL("Database::EnsureConnection", STORAGE); if (!mConnection || !mConnection->GetStorageConnection()) { nsresult rv = @@ -19466,7 +19466,7 @@ UpgradeFileIdsFunction::OnFunctionCall(mozIStorageValueArray* aArguments, MOZ_ASSERT(aResult); MOZ_ASSERT(mFileManager); - AUTO_PROFILER_LABEL("UpgradeFileIdsFunction::OnFunctionCall", DOM); + AUTO_PROFILER_LABEL("UpgradeFileIdsFunction::OnFunctionCall", STORAGE); uint32_t argc; nsresult rv = aArguments->GetNumEntries(&argc); @@ -19639,7 +19639,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob( MOZ_ASSERT(aInfo); AUTO_PROFILER_LABEL( - "DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob", DOM); + "DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob", STORAGE); const char* compressed = reinterpret_cast(aBlobData); size_t compressedLength = size_t(aBlobDataLength); @@ -19693,7 +19693,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromExternalBlob( AUTO_PROFILER_LABEL( "DatabaseOperationBase::GetStructuredCloneReadInfoFromExternalBlob", - DOM); + STORAGE); nsresult rv; @@ -19922,7 +19922,7 @@ DatabaseOperationBase::IndexDataValuesFromUpdateInfos( MOZ_ASSERT_IF(!aUpdateInfos.IsEmpty(), aUniqueIndexTable.Count()); AUTO_PROFILER_LABEL( - "DatabaseOperationBase::IndexDataValuesFromUpdateInfos", DOM); + "DatabaseOperationBase::IndexDataValuesFromUpdateInfos", STORAGE); const uint32_t count = aUpdateInfos.Length(); @@ -19965,7 +19965,7 @@ DatabaseOperationBase::InsertIndexTableRows( aConnection->AssertIsOnConnectionThread(); MOZ_ASSERT(!aObjectStoreKey.IsUnset()); - AUTO_PROFILER_LABEL("DatabaseOperationBase::InsertIndexTableRows", DOM); + AUTO_PROFILER_LABEL("DatabaseOperationBase::InsertIndexTableRows", STORAGE); const uint32_t count = aIndexValues.Length(); if (!count) { @@ -20073,7 +20073,7 @@ DatabaseOperationBase::DeleteIndexDataTableRows( MOZ_ASSERT(!aObjectStoreKey.IsUnset()); AUTO_PROFILER_LABEL( - "DatabaseOperationBase::DeleteIndexDataTableRows", DOM); + "DatabaseOperationBase::DeleteIndexDataTableRows", STORAGE); const uint32_t count = aIndexValues.Length(); if (!count) { @@ -20167,7 +20167,7 @@ DatabaseOperationBase::DeleteObjectStoreDataTableRowsWithIndexes( AUTO_PROFILER_LABEL( "DatabaseOperationBase::DeleteObjectStoreDataTableRowsWithIndexes", - DOM); + STORAGE); const bool singleRowOnly = aKeyRange.type() == OptionalKeyRange::TSerializedKeyRange && @@ -20307,7 +20307,7 @@ DatabaseOperationBase::UpdateIndexValues( aConnection->AssertIsOnConnectionThread(); MOZ_ASSERT(!aObjectStoreKey.IsUnset()); - AUTO_PROFILER_LABEL("DatabaseOperationBase::UpdateIndexValues", DOM); + AUTO_PROFILER_LABEL("DatabaseOperationBase::UpdateIndexValues", STORAGE); UniqueFreePtr indexDataValues; uint32_t indexDataValuesLength; @@ -21472,7 +21472,7 @@ OpenDatabaseOp::DoDatabaseWork() AssertIsOnIOThread(); MOZ_ASSERT(mState == State::DatabaseWorkOpen); - AUTO_PROFILER_LABEL("OpenDatabaseOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("OpenDatabaseOp::DoDatabaseWork", STORAGE); if (NS_WARN_IF(QuotaClient::IsShuttingDownOnNonBackgroundThread()) || !OperationMayProceed()) { @@ -22664,7 +22664,7 @@ VersionChangeOp::DoDatabaseWork(DatabaseConnection* aConnection) } AUTO_PROFILER_LABEL( - "OpenDatabaseOp::VersionChangeOp::DoDatabaseWork", DOM); + "OpenDatabaseOp::VersionChangeOp::DoDatabaseWork", STORAGE); IDB_LOG_MARK("IndexedDB %s: Parent Transaction[%lld]: " "Beginning database work", @@ -22765,7 +22765,7 @@ DeleteDatabaseOp::LoadPreviousVersion(nsIFile* aDatabaseFile) MOZ_ASSERT(mState == State::DatabaseWorkOpen); MOZ_ASSERT(!mPreviousVersion); - AUTO_PROFILER_LABEL("DeleteDatabaseOp::LoadPreviousVersion", DOM); + AUTO_PROFILER_LABEL("DeleteDatabaseOp::LoadPreviousVersion", STORAGE); nsresult rv; @@ -22852,7 +22852,7 @@ DeleteDatabaseOp::DoDatabaseWork() AssertIsOnIOThread(); MOZ_ASSERT(mState == State::DatabaseWorkOpen); - AUTO_PROFILER_LABEL("DeleteDatabaseOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("DeleteDatabaseOp::DoDatabaseWork", STORAGE); if (NS_WARN_IF(QuotaClient::IsShuttingDownOnNonBackgroundThread()) || !OperationMayProceed()) { @@ -23102,7 +23102,7 @@ VersionChangeOp::DeleteFile(nsIFile* aDirectory, MOZ_ASSERT(mDeleteDatabaseOp->mState == State::DatabaseWorkVersionChange); - AUTO_PROFILER_LABEL("DeleteDatabaseOp::VersionChangeOp::DeleteFile", DOM); + AUTO_PROFILER_LABEL("DeleteDatabaseOp::VersionChangeOp::DeleteFile", STORAGE); nsCOMPtr file; nsresult rv = aDirectory->Clone(getter_AddRefs(file)); @@ -23162,7 +23162,7 @@ VersionChangeOp::RunOnIOThread() MOZ_ASSERT(mDeleteDatabaseOp->mState == State::DatabaseWorkVersionChange); AUTO_PROFILER_LABEL( - "DeleteDatabaseOp::VersionChangeOp::RunOnIOThread", DOM); + "DeleteDatabaseOp::VersionChangeOp::RunOnIOThread", STORAGE); if (NS_WARN_IF(QuotaClient::IsShuttingDownOnNonBackgroundThread()) || !OperationMayProceed()) { @@ -23494,7 +23494,7 @@ TransactionDatabaseOperationBase::RunOnConnectionThread() MOZ_ASSERT(NS_SUCCEEDED(mResultCode)); AUTO_PROFILER_LABEL( - "TransactionDatabaseOperationBase::RunOnConnectionThread", DOM); + "TransactionDatabaseOperationBase::RunOnConnectionThread", STORAGE); // There are several cases where we don't actually have to to any work here. @@ -23882,7 +23882,7 @@ CommitOp::Run() MOZ_ASSERT(mTransaction); mTransaction->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("TransactionBase::CommitOp::Run", DOM); + AUTO_PROFILER_LABEL("TransactionBase::CommitOp::Run", STORAGE); IDB_LOG_MARK("IndexedDB %s: Parent Transaction[%lld] Request[%llu]: " "Beginning database work", @@ -23974,7 +23974,7 @@ CommitOp::TransactionFinishedBeforeUnblock() AssertIsOnBackgroundThread(); MOZ_ASSERT(mTransaction); - AUTO_PROFILER_LABEL("CommitOp::TransactionFinishedBeforeUnblock", DOM); + AUTO_PROFILER_LABEL("CommitOp::TransactionFinishedBeforeUnblock", STORAGE); if (!IsActorDestroyed()) { mTransaction->UpdateMetadata(mResultCode); @@ -24139,7 +24139,7 @@ CreateFileOp::DoDatabaseWork() AssertIsOnIOThread(); MOZ_ASSERT(mState == State::DatabaseWork); - AUTO_PROFILER_LABEL("CreateFileOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("CreateFileOp::DoDatabaseWork", STORAGE); if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) { NS_WARNING("Refusing to create file because disk space is low!"); @@ -24282,7 +24282,7 @@ CreateObjectStoreOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("CreateObjectStoreOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("CreateObjectStoreOp::DoDatabaseWork", STORAGE); if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) { return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR; @@ -24384,7 +24384,7 @@ DeleteObjectStoreOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("DeleteObjectStoreOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("DeleteObjectStoreOp::DoDatabaseWork", STORAGE); NS_NAMED_LITERAL_CSTRING(objectStoreIdString, "object_store_id"); @@ -24605,7 +24605,7 @@ RenameObjectStoreOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("RenameObjectStoreOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("RenameObjectStoreOp::DoDatabaseWork", STORAGE); if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) { return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR; @@ -24701,7 +24701,7 @@ CreateIndexOp::InsertDataFromObjectStore(DatabaseConnection* aConnection) MOZ_ASSERT(!IndexedDatabaseManager::InLowDiskSpaceMode()); MOZ_ASSERT(mMaybeUniqueIndexTable); - AUTO_PROFILER_LABEL("CreateIndexOp::InsertDataFromObjectStore", DOM); + AUTO_PROFILER_LABEL("CreateIndexOp::InsertDataFromObjectStore", STORAGE); nsCOMPtr storageConnection = aConnection->GetStorageConnection(); @@ -24791,7 +24791,7 @@ CreateIndexOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("CreateIndexOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("CreateIndexOp::DoDatabaseWork", STORAGE); if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) { return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR; @@ -24933,7 +24933,7 @@ UpdateIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aValues, MOZ_ASSERT(mOp); AUTO_PROFILER_LABEL( - "CreateIndexOp::UpdateIndexDataValuesFunction::OnFunctionCall", DOM); + "CreateIndexOp::UpdateIndexDataValuesFunction::OnFunctionCall", STORAGE); #ifdef DEBUG { @@ -25162,7 +25162,7 @@ DeleteIndexOp::RemoveReferencesToIndex(DatabaseConnection* aConnection, }; }; - AUTO_PROFILER_LABEL("DeleteIndexOp::RemoveReferencesToIndex", DOM); + AUTO_PROFILER_LABEL("DeleteIndexOp::RemoveReferencesToIndex", STORAGE); if (mIsLastIndex) { // There is no need to parse the previous entry in the index_data_values @@ -25302,7 +25302,7 @@ DeleteIndexOp::DoDatabaseWork(DatabaseConnection* aConnection) } #endif - AUTO_PROFILER_LABEL("DeleteIndexOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("DeleteIndexOp::DoDatabaseWork", STORAGE); DatabaseConnection::AutoSavepoint autoSave; nsresult rv = autoSave.Start(Transaction()); @@ -25559,7 +25559,7 @@ RenameIndexOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("RenameIndexOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("RenameIndexOp::DoDatabaseWork", STORAGE); if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) { return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR; @@ -26059,7 +26059,7 @@ ObjectStoreAddOrPutRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) aConnection->AssertIsOnConnectionThread(); MOZ_ASSERT(aConnection->GetStorageConnection()); - AUTO_PROFILER_LABEL("ObjectStoreAddOrPutRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("ObjectStoreAddOrPutRequestOp::DoDatabaseWork", STORAGE); if (NS_WARN_IF(IndexedDatabaseManager::InLowDiskSpaceMode())) { return NS_ERROR_DOM_INDEXEDDB_QUOTA_ERR; @@ -26555,7 +26555,7 @@ ObjectStoreGetRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) OptionalKeyRange::TSerializedKeyRange); MOZ_ASSERT_IF(!mGetAll, mLimit == 1); - AUTO_PROFILER_LABEL("ObjectStoreGetRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("ObjectStoreGetRequestOp::DoDatabaseWork", STORAGE); const bool hasKeyRange = mOptionalKeyRange.type() == OptionalKeyRange::TSerializedKeyRange; @@ -26769,7 +26769,7 @@ ObjectStoreGetKeyRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("ObjectStoreGetKeyRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("ObjectStoreGetKeyRequestOp::DoDatabaseWork", STORAGE); const bool hasKeyRange = mOptionalKeyRange.type() == OptionalKeyRange::TSerializedKeyRange; @@ -26890,7 +26890,7 @@ ObjectStoreDeleteRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) { MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("ObjectStoreDeleteRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("ObjectStoreDeleteRequestOp::DoDatabaseWork", STORAGE); DatabaseConnection::AutoSavepoint autoSave; nsresult rv = autoSave.Start(Transaction()); @@ -26981,7 +26981,7 @@ ObjectStoreClearRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("ObjectStoreClearRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("ObjectStoreClearRequestOp::DoDatabaseWork", STORAGE); DatabaseConnection::AutoSavepoint autoSave; nsresult rv = autoSave.Start(Transaction()); @@ -27042,7 +27042,7 @@ ObjectStoreCountRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("ObjectStoreCountRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("ObjectStoreCountRequestOp::DoDatabaseWork", STORAGE); const bool hasKeyRange = mParams.optionalKeyRange().type() == OptionalKeyRange::TSerializedKeyRange; @@ -27205,7 +27205,7 @@ IndexGetRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) OptionalKeyRange::TSerializedKeyRange); MOZ_ASSERT_IF(!mGetAll, mLimit == 1); - AUTO_PROFILER_LABEL("IndexGetRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("IndexGetRequestOp::DoDatabaseWork", STORAGE); const bool hasKeyRange = mOptionalKeyRange.type() == OptionalKeyRange::TSerializedKeyRange; @@ -27406,7 +27406,7 @@ IndexGetKeyRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) OptionalKeyRange::TSerializedKeyRange); MOZ_ASSERT_IF(!mGetAll, mLimit == 1); - AUTO_PROFILER_LABEL("IndexGetKeyRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("IndexGetKeyRequestOp::DoDatabaseWork", STORAGE); const bool hasKeyRange = mOptionalKeyRange.type() == OptionalKeyRange::TSerializedKeyRange; @@ -27517,7 +27517,7 @@ IndexCountRequestOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(aConnection); aConnection->AssertIsOnConnectionThread(); - AUTO_PROFILER_LABEL("IndexCountRequestOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("IndexCountRequestOp::DoDatabaseWork", STORAGE); const bool hasKeyRange = mParams.optionalKeyRange().type() == OptionalKeyRange::TSerializedKeyRange; @@ -27803,7 +27803,7 @@ OpenOp::DoObjectStoreDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(mCursor->mObjectStoreId); MOZ_ASSERT(mCursor->mFileManager); - AUTO_PROFILER_LABEL("Cursor::OpenOp::DoObjectStoreDatabaseWork", DOM); + AUTO_PROFILER_LABEL("Cursor::OpenOp::DoObjectStoreDatabaseWork", STORAGE); const bool usingKeyRange = mOptionalKeyRange.type() == OptionalKeyRange::TSerializedKeyRange; @@ -27961,7 +27961,7 @@ OpenOp::DoObjectStoreKeyDatabaseWork(DatabaseConnection* aConnection) OpenCursorParams::TObjectStoreOpenKeyCursorParams); MOZ_ASSERT(mCursor->mObjectStoreId); - AUTO_PROFILER_LABEL("Cursor::OpenOp::DoObjectStoreKeyDatabaseWork", DOM); + AUTO_PROFILER_LABEL("Cursor::OpenOp::DoObjectStoreKeyDatabaseWork", STORAGE); const bool usingKeyRange = mOptionalKeyRange.type() == OptionalKeyRange::TSerializedKeyRange; @@ -28117,7 +28117,7 @@ OpenOp::DoIndexDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(mCursor->mObjectStoreId); MOZ_ASSERT(mCursor->mIndexId); - AUTO_PROFILER_LABEL("Cursor::OpenOp::DoIndexDatabaseWork", DOM); + AUTO_PROFILER_LABEL("Cursor::OpenOp::DoIndexDatabaseWork", STORAGE); const bool usingKeyRange = mOptionalKeyRange.type() == OptionalKeyRange::TSerializedKeyRange; @@ -28364,7 +28364,7 @@ OpenOp::DoIndexKeyDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(mCursor->mObjectStoreId); MOZ_ASSERT(mCursor->mIndexId); - AUTO_PROFILER_LABEL("Cursor::OpenOp::DoIndexKeyDatabaseWork", DOM); + AUTO_PROFILER_LABEL("Cursor::OpenOp::DoIndexKeyDatabaseWork", STORAGE); const bool usingKeyRange = mOptionalKeyRange.type() == OptionalKeyRange::TSerializedKeyRange; @@ -28604,7 +28604,7 @@ OpenOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT(mCursor->mKey.IsUnset()); MOZ_ASSERT(mCursor->mRangeKey.IsUnset()); - AUTO_PROFILER_LABEL("Cursor::OpenOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("Cursor::OpenOp::DoDatabaseWork", STORAGE); nsresult rv; @@ -28688,7 +28688,7 @@ ContinueOp::DoDatabaseWork(DatabaseConnection* aConnection) MOZ_ASSERT_IF(isIndex, mCursor->mIndexId); MOZ_ASSERT_IF(isIndex, !mCursor->mObjectKey.IsUnset()); - AUTO_PROFILER_LABEL("Cursor::ContinueOp::DoDatabaseWork", DOM); + AUTO_PROFILER_LABEL("Cursor::ContinueOp::DoDatabaseWork", STORAGE); // We need to pick a query based on whether or not a key was passed to the // continue function. If not we'll grab the the next item in the database that @@ -29475,7 +29475,7 @@ FileHelper::SyncCopy(nsIInputStream* aInputStream, MOZ_ASSERT(aInputStream); MOZ_ASSERT(aOutputStream); - AUTO_PROFILER_LABEL("FileHelper::SyncCopy", DOM); + AUTO_PROFILER_LABEL("FileHelper::SyncCopy", STORAGE); nsresult rv; diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp index 3a7bffdf2cccb..853c36098143e 100644 --- a/dom/ipc/ContentChild.cpp +++ b/dom/ipc/ContentChild.cpp @@ -2520,7 +2520,7 @@ ContentChild::RecvAsyncMessage(const nsString& aMsg, const ClonedMessageData& aData) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "ContentChild::RecvAsyncMessage", OTHER, aMsg); + "ContentChild::RecvAsyncMessage", EVENTS, aMsg); CrossProcessCpowHolder cpows(this, aCpows); RefPtr cpm = diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index a3c4f6e3ca92b..a70a1e79c6e25 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -2304,7 +2304,7 @@ TabChild::RecvAsyncMessage(const nsString& aMessage, const ClonedMessageData& aData) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "TabChild::RecvAsyncMessage", OTHER, aMessage); + "TabChild::RecvAsyncMessage", EVENTS, aMessage); CrossProcessCpowHolder cpows(Manager(), aCpows); if (!mTabChildGlobal) { diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 33c77564a2d66..8c1b2caadfb55 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -1672,7 +1672,7 @@ TabParent::RecvSyncMessage(const nsString& aMessage, nsTArray* aRetVal) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "TabParent::RecvSyncMessage", OTHER, aMessage); + "TabParent::RecvSyncMessage", EVENTS, aMessage); StructuredCloneData data; ipc::UnpackClonedMessageDataForParent(aData, data); @@ -1692,7 +1692,7 @@ TabParent::RecvRpcMessage(const nsString& aMessage, nsTArray* aRetVal) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "TabParent::RecvRpcMessage", OTHER, aMessage); + "TabParent::RecvRpcMessage", EVENTS, aMessage); StructuredCloneData data; ipc::UnpackClonedMessageDataForParent(aData, data); @@ -1711,7 +1711,7 @@ TabParent::RecvAsyncMessage(const nsString& aMessage, const ClonedMessageData& aData) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "TabParent::RecvAsyncMessage", OTHER, aMessage); + "TabParent::RecvAsyncMessage", EVENTS, aMessage); StructuredCloneData data; ipc::UnpackClonedMessageDataForParent(aData, data); diff --git a/dom/ipc/nsIContentChild.cpp b/dom/ipc/nsIContentChild.cpp index 2503f6dc81581..2283d06fee9fe 100644 --- a/dom/ipc/nsIContentChild.cpp +++ b/dom/ipc/nsIContentChild.cpp @@ -174,7 +174,7 @@ nsIContentChild::RecvAsyncMessage(const nsString& aMsg, const ClonedMessageData& aData) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "nsIContentChild::RecvAsyncMessage", OTHER, aMsg); + "nsIContentChild::RecvAsyncMessage", EVENTS, aMsg); CrossProcessCpowHolder cpows(this, aCpows); RefPtr cpm = nsFrameMessageManager::GetChildProcessManager(); diff --git a/dom/ipc/nsIContentParent.cpp b/dom/ipc/nsIContentParent.cpp index 492a3b06dca8c..2f4ca4b70f90b 100644 --- a/dom/ipc/nsIContentParent.cpp +++ b/dom/ipc/nsIContentParent.cpp @@ -249,7 +249,7 @@ nsIContentParent::RecvSyncMessage(const nsString& aMsg, nsTArray* aRetvals) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "nsIContentParent::RecvSyncMessage", OTHER, aMsg); + "nsIContentParent::RecvSyncMessage", EVENTS, aMsg); CrossProcessCpowHolder cpows(this, aCpows); RefPtr ppm = mMessageManager; @@ -271,7 +271,7 @@ nsIContentParent::RecvRpcMessage(const nsString& aMsg, nsTArray* aRetvals) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "nsIContentParent::RecvRpcMessage", OTHER, aMsg); + "nsIContentParent::RecvRpcMessage", EVENTS, aMsg); CrossProcessCpowHolder cpows(this, aCpows); RefPtr ppm = mMessageManager; @@ -331,7 +331,7 @@ nsIContentParent::RecvAsyncMessage(const nsString& aMsg, const ClonedMessageData& aData) { AUTO_PROFILER_LABEL_DYNAMIC_LOSSY_NSSTRING( - "nsIContentParent::RecvAsyncMessage", OTHER, aMsg); + "nsIContentParent::RecvAsyncMessage", EVENTS, aMsg); CrossProcessCpowHolder cpows(this, aCpows); RefPtr ppm = mMessageManager; diff --git a/dom/storage/StorageDBThread.cpp b/dom/storage/StorageDBThread.cpp index c894ba47fed8e..6ff705daf38cc 100644 --- a/dom/storage/StorageDBThread.cpp +++ b/dom/storage/StorageDBThread.cpp @@ -333,7 +333,7 @@ StorageDBThread::Shutdown() void StorageDBThread::SyncPreload(LocalStorageCacheBridge* aCache, bool aForceSync) { - AUTO_PROFILER_LABEL("StorageDBThread::SyncPreload", OTHER); + AUTO_PROFILER_LABEL("StorageDBThread::SyncPreload", STORAGE); if (!aForceSync && aCache->LoadedCount()) { // Preload already started for this cache, just wait for it to finish. // LoadWait will exit after LoadDone on the cache has been called. diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index c21f7fb8deea8..70ef13b3b9751 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -3820,8 +3820,6 @@ WorkerPrivate::DisableMemoryReporter() void WorkerPrivate::WaitForWorkerEvents() { - AUTO_PROFILER_LABEL("WorkerPrivate::WaitForWorkerEvents", IDLE); - AssertIsOnWorkerThread(); mMutex.AssertCurrentThreadOwns(); diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index d92931c00ed64..48fc71a05cb6a 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -899,7 +899,7 @@ void gfxWindowsPlatform::SchedulePaintIfDeviceReset() { AUTO_PROFILER_LABEL("gfxWindowsPlatform::SchedulePaintIfDeviceReset", - OTHER); + GRAPHICS); DeviceResetReason resetReason = DeviceResetReason::OK; if (!DidRenderingDeviceReset(&resetReason)) { diff --git a/ipc/chromium/src/base/message_pump_default.cc b/ipc/chromium/src/base/message_pump_default.cc index 076b21d66b609..5e29a0e617474 100644 --- a/ipc/chromium/src/base/message_pump_default.cc +++ b/ipc/chromium/src/base/message_pump_default.cc @@ -21,8 +21,6 @@ MessagePumpDefault::MessagePumpDefault() } void MessagePumpDefault::Run(Delegate* delegate) { - AUTO_PROFILER_LABEL("MessagePumpDefault::Run", OTHER); - DCHECK(keep_running_) << "Quit must have been called outside of Run!"; const MessageLoop* const loop = MessageLoop::current(); @@ -57,7 +55,7 @@ void MessagePumpDefault::Run(Delegate* delegate) { if (delayed_work_time_.is_null()) { hangMonitor.NotifyWait(); - AUTO_PROFILER_LABEL("MessagePumpDefault::Run:Wait", IDLE); + AUTO_PROFILER_LABEL("MessagePumpDefault::Run:Wait", OTHER); { AUTO_PROFILER_THREAD_SLEEP; event_.Wait(); @@ -66,7 +64,7 @@ void MessagePumpDefault::Run(Delegate* delegate) { TimeDelta delay = delayed_work_time_ - TimeTicks::Now(); if (delay > TimeDelta()) { hangMonitor.NotifyWait(); - AUTO_PROFILER_LABEL("MessagePumpDefault::Run:Wait", IDLE); + AUTO_PROFILER_LABEL("MessagePumpDefault::Run:Wait", OTHER); { AUTO_PROFILER_THREAD_SLEEP; event_.TimedWait(delay); diff --git a/js/public/ProfilingStack.h b/js/public/ProfilingStack.h index e76e9ce4474cf..2815bb1f844bc 100644 --- a/js/public/ProfilingStack.h +++ b/js/public/ProfilingStack.h @@ -145,7 +145,8 @@ class ProfilingStackFrame // Line number for non-JS stack frames, the bytecode offset otherwise. mozilla::Atomic lineOrPcOffset; - // Bits 0...1 hold the Kind. Bits 2...31 hold the category. + // Bits 0...1 hold the Kind. Bits 2...3 are unused. Bits 4...12 hold the + // Category. mozilla::Atomic kindAndCategory_; static int32_t pcToOffset(JSScript* aScript, jsbytecode* aPc); @@ -184,27 +185,29 @@ class ProfilingStackFrame // ignored. JS_OSR = 3, - KIND_BITCOUNT = 2, - KIND_MASK = (1 << KIND_BITCOUNT) - 1 + KIND_MASK = 0x3, }; // Keep these in sync with devtools/client/performance/modules/categories.js enum class Category : uint32_t { - IDLE, - OTHER, - LAYOUT, - JS, - GCCC, - NETWORK, - GRAPHICS, - DOM, + OTHER = 1u << 4, + CSS = 1u << 5, + JS = 1u << 6, + GC = 1u << 7, + CC = 1u << 8, + NETWORK = 1u << 9, + GRAPHICS = 1u << 10, + STORAGE = 1u << 11, + EVENTS = 1u << 12, FIRST = OTHER, - LAST = DOM, + LAST = EVENTS, + + CATEGORY_MASK = ~uint32_t(Kind::KIND_MASK), }; - static_assert(uint32_t(Category::LAST) <= (UINT32_MAX >> uint32_t(Kind::KIND_BITCOUNT)), - "Too many categories to fit into u32 with two bits reserved for the kind"); + static_assert((uint32_t(Category::FIRST) & uint32_t(Kind::KIND_MASK)) == 0, + "Category overlaps with Kind"); bool isLabelFrame() const { @@ -234,7 +237,7 @@ class ProfilingStackFrame dynamicString_ = aDynamicString; spOrScript = sp; lineOrPcOffset = static_cast(aLine); - kindAndCategory_ = uint32_t(Kind::LABEL) | (uint32_t(aCategory) << uint32_t(Kind::KIND_BITCOUNT)); + kindAndCategory_ = uint32_t(Kind::LABEL) | uint32_t(aCategory); MOZ_ASSERT(isLabelFrame()); } @@ -244,7 +247,7 @@ class ProfilingStackFrame dynamicString_ = nullptr; spOrScript = sp; lineOrPcOffset = 0; - kindAndCategory_ = uint32_t(Kind::SP_MARKER) | (uint32_t(Category::OTHER) << uint32_t(Kind::KIND_BITCOUNT)); + kindAndCategory_ = uint32_t(Kind::SP_MARKER) | uint32_t(ProfilingStackFrame::Category::OTHER); MOZ_ASSERT(isSpMarkerFrame()); } @@ -255,12 +258,12 @@ class ProfilingStackFrame dynamicString_ = aDynamicString; spOrScript = aScript; lineOrPcOffset = pcToOffset(aScript, aPc); - kindAndCategory_ = uint32_t(Kind::JS_NORMAL) | (uint32_t(Category::JS) << uint32_t(Kind::KIND_BITCOUNT)); + kindAndCategory_ = uint32_t(Kind::JS_NORMAL) | uint32_t(Category::JS); MOZ_ASSERT(isJsFrame()); } void setKind(Kind aKind) { - kindAndCategory_ = uint32_t(aKind) | (uint32_t(category()) << uint32_t(Kind::KIND_BITCOUNT)); + kindAndCategory_ = uint32_t(aKind) | uint32_t(category()); } Kind kind() const { @@ -268,7 +271,7 @@ class ProfilingStackFrame } Category category() const { - return Category(kindAndCategory_ >> uint32_t(Kind::KIND_BITCOUNT)); + return Category(kindAndCategory_ & uint32_t(Category::CATEGORY_MASK)); } void* stackAddress() const { diff --git a/js/src/gc/GC.cpp b/js/src/gc/GC.cpp index 4fc11db056ff6..2172f27217528 100644 --- a/js/src/gc/GC.cpp +++ b/js/src/gc/GC.cpp @@ -6823,7 +6823,7 @@ AutoTraceSession::AutoTraceSession(JSRuntime* rt, JS::HeapState heapState) : runtime(rt), prevState(rt->mainContextFromOwnThread()->heapState), profilingStackFrame(rt->mainContextFromOwnThread(), HeapStateToLabel(heapState), - ProfilingStackFrame::Category::GCCC) + ProfilingStackFrame::Category::GC) { MOZ_ASSERT(prevState == JS::HeapState::Idle); MOZ_ASSERT(heapState != JS::HeapState::Idle); diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 2ab8b65d3a728..1a2b016318fae 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -2729,7 +2729,7 @@ nsXPCComponents_Utils::CrashIfNotInAutomation() NS_IMETHODIMP nsXPCComponents_Utils::NukeSandbox(HandleValue obj, JSContext* cx) { - AUTO_PROFILER_LABEL("nsXPCComponents_Utils::NukeSandbox", OTHER); + AUTO_PROFILER_LABEL("nsXPCComponents_Utils::NukeSandbox", JS); NS_ENSURE_TRUE(obj.isObject(), NS_ERROR_INVALID_ARG); JSObject* wrapper = &obj.toObject(); NS_ENSURE_TRUE(IsWrapper(wrapper), NS_ERROR_INVALID_ARG); diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 092a5573aae8d..1daa406ab6e5d 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -4188,7 +4188,7 @@ PresShell::DoFlushPendingNotifications(mozilla::ChangesToFlush aFlush) "Display" }; AUTO_PROFILER_LABEL_DYNAMIC_CSTR("PresShell::DoFlushPendingNotifications", - LAYOUT, flushTypeNames[flushType]); + GRAPHICS, flushTypeNames[flushType]); #endif @@ -8849,7 +8849,7 @@ PresShell::DoReflow(nsIFrame* target, bool aInterruptible) #ifdef MOZ_GECKO_PROFILER nsIURI* uri = mDocument->GetDocumentURI(); AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING( - "PresShell::DoReflow", LAYOUT, + "PresShell::DoReflow", GRAPHICS, uri ? uri->GetSpecOrDefault() : NS_LITERAL_CSTRING("N/A")); #endif diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index 106b372bc6b0c..db72d82890526 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -1310,7 +1310,7 @@ RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) mDestroyedFrames = MakeUnique>>(); } - AUTO_PROFILER_LABEL("RestyleManager::ProcessRestyledFrames", LAYOUT); + AUTO_PROFILER_LABEL("RestyleManager::ProcessRestyledFrames", CSS); nsPresContext* presContext = PresContext(); nsCSSFrameConstructor* frameConstructor = presContext->FrameConstructor(); diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 590b3fa78ad48..f07813a589cad 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -3111,7 +3111,7 @@ struct AutoNestedPaintCount { nsIFrame* nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, uint32_t aFlags) { - AUTO_PROFILER_LABEL("nsLayoutUtils::GetFrameForPoint", LAYOUT); + AUTO_PROFILER_LABEL("nsLayoutUtils::GetFrameForPoint", GRAPHICS); nsresult rv; AutoTArray outFrames; @@ -3125,7 +3125,7 @@ nsLayoutUtils::GetFramesForArea(nsIFrame* aFrame, const nsRect& aRect, nsTArray &aOutFrames, uint32_t aFlags) { - AUTO_PROFILER_LABEL("nsLayoutUtils::GetFramesForArea", LAYOUT); + AUTO_PROFILER_LABEL("nsLayoutUtils::GetFramesForArea", GRAPHICS); nsDisplayListBuilder builder(aFrame, nsDisplayListBuilderMode::EVENT_DELIVERY, diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index a95f6309a23b5..d50dfa1bdc778 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -1763,7 +1763,7 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) return; } - AUTO_PROFILER_LABEL("nsRefreshDriver::Tick", LAYOUT); + AUTO_PROFILER_LABEL("nsRefreshDriver::Tick", GRAPHICS); // We're either frozen or we were disconnected (likely in the middle // of a tick iteration). Just do nothing here, since our diff --git a/layout/style/ComputedStyle.cpp b/layout/style/ComputedStyle.cpp index 33f6c08401b93..5716c504f4f39 100644 --- a/layout/style/ComputedStyle.cpp +++ b/layout/style/ComputedStyle.cpp @@ -61,7 +61,7 @@ ComputedStyle::CalcStyleDifference(ComputedStyle* aNewContext, uint32_t* aEqualStructs) { MOZ_ASSERT(aNewContext); - AUTO_PROFILER_LABEL("ComputedStyle::CalcStyleDifference", LAYOUT); + AUTO_PROFILER_LABEL("ComputedStyle::CalcStyleDifference", CSS); static_assert(StyleStructConstants::kStyleStructCount <= 32, "aEqualStructs is not big enough"); diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp index 1e22478e252eb..03283e37c2539 100644 --- a/storage/mozStorageConnection.cpp +++ b/storage/mozStorageConnection.cpp @@ -672,7 +672,7 @@ Connection::initialize() { NS_ASSERTION (!mDBConn, "Initialize called on already opened database!"); MOZ_ASSERT(!mIgnoreLockingMode, "Can't ignore locking on an in-memory db."); - AUTO_PROFILER_LABEL("Connection::initialize", OTHER); + AUTO_PROFILER_LABEL("Connection::initialize", STORAGE); // in memory database requested, sqlite uses a magic file name int srv = ::sqlite3_open_v2(":memory:", &mDBConn, mFlags, GetVFSName()); @@ -695,7 +695,7 @@ Connection::initialize(nsIFile *aDatabaseFile) { NS_ASSERTION (aDatabaseFile, "Passed null file!"); NS_ASSERTION (!mDBConn, "Initialize called on already opened database!"); - AUTO_PROFILER_LABEL("Connection::initialize", OTHER); + AUTO_PROFILER_LABEL("Connection::initialize", STORAGE); mDatabaseFile = aDatabaseFile; @@ -732,7 +732,7 @@ Connection::initialize(nsIFileURL *aFileURL) { NS_ASSERTION (aFileURL, "Passed null file URL!"); NS_ASSERTION (!mDBConn, "Initialize called on already opened database!"); - AUTO_PROFILER_LABEL("Connection::initialize", OTHER); + AUTO_PROFILER_LABEL("Connection::initialize", STORAGE); nsCOMPtr databaseFile; nsresult rv = aFileURL->GetFile(getter_AddRefs(databaseFile)); @@ -1495,7 +1495,7 @@ NS_IMETHODIMP Connection::AsyncClone(bool aReadOnly, mozIStorageCompletionCallback *aCallback) { - AUTO_PROFILER_LABEL("Connection::AsyncClone", OTHER); + AUTO_PROFILER_LABEL("Connection::AsyncClone", STORAGE); NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_NOT_SAME_THREAD); if (!mDBConn) @@ -1683,7 +1683,7 @@ Connection::Clone(bool aReadOnly, { MOZ_ASSERT(threadOpenedOn == NS_GetCurrentThread()); - AUTO_PROFILER_LABEL("Connection::Clone", OTHER); + AUTO_PROFILER_LABEL("Connection::Clone", STORAGE); if (!mDBConn) return NS_ERROR_NOT_INITIALIZED; diff --git a/storage/mozStorageStatement.cpp b/storage/mozStorageStatement.cpp index 02d583c180276..ca812e45616af 100644 --- a/storage/mozStorageStatement.cpp +++ b/storage/mozStorageStatement.cpp @@ -554,7 +554,7 @@ Statement::Execute() NS_IMETHODIMP Statement::ExecuteStep(bool *_moreResults) { - AUTO_PROFILER_LABEL("Statement::ExecuteStep", OTHER); + AUTO_PROFILER_LABEL("Statement::ExecuteStep", STORAGE); if (!mDBStatement) return NS_ERROR_NOT_INITIALIZED; diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index 4a52cfecf33e0..a3f77b430daa5 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -1559,53 +1559,13 @@ StreamTaskTracer(PSLockRef aLock, SpliceableJSONWriter& aWriter) #endif } -static void -StreamCategories(SpliceableJSONWriter& aWriter) -{ - // Same order as ProfilingStackFrame::Category. - // The list of available color names is: - // transparent, grey, purple, yellow, orange, lightblue, green, blue, magenta - aWriter.Start(); - aWriter.StringProperty("name", "Idle"); - aWriter.StringProperty("color", "transparent"); - aWriter.EndObject(); - aWriter.Start(); - aWriter.StringProperty("name", "Other"); - aWriter.StringProperty("color", "grey"); - aWriter.EndObject(); - aWriter.Start(); - aWriter.StringProperty("name", "Layout"); - aWriter.StringProperty("color", "purple"); - aWriter.EndObject(); - aWriter.Start(); - aWriter.StringProperty("name", "JavaScript"); - aWriter.StringProperty("color", "yellow"); - aWriter.EndObject(); - aWriter.Start(); - aWriter.StringProperty("name", "GC / CC"); - aWriter.StringProperty("color", "orange"); - aWriter.EndObject(); - aWriter.Start(); - aWriter.StringProperty("name", "Network"); - aWriter.StringProperty("color", "lightblue"); - aWriter.EndObject(); - aWriter.Start(); - aWriter.StringProperty("name", "Graphics"); - aWriter.StringProperty("color", "green"); - aWriter.EndObject(); - aWriter.Start(); - aWriter.StringProperty("name", "DOM"); - aWriter.StringProperty("color", "blue"); - aWriter.EndObject(); -} - static void StreamMetaJSCustomObject(PSLockRef aLock, SpliceableJSONWriter& aWriter, bool aIsShuttingDown) { MOZ_RELEASE_ASSERT(CorePS::Exists() && ActivePS::Exists(aLock)); - aWriter.IntProperty("version", 11); + aWriter.IntProperty("version", 10); // The "startTime" field holds the number of milliseconds since midnight // January 1, 1970 GMT. This grotty code computes (Now - (Now - @@ -1623,10 +1583,6 @@ StreamMetaJSCustomObject(PSLockRef aLock, SpliceableJSONWriter& aWriter, aWriter.NullProperty("shutdownTime"); } - aWriter.StartArrayProperty("categories"); - StreamCategories(aWriter); - aWriter.EndArray(); - if (!NS_IsMainThread()) { // Leave the rest of the properties out if we're not on the main thread. // At the moment, the only case in which this function is called on a diff --git a/tools/profiler/tests/gtest/GeckoProfiler.cpp b/tools/profiler/tests/gtest/GeckoProfiler.cpp index 1657d3cd29c9a..975af7ef2614d 100644 --- a/tools/profiler/tests/gtest/GeckoProfiler.cpp +++ b/tools/profiler/tests/gtest/GeckoProfiler.cpp @@ -479,9 +479,9 @@ TEST(GeckoProfiler, Markers) okstr1[kMax - 1] = '\0'; okstr2[kMax - 1] = '\0'; longstr[kMax] = '\0'; - AUTO_PROFILER_LABEL_DYNAMIC_CSTR("", LAYOUT, okstr1.get()); - AUTO_PROFILER_LABEL_DYNAMIC_CSTR("okstr2", LAYOUT, okstr2.get()); - AUTO_PROFILER_LABEL_DYNAMIC_CSTR("", LAYOUT, longstr.get()); + AUTO_PROFILER_LABEL_DYNAMIC_CSTR("", CSS, okstr1.get()); + AUTO_PROFILER_LABEL_DYNAMIC_CSTR("okstr2", CSS, okstr2.get()); + AUTO_PROFILER_LABEL_DYNAMIC_CSTR("", CSS, longstr.get()); // Sleep briefly to ensure a sample is taken and the pending markers are // processed. @@ -695,7 +695,7 @@ TEST(GeckoProfiler, ProfilingStack) } AutoProfilerLabel label1("A", nullptr, 888, - js::ProfilingStackFrame::Category::DOM); + js::ProfilingStackFrame::Category::STORAGE); AutoProfilerLabel label2("A", dynamic.get(), 888, js::ProfilingStackFrame::Category::NETWORK); ASSERT_TRUE(profiler_get_backtrace()); diff --git a/view/nsViewManager.cpp b/view/nsViewManager.cpp index 2975ca10a2020..c8ffcfc33b980 100644 --- a/view/nsViewManager.cpp +++ b/view/nsViewManager.cpp @@ -752,7 +752,7 @@ nsViewManager::DispatchEvent(WidgetGUIEvent *aEvent, nsView* aView, nsEventStatus* aStatus) { - AUTO_PROFILER_LABEL("nsViewManager::DispatchEvent", OTHER); + AUTO_PROFILER_LABEL("nsViewManager::DispatchEvent", EVENTS); WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent(); if ((mouseEvent && diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp index b387673ab935a..11f4cb8c28231 100644 --- a/widget/android/nsAppShell.cpp +++ b/widget/android/nsAppShell.cpp @@ -707,7 +707,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) { EVLOG("nsAppShell::ProcessNextNativeEvent %d", mayWait); - AUTO_PROFILER_LABEL("nsAppShell::ProcessNextNativeEvent", OTHER); + AUTO_PROFILER_LABEL("nsAppShell::ProcessNextNativeEvent", EVENTS); mozilla::UniquePtr curEvent; @@ -726,7 +726,7 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) } AUTO_PROFILER_LABEL("nsAppShell::ProcessNextNativeEvent:Wait", - IDLE); + EVENTS); mozilla::HangMonitor::Suspend(); curEvent = mEventQueue.Pop(/* mayWait */ true); diff --git a/widget/cocoa/nsAppShell.mm b/widget/cocoa/nsAppShell.mm index a9eda60811ab3..637bcfeb7abab 100644 --- a/widget/cocoa/nsAppShell.mm +++ b/widget/cocoa/nsAppShell.mm @@ -131,11 +131,6 @@ @implementation GeckoNSApplication - (void)sendEvent:(NSEvent *)anEvent { - // Mark this function as non-idle because it's one of the exit points from - // the event loop (running inside of -[GeckoNSApplication nextEventMatchingMask:...]) - // into non-idle code. So we basically unset the IDLE category from the inside. - AUTO_PROFILER_LABEL("-[GeckoNSApplication sendEvent:]", OTHER); - mozilla::HangMonitor::NotifyActivity(); if ([anEvent type] == NSApplicationDefined && [anEvent subtype] == kEventSubtypeTrace) { @@ -157,20 +152,6 @@ - (NSEvent*)nextEventMatchingMask:(NSUInteger)mask inMode:(NSString*)mode dequeue:(BOOL)flag { - // When we're waiting in the event loop, this is the last function under our - // control that's on the stack, so this is the function that we mark with the - // IDLE category. - // However, when we're processing an event or when our CFRunLoopSource runs, - // this function is still on the stack - "the event loop calls us". So we - // need to mark functions that enter non-idle code with a different profiler - // category, usually OTHER. This gives the profiler a rough approximation of - // idleness but isn't perfect. For example, sometimes there's some Cocoa- - // internal activity that's triggered from the event loop, and we'll - // misidentify the stacks for that activity as idle because there's no Gecko - // code on the stack that can change the stack's category to something - // non-idle. - AUTO_PROFILER_LABEL("-[GeckoNSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]", IDLE); - if (expiration) { mozilla::HangMonitor::Suspend(); } @@ -419,7 +400,7 @@ - (void)beginMenuTracking:(NSNotification*)aNotification; nsAppShell::ProcessGeckoEvents(void* aInfo) { NS_OBJC_BEGIN_TRY_ABORT_BLOCK; - AUTO_PROFILER_LABEL("nsAppShell::ProcessGeckoEvents", OTHER); + AUTO_PROFILER_LABEL("nsAppShell::ProcessGeckoEvents", EVENTS); nsAppShell* self = static_cast (aInfo); diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index 079232ca24ad8..6eae655380b8b 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -3766,7 +3766,7 @@ - (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext return; } - AUTO_PROFILER_LABEL("ChildView::drawRect", OTHER); + AUTO_PROFILER_LABEL("ChildView::drawRect", GRAPHICS); // The CGContext that drawRect supplies us with comes with a transform that // scales one user space unit to one Cocoa point, which can consist of @@ -3832,7 +3832,7 @@ - (BOOL)isUsingOpenGL - (void)drawUsingOpenGL { - AUTO_PROFILER_LABEL("ChildView::drawUsingOpenGL", OTHER); + AUTO_PROFILER_LABEL("ChildView::drawUsingOpenGL", GRAPHICS); if (![self isUsingOpenGL] || !mGeckoChild->IsVisible()) return; diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp index bba47d093964f..c81dac529b40c 100644 --- a/widget/gtk/nsAppShell.cpp +++ b/widget/gtk/nsAppShell.cpp @@ -49,7 +49,6 @@ PollWrapper(GPollFD *ufds, guint nfsd, gint timeout_) mozilla::HangMonitor::Suspend(); gint result; { - AUTO_PROFILER_LABEL("PollWrapper", IDLE); AUTO_PROFILER_THREAD_SLEEP; result = (*sPollFunc)(ufds, nfsd, timeout_); } diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 78deed71e8563..e959c7cca7fe7 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -1518,7 +1518,7 @@ nsWindow::GetClientBounds() void nsWindow::UpdateClientOffset() { - AUTO_PROFILER_LABEL("nsWindow::UpdateClientOffset", OTHER); + AUTO_PROFILER_LABEL("nsWindow::UpdateClientOffset", GRAPHICS); if (!mIsTopLevel || !mShell || !mIsX11Display || gtk_window_get_window_type(GTK_WINDOW(mShell)) == GTK_WINDOW_POPUP) { diff --git a/widget/uikit/nsWindow.mm b/widget/uikit/nsWindow.mm index 62832e9174101..c8941fbafb2f4 100644 --- a/widget/uikit/nsWindow.mm +++ b/widget/uikit/nsWindow.mm @@ -271,7 +271,7 @@ - (BOOL)isUsingMainThreadOpenGL - (void)drawUsingOpenGL { ALOG("drawUsingOpenGL"); - AUTO_PROFILER_LABEL("ChildView::drawUsingOpenGL", OTHER); + AUTO_PROFILER_LABEL("ChildView::drawUsingOpenGL", GRAPHICS); if (!mGeckoChild->IsVisible()) return; @@ -326,7 +326,7 @@ - (void)drawRect:(CGRect)aRect inContext:(CGContextRef)aContext [self drawUsingOpenGL]; return; } - AUTO_PROFILER_LABEL("ChildView::drawRect", OTHER); + AUTO_PROFILER_LABEL("ChildView::drawRect", GRAPHICS); // The CGContext that drawRect supplies us with comes with a transform that // scales one user space unit to one Cocoa point, which can consist of diff --git a/widget/windows/nsAppShell.cpp b/widget/windows/nsAppShell.cpp index 163f2efb564f4..78ef76e9ff6d0 100644 --- a/widget/windows/nsAppShell.cpp +++ b/widget/windows/nsAppShell.cpp @@ -540,7 +540,6 @@ nsAppShell::ProcessNextNativeEvent(bool mayWait) // Block and wait for any posted application message mozilla::HangMonitor::Suspend(); { - AUTO_PROFILER_LABEL("nsAppShell::ProcessNextNativeEvent::Wait", IDLE); AUTO_PROFILER_THREAD_SLEEP; WinUtils::WaitForMessage(); } diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index 72cb2c0247439..9e595304dd2b8 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -4262,7 +4262,7 @@ nsCycleCollector_forgetSkippable(js::SliceBudget& aBudget, MOZ_ASSERT(data); MOZ_ASSERT(data->mCollector); - AUTO_PROFILER_LABEL("nsCycleCollector_forgetSkippable", GCCC); + AUTO_PROFILER_LABEL("nsCycleCollector_forgetSkippable", CC); TimeLog timeLog; data->mCollector->ForgetSkippable(aBudget, @@ -4309,7 +4309,7 @@ nsCycleCollector_collect(nsICycleCollectorListener* aManualListener) MOZ_ASSERT(data); MOZ_ASSERT(data->mCollector); - AUTO_PROFILER_LABEL("nsCycleCollector_collect", GCCC); + AUTO_PROFILER_LABEL("nsCycleCollector_collect", CC); SliceBudget unlimitedBudget = SliceBudget::unlimited(); data->mCollector->Collect(ManualCC, unlimitedBudget, aManualListener); @@ -4325,7 +4325,7 @@ nsCycleCollector_collectSlice(SliceBudget& budget, MOZ_ASSERT(data); MOZ_ASSERT(data->mCollector); - AUTO_PROFILER_LABEL("nsCycleCollector_collectSlice", GCCC); + AUTO_PROFILER_LABEL("nsCycleCollector_collectSlice", CC); data->mCollector->Collect(SliceCC, budget, nullptr, aPreferShorterSlices); } @@ -4365,7 +4365,7 @@ nsCycleCollector_shutdown(bool aDoCollect) if (data) { MOZ_ASSERT(data->mCollector); - AUTO_PROFILER_LABEL("nsCycleCollector_shutdown", OTHER); + AUTO_PROFILER_LABEL("nsCycleCollector_shutdown", CC); if (gMainThreadCollector == data->mCollector) { gMainThreadCollector = nullptr; diff --git a/xpcom/io/FileUtilsWin.cpp b/xpcom/io/FileUtilsWin.cpp index 07c7a13a72135..69c6ba8b9ba6a 100644 --- a/xpcom/io/FileUtilsWin.cpp +++ b/xpcom/io/FileUtilsWin.cpp @@ -40,7 +40,7 @@ bool HandleToFilename(HANDLE aHandle, const LARGE_INTEGER& aOffset, nsAString& aFilename) { - AUTO_PROFILER_LABEL("HandletoFilename", OTHER); + AUTO_PROFILER_LABEL("HandletoFilename", NETWORK); aFilename.Truncate(); // This implementation is nice because it uses fully documented APIs that diff --git a/xpcom/threads/Scheduler.cpp b/xpcom/threads/Scheduler.cpp index cd1e0f1bc2374..61b70d30d044e 100644 --- a/xpcom/threads/Scheduler.cpp +++ b/xpcom/threads/Scheduler.cpp @@ -286,7 +286,6 @@ SchedulerEventQueue::GetEvent(bool aMayWait, if (mScheduler) { CooperativeThreadPool::Yield(mScheduler->GetQueueResource(), lock); } else { - AUTO_PROFILER_LABEL("SchedulerEventQueue::GetEvent::Wait", IDLE); mNonCooperativeCondVar.Wait(); } } diff --git a/xpcom/threads/ThreadEventQueue.cpp b/xpcom/threads/ThreadEventQueue.cpp index 8113d9a689380..1a4cdafcb216d 100644 --- a/xpcom/threads/ThreadEventQueue.cpp +++ b/xpcom/threads/ThreadEventQueue.cpp @@ -152,7 +152,6 @@ ThreadEventQueue::GetEvent(bool aMayWait, break; } - AUTO_PROFILER_LABEL("ThreadEventQueue::GetEvent::Wait", IDLE); mEventsAvailable.Wait(); } diff --git a/xpcom/threads/nsThreadPool.cpp b/xpcom/threads/nsThreadPool.cpp index a8fc41a86aed7..0a2dc21ee0953 100644 --- a/xpcom/threads/nsThreadPool.cpp +++ b/xpcom/threads/nsThreadPool.cpp @@ -213,8 +213,6 @@ nsThreadPool::Run() } shutdownThreadOnExit = mThreads.RemoveObject(current); } else { - AUTO_PROFILER_LABEL("nsThreadPool::Run::Wait", IDLE); - TimeDuration delta = timeout - (now - idleSince); LOG(("THRD-P(%p) %s waiting [%f]\n", this, mName.BeginReading(), delta.ToMilliseconds()));