aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Kyostila <skyostil@google.com>2021-08-20 17:10:15 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-08-20 17:10:15 +0000
commit31155364cd4e79d09c92df884510e149ca67df5e (patch)
treec39fb6dcbd58e1771d5fb45314a1496aecfd8692
parent63ad74ac51b7de1a305c80c5766f21f94641dc10 (diff)
parentd212bf54262ce8c311819f733798a5b63dad7e61 (diff)
downloadperfetto-studio-main.tar.gz
-rw-r--r--include/perfetto/tracing/internal/track_event_macros.h10
-rw-r--r--include/perfetto/tracing/track_event_legacy.h4
2 files changed, 9 insertions, 5 deletions
diff --git a/include/perfetto/tracing/internal/track_event_macros.h b/include/perfetto/tracing/internal/track_event_macros.h
index 0c7ffb778..4663c1876 100644
--- a/include/perfetto/tracing/internal/track_event_macros.h
+++ b/include/perfetto/tracing/internal/track_event_macros.h
@@ -59,11 +59,15 @@
/* variable), we need two separate copies of the registry with different */ \
/* storage specifiers. */ \
/**/ \
+ /* Note that because of a Clang/Windows bug, the constexpr category */ \
+ /* registry isn't given the enabled/disabled state array. All access */ \
+ /* to the category states should therefore be done through the */ \
+ /* non-constexpr registry. See */ \
+ /* https://bugs.llvm.org/show_bug.cgi?id=51558 */ \
+ /**/ \
/* TODO(skyostil): Unify these using a C++17 inline constexpr variable. */ \
constexpr ::perfetto::internal::TrackEventCategoryRegistry \
- kConstExprCategoryRegistry(kCategoryCount, \
- &kCategories[0], \
- &g_category_state_storage[0]); \
+ kConstExprCategoryRegistry(kCategoryCount, &kCategories[0], nullptr); \
PERFETTO_COMPONENT_EXPORT extern const ::perfetto::internal:: \
TrackEventCategoryRegistry kCategoryRegistry; \
static_assert(kConstExprCategoryRegistry.ValidateCategories(), \
diff --git a/include/perfetto/tracing/track_event_legacy.h b/include/perfetto/tracing/track_event_legacy.h
index d0f18291e..6be024bd4 100644
--- a/include/perfetto/tracing/track_event_legacy.h
+++ b/include/perfetto/tracing/track_event_legacy.h
@@ -1257,7 +1257,7 @@ class PERFETTO_EXPORT TrackEventLegacy {
"Enabled flag pointers are not supported for dynamic trace " \
"categories."); \
}, \
- PERFETTO_TRACK_EVENT_NAMESPACE::internal::kConstExprCategoryRegistry \
+ PERFETTO_TRACK_EVENT_NAMESPACE::internal::kCategoryRegistry \
.GetCategoryState( \
::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kCategoryRegistry \
.Find(category, /*is_dynamic=*/false)))
@@ -1265,7 +1265,7 @@ class PERFETTO_EXPORT TrackEventLegacy {
// Given a pointer returned by TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED,
// yields a pointer to the name of the corresponding category group.
#define TRACE_EVENT_API_GET_CATEGORY_GROUP_NAME(category_enabled_ptr) \
- ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kConstExprCategoryRegistry \
+ ::PERFETTO_TRACK_EVENT_NAMESPACE::internal::kCategoryRegistry \
.GetCategory( \
category_enabled_ptr - \
reinterpret_cast<const uint8_t*>( \