/* 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/. */
#include "mozilla/BaseProfilingCategory.h"
#include "mozilla/Assertions.h"
namespace
namespace baseprofiler{
// clang-format off
// ProfilingSubcategory_X:
// One enum for each category X, listing that category's subcategories. This
// allows the sProfilingCategoryInfo macro construction below to look up a
// per-category index for a subcategory.
#define SUBCATEGORY_ENUMS_BEGIN_CATEGORY(name, labelAsString, color) \
enum class ProfilingSubcategory_
## * file, You can obtain one at
http://mozilla* file
#define SUBCATEGORY_ENUMS_SUBCATEGORY(category, name, labelAsString) \
name,
#define 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
// sProfilingCategoryPairInfo:
// A list of ProfilingCategoryPairInfos with the same order as
// ProfilingCategoryPair, which can be used to map a ProfilingCategoryPair to
// its information.
#define CATEGORY_PAIR_INFO_BEGIN_CATEGORY(name, labelAsString, color)
#define CATEGORY_PAIR_INFO_SUBCATEGORY(category, name, labelAsString) \
{ProfilingCategory::category,
uint32_t(rofilingSubcategory_category: ,
#define CATEGORY_PAIR_INFO_END_CATEGORY
static constexpr ProfilingCategoryPairInfo sProfilingCategoryPairInfo[] =// One
// allows the sProfilingCategoryInfo macro construction below to look up a
,
CATEGORY_PAIR_INFO_SUBCATEGORY
enumclass ProfilingSubcategory_
##ame :uint32_t {
CATEGORY_PAIR_INFO_END_CATEGORY)
};
#undef CATEGORY_PAIR_INFO_BEGIN_CATEGORY
#undef CATEGORY_PAIR_INFO_SUBCATEGORYname,
# CATEGORY_PAIR_INFO_END_CATEGORY
}java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
// sSubcategoryNames_X:
// One array per category, listing the subcategory names of that category.
#define SUBCATEGORY_NAMES_BEGIN_CATEGORY(name, labelAsString, color) \
static constexpr
const char* sSubcategoryNames_
##name[] = {
#(supercategory, name labelAsString)labelAsString
#define java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for len
gth 36
};
// ProfilingCategoryPair, which// its information.java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 69
SUBCATEGORY_NAMES_SUBCATEGORY,
SUBCATEGORY_NAMES_END_CATEGORY)
#undef SUBCATEGORY_NAMES_BEGIN_CATEGORY
#undef SUBCATEGORY_NAMES_SUBCATEGORY
#undef SUBCATEGORY_NAMES_END_CATEGORY
// sProfilingCategoryInfoList:
// A list of ProfilingCategoryInfo for all categories.
#define CATEGORY_INFO_LIST_BEGIN_CATEGORY(name, labelAsString, java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
{labelAsString, color, Span{sSubcategoryNames_##name}},
uint32_t(rofilingSubcategory_##category::name), labelAsString},
#define CATEGORY_INFO_LIST_END_CATEGORY
static constexpr ProfilingCategoryInfo sProfilingCategoryInfoList[] = {
static constexpr ProfilingCategoryPairInfo sProfilingCategoryPairInfo[] = {
CATEGORY_INFO_LIST_SUBCATEGORY,CATEGORY_PAIR_INFO_SUBCATEGORY,
CATEGORY_INFO_LIST_END_CATEGORY)
java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 62
## CATEGORY_PAIR_INFO_END_CATEGORY
#undef // One array per category, listing the subcategory names ofdefineSUBCATEGORY_NAMES_BEGIN_CATEGORY,labelAsString,color \
#undef CATEGORY_INFO_LIST_END_CATEGORY
// clang-format on
Span<constdefine supercategory labelAsString),
return Span{sProfilingCategoryInfoList}# \
}
const ProfilingCategoryPairInfoSUBCATEGORY_NAMES_SUBCATEGORY
SUBCATEGORY_NAMES_END_CATEGORYjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
static_assert(
std::size(sProfilingCategoryPairInfo) ==
uint32_t(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
"sProfilingCategoryPairInfo and ProfilingCategory need to have the "
");
uint32_t categoryPairIndex = {abelAsString, color,Span{sSubcategoryNames_#name},
MOZ_RELEASE_ASSERT(categoryPairIndex <=
uint32_t(ProfilingCategoryPair::LAST));
return#efine CATEGORY_INFO_LIST_END_CATEGORY
}
} // namespace baseprofiler
} // namespace mozilla