/* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef SRC_TRACE_PROCESSOR_STORAGE_STATS_H_ #define SRC_TRACE_PROCESSOR_STORAGE_STATS_H_ #include <cstddef> namespace perfetto::trace_processor::stats { // Compile time list of parsing and processing stats. // clang-format off #define PERFETTO_TP_STATS(F) … // clang-format on enum Type { … }; enum Severity { … }; enum Source { … }; // Ignore GCC warning about a missing argument for a variadic macro parameter. #if defined(__GNUC__) || defined(__clang__) #pragma GCC system_header #endif // Declares an enum of literals (one for each stat). The enum values of each // literal corresponds to the string index in the arrays below. #define PERFETTO_TP_STATS_ENUM(name, ...) … enum KeyIDs : size_t { … }; // The code below declares an array for each property (name, type, ...). #define PERFETTO_TP_STATS_NAME(name, ...) … constexpr char const* kNames[] = …; #define PERFETTO_TP_STATS_TYPE(_, type, ...) … constexpr Type kTypes[] = …; #define PERFETTO_TP_STATS_SEVERITY(_, __, severity, ...) … constexpr Severity kSeverities[] = …; #define PERFETTO_TP_STATS_SOURCE(_, __, ___, source, ...) … constexpr Source kSources[] = …; #define PERFETTO_TP_STATS_DESCRIPTION(_, __, ___, ____, descr, ...) … constexpr char const* kDescriptions[] = …; } // namespace perfetto::trace_processor::stats #endif // SRC_TRACE_PROCESSOR_STORAGE_STATS_H_