mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-25 20:01:50 +00:00
Bug 1645464 - Use a shared ProfilingCategoryList.h r=gerald,froydnj
Replace the duplicate lists in mozglue/baseprofiler/public and js/public with a shared list. Add this list to both moz.build files so it is published twice which simplifies supporting different standalone configurations. Differential Revision: https://phabricator.services.mozilla.com/D79520
This commit is contained in:
parent
b59c6a3e54
commit
6aa5132146
@ -67,6 +67,7 @@ included_inclnames_to_ignore = set([
|
||||
'jit/CacheIROpsGenerated.h', # generated in $OBJDIR
|
||||
'jit/LOpcodesGenerated.h', # generated in $OBJDIR
|
||||
'jit/MOpcodesGenerated.h', # generated in $OBJDIR
|
||||
'js/ProfilingCategoryList.h', # comes from mozglue/baseprofiler
|
||||
'jscustomallocator.h', # provided by embedders; allowed to be missing
|
||||
'js-config.h', # generated in $OBJDIR
|
||||
'fdlibm.h', # fdlibm
|
||||
|
@ -9,98 +9,13 @@
|
||||
|
||||
#include "jstypes.h" // JS_FRIEND_API
|
||||
|
||||
// clang-format off
|
||||
|
||||
// This higher-order macro lists all categories with their subcategories.
|
||||
//
|
||||
// PROFILING_CATEGORY_LIST(BEGIN_CATEGORY, SUBCATEGORY, END_CATEGORY)
|
||||
// BEGIN_CATEGORY(name, labelAsString, colorAsString)
|
||||
// SUBCATEGORY(category, name, labelAsString)
|
||||
// END_CATEGORY
|
||||
//
|
||||
// The list of available color names for categories is:
|
||||
// transparent, grey, purple, yellow, orange, lightblue, green, blue, magenta
|
||||
//
|
||||
// Categories and subcategories are used for stack-based instrumentation. They
|
||||
// are specified in label frames in the profiling stack, see ProfilingStack.h.
|
||||
// At any point, the category pair of the topmost profiler label frame in the
|
||||
// label stack determines the category pair of that stack.
|
||||
// Each category describes a type of workload that the CPU can be busy with.
|
||||
// Categories should be non-overlapping: the list of categories should be
|
||||
// chosen in such a way that every possible stack can be mapped to a single
|
||||
// category unambiguously.
|
||||
|
||||
#define PROFILING_CATEGORY_LIST(BEGIN_CATEGORY, SUBCATEGORY, END_CATEGORY) \
|
||||
BEGIN_CATEGORY(IDLE, "Idle", "transparent") \
|
||||
SUBCATEGORY(IDLE, IDLE, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(OTHER, "Other", "grey") \
|
||||
SUBCATEGORY(OTHER, OTHER_PreferenceRead, "Preference Read") \
|
||||
SUBCATEGORY(OTHER, OTHER, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(LAYOUT, "Layout", "purple") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT, "Other") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction, "Frame construction") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_Reflow, "Reflow") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing, "CSS parsing") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery, "Selector query") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation, "Style computation") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JS, "JavaScript", "yellow") \
|
||||
SUBCATEGORY(JS, JS, "Other") \
|
||||
SUBCATEGORY(JS, JS_Parsing, "JS Parsing") \
|
||||
SUBCATEGORY(JS, JS_IonCompilation, "Ion JIT Compilation") \
|
||||
SUBCATEGORY(JS, JS_BaselineCompilation, "Baseline JIT Compilation") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(GCCC, "GC / CC", "orange") \
|
||||
SUBCATEGORY(GCCC, GCCC, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(NETWORK, "Network", "lightblue") \
|
||||
SUBCATEGORY(NETWORK, NETWORK, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS, "Other") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_DisplayListBuilding, "DisplayList building") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation, "Tile allocation") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList, "WebRender display list") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_Rasterization, "Rasterization") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(DOM, "DOM", "blue") \
|
||||
SUBCATEGORY(DOM, DOM, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_ANDROID, "Android", "yellow") \
|
||||
SUBCATEGORY(JAVA_ANDROID, JAVA_ANDROID, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_ANDROIDX, "AndroidX", "orange") \
|
||||
SUBCATEGORY(JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") \
|
||||
SUBCATEGORY(JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green") \
|
||||
SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_KOTLIN, "Kotlin", "purple") \
|
||||
SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_BLOCKED, "Blocked", "lightblue") \
|
||||
SUBCATEGORY(JAVA_BLOCKED, JAVA_BLOCKED, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(IPC, "IPC", "lightgreen") \
|
||||
SUBCATEGORY(IPC, IPC, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(MEDIA, "Media", "orange") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering") \
|
||||
END_CATEGORY
|
||||
// The source lives in mozglue/baseprofiler/public/ProfilingCategoryList.h
|
||||
#include "js/ProfilingCategoryList.h" // MOZ_PROFILING_CATEGORY_LIST
|
||||
|
||||
namespace JS {
|
||||
|
||||
// clang-format off
|
||||
|
||||
// An enum that lists all possible category pairs in one list.
|
||||
// This is the enum that is used in profiler stack labels. Having one list that
|
||||
// includes subcategories from all categories in one list allows assigning the
|
||||
@ -109,9 +24,9 @@ namespace JS {
|
||||
#define CATEGORY_ENUM_SUBCATEGORY(supercategory, name, labelAsString) name,
|
||||
#define CATEGORY_ENUM_END_CATEGORY
|
||||
enum class ProfilingCategoryPair : uint32_t {
|
||||
PROFILING_CATEGORY_LIST(CATEGORY_ENUM_BEGIN_CATEGORY,
|
||||
CATEGORY_ENUM_SUBCATEGORY,
|
||||
CATEGORY_ENUM_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(CATEGORY_ENUM_BEGIN_CATEGORY,
|
||||
CATEGORY_ENUM_SUBCATEGORY,
|
||||
CATEGORY_ENUM_END_CATEGORY)
|
||||
COUNT,
|
||||
LAST = COUNT - 1,
|
||||
};
|
||||
@ -124,9 +39,9 @@ enum class ProfilingCategoryPair : uint32_t {
|
||||
#define SUPERCATEGORY_ENUM_SUBCATEGORY(supercategory, name, labelAsString)
|
||||
#define SUPERCATEGORY_ENUM_END_CATEGORY
|
||||
enum class ProfilingCategory : uint32_t {
|
||||
PROFILING_CATEGORY_LIST(SUPERCATEGORY_ENUM_BEGIN_CATEGORY,
|
||||
SUPERCATEGORY_ENUM_SUBCATEGORY,
|
||||
SUPERCATEGORY_ENUM_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(SUPERCATEGORY_ENUM_BEGIN_CATEGORY,
|
||||
SUPERCATEGORY_ENUM_SUBCATEGORY,
|
||||
SUPERCATEGORY_ENUM_END_CATEGORY)
|
||||
COUNT,
|
||||
LAST = COUNT - 1,
|
||||
};
|
||||
|
@ -210,6 +210,12 @@ EXPORTS.js += [
|
||||
'../public/Wrapper.h',
|
||||
]
|
||||
|
||||
# This lives in mozglue/baseprofiler but we re-publish ourselves to support
|
||||
# standalone SpiderMonkey configurations.
|
||||
EXPORTS.js += [
|
||||
'../../mozglue/baseprofiler/public/ProfilingCategoryList.h',
|
||||
]
|
||||
|
||||
EXPORTS.js.experimental += [
|
||||
'../public/experimental/SourceHook.h',
|
||||
]
|
||||
|
@ -535,9 +535,9 @@ namespace JS {
|
||||
name,
|
||||
#define SUBCATEGORY_ENUMS_END_CATEGORY \
|
||||
};
|
||||
PROFILING_CATEGORY_LIST(SUBCATEGORY_ENUMS_BEGIN_CATEGORY,
|
||||
SUBCATEGORY_ENUMS_SUBCATEGORY,
|
||||
SUBCATEGORY_ENUMS_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(SUBCATEGORY_ENUMS_BEGIN_CATEGORY,
|
||||
SUBCATEGORY_ENUMS_SUBCATEGORY,
|
||||
SUBCATEGORY_ENUMS_END_CATEGORY)
|
||||
#undef SUBCATEGORY_ENUMS_BEGIN_CATEGORY
|
||||
#undef SUBCATEGORY_ENUMS_SUBCATEGORY
|
||||
#undef SUBCATEGORY_ENUMS_END_CATEGORY
|
||||
@ -552,9 +552,9 @@ PROFILING_CATEGORY_LIST(SUBCATEGORY_ENUMS_BEGIN_CATEGORY,
|
||||
uint32_t(ProfilingSubcategory_##category::name), labelAsString},
|
||||
#define CATEGORY_INFO_END_CATEGORY
|
||||
const ProfilingCategoryPairInfo sProfilingCategoryPairInfo[] = {
|
||||
PROFILING_CATEGORY_LIST(CATEGORY_INFO_BEGIN_CATEGORY,
|
||||
CATEGORY_INFO_SUBCATEGORY,
|
||||
CATEGORY_INFO_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(CATEGORY_INFO_BEGIN_CATEGORY,
|
||||
CATEGORY_INFO_SUBCATEGORY,
|
||||
CATEGORY_INFO_END_CATEGORY)
|
||||
};
|
||||
#undef CATEGORY_INFO_BEGIN_CATEGORY
|
||||
#undef CATEGORY_INFO_SUBCATEGORY
|
||||
|
@ -26,9 +26,9 @@ namespace baseprofiler {
|
||||
name,
|
||||
#define SUBCATEGORY_ENUMS_END_CATEGORY \
|
||||
};
|
||||
BASE_PROFILING_CATEGORY_LIST(SUBCATEGORY_ENUMS_BEGIN_CATEGORY,
|
||||
SUBCATEGORY_ENUMS_SUBCATEGORY,
|
||||
SUBCATEGORY_ENUMS_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(SUBCATEGORY_ENUMS_BEGIN_CATEGORY,
|
||||
SUBCATEGORY_ENUMS_SUBCATEGORY,
|
||||
SUBCATEGORY_ENUMS_END_CATEGORY)
|
||||
#undef SUBCATEGORY_ENUMS_BEGIN_CATEGORY
|
||||
#undef SUBCATEGORY_ENUMS_SUBCATEGORY
|
||||
#undef SUBCATEGORY_ENUMS_END_CATEGORY
|
||||
@ -43,9 +43,9 @@ BASE_PROFILING_CATEGORY_LIST(SUBCATEGORY_ENUMS_BEGIN_CATEGORY,
|
||||
uint32_t(ProfilingSubcategory_##category::name), labelAsString},
|
||||
#define CATEGORY_INFO_END_CATEGORY
|
||||
const ProfilingCategoryPairInfo sProfilingCategoryPairInfo[] = {
|
||||
BASE_PROFILING_CATEGORY_LIST(CATEGORY_INFO_BEGIN_CATEGORY,
|
||||
CATEGORY_INFO_SUBCATEGORY,
|
||||
CATEGORY_INFO_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(CATEGORY_INFO_BEGIN_CATEGORY,
|
||||
CATEGORY_INFO_SUBCATEGORY,
|
||||
CATEGORY_INFO_END_CATEGORY)
|
||||
};
|
||||
#undef CATEGORY_INFO_BEGIN_CATEGORY
|
||||
#undef CATEGORY_INFO_SUBCATEGORY
|
||||
|
@ -1721,9 +1721,9 @@ static void StreamCategories(SpliceableJSONWriter& aWriter) {
|
||||
aWriter.EndArray(); \
|
||||
aWriter.EndObject();
|
||||
|
||||
BASE_PROFILING_CATEGORY_LIST(CATEGORY_JSON_BEGIN_CATEGORY,
|
||||
CATEGORY_JSON_SUBCATEGORY,
|
||||
CATEGORY_JSON_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(CATEGORY_JSON_BEGIN_CATEGORY,
|
||||
CATEGORY_JSON_SUBCATEGORY,
|
||||
CATEGORY_JSON_END_CATEGORY)
|
||||
|
||||
#undef CATEGORY_JSON_BEGIN_CATEGORY
|
||||
#undef CATEGORY_JSON_SUBCATEGORY
|
||||
|
@ -17,6 +17,7 @@ if CONFIG['MOZ_GECKO_PROFILER']:
|
||||
'public/BaseProfilerSharedLibraries.h',
|
||||
'public/BaseProfilingCategory.h',
|
||||
'public/BaseProfilingStack.h',
|
||||
'public/ProfilingCategoryList.h',
|
||||
]
|
||||
UNIFIED_SOURCES += [
|
||||
'core/PageInformation.cpp',
|
||||
|
@ -17,99 +17,13 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "ProfilingCategoryList.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace baseprofiler {
|
||||
|
||||
// clang-format off
|
||||
|
||||
// This higher-order macro lists all categories with their subcategories.
|
||||
//
|
||||
// BASE_PROFILING_CATEGORY_LIST(BEGIN_CATEGORY, SUBCATEGORY, END_CATEGORY)
|
||||
// BEGIN_CATEGORY(name, labelAsString, colorAsString)
|
||||
// SUBCATEGORY(category, name, labelAsString)
|
||||
// END_CATEGORY
|
||||
//
|
||||
// The list of available color names for categories is:
|
||||
// transparent, grey, purple, yellow, orange, lightblue, green, blue, magenta
|
||||
//
|
||||
// Categories and subcategories are used for stack-based instrumentation. They
|
||||
// are specified in label frames in the profiling stack, see ProfilingStack.h.
|
||||
// At any point, the category pair of the topmost profiler label frame in the
|
||||
// label stack determines the category pair of that stack.
|
||||
// Each category describes a type of workload that the CPU can be busy with.
|
||||
// Categories should be non-overlapping: the list of categories should be
|
||||
// chosen in such a way that every possible stack can be mapped to a single
|
||||
// category unambiguously.
|
||||
|
||||
#define BASE_PROFILING_CATEGORY_LIST(BEGIN_CATEGORY, SUBCATEGORY, \
|
||||
END_CATEGORY) \
|
||||
BEGIN_CATEGORY(IDLE, "Idle", "transparent") \
|
||||
SUBCATEGORY(IDLE, IDLE, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(OTHER, "Other", "grey") \
|
||||
SUBCATEGORY(OTHER, OTHER, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(LAYOUT, "Layout", "purple") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT, "Other") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction, "Frame construction") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_Reflow, "Reflow") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing, "CSS parsing") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery, "Selector query") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation, "Style computation") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JS, "JavaScript", "yellow") \
|
||||
SUBCATEGORY(JS, JS, "Other") \
|
||||
SUBCATEGORY(JS, JS_Parsing, "JS Parsing") \
|
||||
SUBCATEGORY(JS, JS_IonCompilation, "Ion JIT Compilation") \
|
||||
SUBCATEGORY(JS, JS_BaselineCompilation, "Baseline JIT Compilation") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(GCCC, "GC / CC", "orange") \
|
||||
SUBCATEGORY(GCCC, GCCC, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(NETWORK, "Network", "lightblue") \
|
||||
SUBCATEGORY(NETWORK, NETWORK, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS, "Other") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_DisplayListBuilding, "DisplayList building") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation, "Tile allocation") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList, "WebRender display list") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_Rasterization, "Rasterization") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(DOM, "DOM", "blue") \
|
||||
SUBCATEGORY(DOM, DOM, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_ANDROID, "Android", "yellow") \
|
||||
SUBCATEGORY(JAVA_ANDROID, JAVA_ANDROID, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_ANDROIDX, "AndroidX", "orange") \
|
||||
SUBCATEGORY(JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") \
|
||||
SUBCATEGORY(JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green") \
|
||||
SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_KOTLIN, "Kotlin", "purple") \
|
||||
SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_BLOCKED, "Blocked", "lightblue") \
|
||||
SUBCATEGORY(JAVA_BLOCKED, JAVA_BLOCKED, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(IPC, "IPC", "lightgreen") \
|
||||
SUBCATEGORY(IPC, IPC, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(MEDIA, "Media", "orange") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time processing") \
|
||||
END_CATEGORY
|
||||
|
||||
// An enum that lists all possible category pairs in one list.
|
||||
// This is the enum that is used in profiler stack labels. Having one list that
|
||||
// includes subcategories from all categories in one list allows assigning the
|
||||
@ -118,9 +32,9 @@ namespace baseprofiler {
|
||||
#define CATEGORY_ENUM_SUBCATEGORY(supercategory, name, labelAsString) name,
|
||||
#define CATEGORY_ENUM_END_CATEGORY
|
||||
enum class ProfilingCategoryPair : uint32_t {
|
||||
BASE_PROFILING_CATEGORY_LIST(CATEGORY_ENUM_BEGIN_CATEGORY,
|
||||
CATEGORY_ENUM_SUBCATEGORY,
|
||||
CATEGORY_ENUM_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(CATEGORY_ENUM_BEGIN_CATEGORY,
|
||||
CATEGORY_ENUM_SUBCATEGORY,
|
||||
CATEGORY_ENUM_END_CATEGORY)
|
||||
COUNT,
|
||||
LAST = COUNT - 1,
|
||||
};
|
||||
@ -133,9 +47,9 @@ enum class ProfilingCategoryPair : uint32_t {
|
||||
#define SUPERCATEGORY_ENUM_SUBCATEGORY(supercategory, name, labelAsString)
|
||||
#define SUPERCATEGORY_ENUM_END_CATEGORY
|
||||
enum class ProfilingCategory : uint32_t {
|
||||
BASE_PROFILING_CATEGORY_LIST(SUPERCATEGORY_ENUM_BEGIN_CATEGORY,
|
||||
SUPERCATEGORY_ENUM_SUBCATEGORY,
|
||||
SUPERCATEGORY_ENUM_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(SUPERCATEGORY_ENUM_BEGIN_CATEGORY,
|
||||
SUPERCATEGORY_ENUM_SUBCATEGORY,
|
||||
SUPERCATEGORY_ENUM_END_CATEGORY)
|
||||
COUNT,
|
||||
LAST = COUNT - 1,
|
||||
};
|
||||
|
101
mozglue/baseprofiler/public/ProfilingCategoryList.h
Normal file
101
mozglue/baseprofiler/public/ProfilingCategoryList.h
Normal file
@ -0,0 +1,101 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
* vim: set ts=8 sts=2 et sw=2 tw=99:
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#ifndef baseprofiler_ProfilingCategoryList_h
|
||||
#define baseprofiler_ProfilingCategoryList_h
|
||||
|
||||
// Profiler sub-categories are applied to each sampled stack to describe the
|
||||
// type of workload that the CPU is busy with. Only one sub-category can be
|
||||
// assigned so be mindful that these are non-overlapping. The active category is
|
||||
// set by pushing a label to the profiling stack, or by the unwinder in cases
|
||||
// such as JITs. A profile sample in arbitrary C++/Rust will typically be
|
||||
// categorized based on the top of the label stack.
|
||||
//
|
||||
// The list of available color names for categories is:
|
||||
// transparent
|
||||
// blue
|
||||
// green
|
||||
// grey
|
||||
// lightblue
|
||||
// magenta
|
||||
// orange
|
||||
// purple
|
||||
// yellow
|
||||
|
||||
// clang-format off
|
||||
|
||||
#define MOZ_PROFILING_CATEGORY_LIST(BEGIN_CATEGORY, SUBCATEGORY, END_CATEGORY) \
|
||||
BEGIN_CATEGORY(IDLE, "Idle", "transparent") \
|
||||
SUBCATEGORY(IDLE, IDLE, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(OTHER, "Other", "grey") \
|
||||
SUBCATEGORY(OTHER, OTHER, "Other") \
|
||||
SUBCATEGORY(OTHER, OTHER_PreferenceRead, "Preference Read") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(LAYOUT, "Layout", "purple") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT, "Other") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_FrameConstruction, "Frame construction") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_Reflow, "Reflow") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_CSSParsing, "CSS parsing") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_SelectorQuery, "Selector query") \
|
||||
SUBCATEGORY(LAYOUT, LAYOUT_StyleComputation, "Style computation") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JS, "JavaScript", "yellow") \
|
||||
SUBCATEGORY(JS, JS, "Other") \
|
||||
SUBCATEGORY(JS, JS_Parsing, "JS Parsing") \
|
||||
SUBCATEGORY(JS, JS_IonCompilation, "Ion JIT Compilation") \
|
||||
SUBCATEGORY(JS, JS_BaselineCompilation, "Baseline JIT Compilation") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(GCCC, "GC / CC", "orange") \
|
||||
SUBCATEGORY(GCCC, GCCC, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(NETWORK, "Network", "lightblue") \
|
||||
SUBCATEGORY(NETWORK, NETWORK, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS, "Other") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_DisplayListBuilding, "DisplayList building") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation, "Tile allocation") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList, "WebRender display list") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_Rasterization, "Rasterization") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints") \
|
||||
SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(DOM, "DOM", "blue") \
|
||||
SUBCATEGORY(DOM, DOM, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_ANDROID, "Android", "yellow") \
|
||||
SUBCATEGORY(JAVA_ANDROID, JAVA_ANDROID, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_ANDROIDX, "AndroidX", "orange") \
|
||||
SUBCATEGORY(JAVA_ANDROIDX, JAVA_ANDROIDX, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_LANGUAGE, "Java", "blue") \
|
||||
SUBCATEGORY(JAVA_LANGUAGE, JAVA_LANGUAGE, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_MOZILLA, "Mozilla", "green") \
|
||||
SUBCATEGORY(JAVA_MOZILLA, JAVA_MOZILLA, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_KOTLIN, "Kotlin", "purple") \
|
||||
SUBCATEGORY(JAVA_KOTLIN, JAVA_KOTLIN, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(JAVA_BLOCKED, "Blocked", "lightblue") \
|
||||
SUBCATEGORY(JAVA_BLOCKED, JAVA_BLOCKED, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(IPC, "IPC", "lightgreen") \
|
||||
SUBCATEGORY(IPC, IPC, "Other") \
|
||||
END_CATEGORY \
|
||||
BEGIN_CATEGORY(MEDIA, "Media", "orange") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_CUBEB, "Cubeb") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_PLAYBACK, "Playback") \
|
||||
SUBCATEGORY(MEDIA, MEDIA_RT, "Real-time rendering") \
|
||||
END_CATEGORY
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif // baseprofiler_ProfilingCategoryList_h
|
@ -2232,8 +2232,9 @@ static void StreamCategories(SpliceableJSONWriter& aWriter) {
|
||||
aWriter.EndArray(); \
|
||||
aWriter.EndObject();
|
||||
|
||||
PROFILING_CATEGORY_LIST(CATEGORY_JSON_BEGIN_CATEGORY,
|
||||
CATEGORY_JSON_SUBCATEGORY, CATEGORY_JSON_END_CATEGORY)
|
||||
MOZ_PROFILING_CATEGORY_LIST(CATEGORY_JSON_BEGIN_CATEGORY,
|
||||
CATEGORY_JSON_SUBCATEGORY,
|
||||
CATEGORY_JSON_END_CATEGORY)
|
||||
|
||||
#undef CATEGORY_JSON_BEGIN_CATEGORY
|
||||
#undef CATEGORY_JSON_SUBCATEGORY
|
||||
|
Loading…
x
Reference in New Issue
Block a user