diff options
author | Sami Kyostila <skyostil@google.com> | 2021-08-20 17:10:15 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-08-20 17:10:15 +0000 |
commit | 31155364cd4e79d09c92df884510e149ca67df5e (patch) | |
tree | c39fb6dcbd58e1771d5fb45314a1496aecfd8692 | |
parent | 63ad74ac51b7de1a305c80c5766f21f94641dc10 (diff) | |
parent | d212bf54262ce8c311819f733798a5b63dad7e61 (diff) | |
download | perfetto-studio-main.tar.gz |
Merge "tracing: Work around an LLVM bug on Windows"studio-2024.1.2-canary1studio-2024.1.1-canary8studio-2024.1.1-canary6studio-2024.1.1-beta2studio-2023.3.1-rc2studio-2023.3.1-canary8studio-2023.3.1-canary03studio-2023.3.1studio-2023.2.1-rc1studio-2023.2.1-canary05studio-2023.2.1-beta02studio-2023.2.1studio-2023.1.1-patch2studio-2023.1.1-patch1studio-2023.1.1-canary3studio-2023.1.1-canary11studio-2023.1.1-beta05studio-2023.1.1studio-2022.3.1-rc1studio-2022.3.1-canary8studio-2022.3.1-canary1studio-2022.3.1-beta2studio-2022.3.1studio-2022.2.1-canary7studio-2022.2.1-canary2studio-2022.2.1-canary10studio-2022.2.1-beta5studio-2022.2.1-beta1studio-2022.2.1studio-2022.1.1-rc3studio-2022.1.1-canary2studio-2022.1.1-canarystudio-2022.1.1-beta4studio-2022.1.1-beta2studio-2022.1.1studio-2021.3.1-betastudio-2021.3.1studio-2021.2.1-patch2studio-2021.2.1-patch1studio-2021.2.1studio-mainstudio-canarystudio-betastudio-2022.1.1-canary
-rw-r--r-- | include/perfetto/tracing/internal/track_event_macros.h | 10 | ||||
-rw-r--r-- | include/perfetto/tracing/track_event_legacy.h | 4 |
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*>( \ |