// Copyright 2018 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifdef UNSAFE_BUFFERS_BUILD // TODO(crbug.com/40284755): Remove this and spanify to fix the errors. #pragma allow_unsafe_buffers #endif #ifndef BASE_TRACE_EVENT_BUILTIN_CATEGORIES_H_ #define BASE_TRACE_EVENT_BUILTIN_CATEGORIES_H_ #include <cstddef> #include <iterator> #include "base/base_export.h" #include "base/trace_event/common/trace_event_common.h" #include "base/tracing_buildflags.h" #include "build/build_config.h" // List of builtin category names. If you want to use a new category name in // your code and you get a static assert, this is the right place to register // the name. If the name is going to be used only for testing, please add it to // |kCategoriesForTesting| instead. // // Since spaces aren't allowed, use '_' to separate words in category names // (e.g., "content_capture"). // // Parameter |X| must be a *macro* that takes a single |name| string argument, // denoting a category name. #define INTERNAL_TRACE_LIST_BUILTIN_CATEGORIES(X) … #define INTERNAL_TRACE_LIST_BUILTIN_CATEGORY_GROUPS(X) … #define INTERNAL_TRACE_INIT_CATEGORY_NAME(name) … #define INTERNAL_TRACE_INIT_CATEGORY(name) … PERFETTO_DEFINE_TEST_CATEGORY_PREFIXES(…); #define INTERNAL_CATEGORY … #define INTERNAL_CATEGORY_GROUP … // Define a Perfetto TrackEvent data source using the list of categories defined // above. See https://perfetto.dev/docs/instrumentation/track-events. PERFETTO_DEFINE_CATEGORIES_IN_NAMESPACE_WITH_ATTRS(…); PERFETTO_USE_CATEGORIES_FROM_NAMESPACE(…); #undef INTERNAL_CATEGORY #undef INTERNAL_CATEGORY_GROUP namespace base { namespace trace_event { // Constexpr version of string comparison operator. |a| and |b| must be valid // C-style strings known at compile-time. constexpr bool StrEqConstexpr(const char* a, const char* b) { … } // Tests for |StrEqConstexpr()|. static_assert …; static_assert …; static_assert …; static_assert …; static_assert …; static_assert …; static_assert …; static_assert …; static_assert …; // Static-only class providing access to the compile-time registry of trace // categories. // TODO(skyostil): Remove after migrating to the Perfetto client API. class BASE_EXPORT BuiltinCategories { … }; } // namespace trace_event } // namespace base #endif // BASE_TRACE_EVENT_BUILTIN_CATEGORIES_H_