diff --git a/config/check_spidermonkey_style.py b/config/check_spidermonkey_style.py index 0f99ce9c6726..d65b1b2e83d2 100644 --- a/config/check_spidermonkey_style.py +++ b/config/check_spidermonkey_style.py @@ -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 diff --git a/js/public/ProfilingCategory.h b/js/public/ProfilingCategory.h index 5773f7499f5c..e922bc5e8c07 100644 --- a/js/public/ProfilingCategory.h +++ b/js/public/ProfilingCategory.h @@ -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, }; diff --git a/js/src/moz.build b/js/src/moz.build index e56c7b0516c3..cbef494025eb 100755 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -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', ] diff --git a/js/src/vm/GeckoProfiler.cpp b/js/src/vm/GeckoProfiler.cpp index 3310aca343ed..efe6ee77bbee 100644 --- a/js/src/vm/GeckoProfiler.cpp +++ b/js/src/vm/GeckoProfiler.cpp @@ -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 diff --git a/mozglue/baseprofiler/core/ProfilingCategory.cpp b/mozglue/baseprofiler/core/ProfilingCategory.cpp index 95f51c587475..8ff2b155551c 100644 --- a/mozglue/baseprofiler/core/ProfilingCategory.cpp +++ b/mozglue/baseprofiler/core/ProfilingCategory.cpp @@ -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 diff --git a/mozglue/baseprofiler/core/platform.cpp b/mozglue/baseprofiler/core/platform.cpp index b90113890ad7..2fe082a31193 100644 --- a/mozglue/baseprofiler/core/platform.cpp +++ b/mozglue/baseprofiler/core/platform.cpp @@ -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 diff --git a/mozglue/baseprofiler/moz.build b/mozglue/baseprofiler/moz.build index 0f3d29a37749..7050985923e4 100644 --- a/mozglue/baseprofiler/moz.build +++ b/mozglue/baseprofiler/moz.build @@ -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', diff --git a/mozglue/baseprofiler/public/BaseProfilingCategory.h b/mozglue/baseprofiler/public/BaseProfilingCategory.h index d466df9bf5c1..237f81aeae99 100644 --- a/mozglue/baseprofiler/public/BaseProfilingCategory.h +++ b/mozglue/baseprofiler/public/BaseProfilingCategory.h @@ -17,99 +17,13 @@ #include +#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, }; diff --git a/mozglue/baseprofiler/public/ProfilingCategoryList.h b/mozglue/baseprofiler/public/ProfilingCategoryList.h new file mode 100644 index 000000000000..af9c95d9277b --- /dev/null +++ b/mozglue/baseprofiler/public/ProfilingCategoryList.h @@ -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 diff --git a/tools/profiler/core/platform.cpp b/tools/profiler/core/platform.cpp index ed76675e13b1..ed7aa4c60c36 100644 --- a/tools/profiler/core/platform.cpp +++ b/tools/profiler/core/platform.cpp @@ -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