chromium/third_party/perfetto/src/trace_processor/storage/metadata.h

/*
 * 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_METADATA_H_
#define SRC_TRACE_PROCESSOR_STORAGE_METADATA_H_

#include <stddef.h>

#include "src/trace_processor/types/variadic.h"

namespace perfetto {
namespace trace_processor {
namespace metadata {

// Compile time list of metadata items.
// clang-format off
#define PERFETTO_TP_METADATA(F)
// clang-format on

// Compile time list of metadata items.
// clang-format off
#define PERFETTO_TP_METADATA_KEY_TYPES(F)
// clang-format

// Ignore GCC warning about a missing argument for a variadic macro parameter.
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC system_header
#endif

#define PERFETTO_TP_META_TYPE_ENUM(varname, ...)
enum class KeyType : size_t {};

#define PERFETTO_TP_META_TYPE_NAME(_, name, ...)
constexpr char const* kKeyTypeNames[] =;

// Declares an enum of literals (one for each item). The enum values of each
// literal corresponds to the string index in the arrays below.
#define PERFETTO_TP_META_ENUM(name, ...)
enum KeyId : size_t {};

// The code below declares an array for each property:
// name, key type, value type.

#define PERFETTO_TP_META_NAME(name, ...)
constexpr char const* kNames[] =;

#define PERFETTO_TP_META_KEYTYPE(_, type, ...)
constexpr KeyType kKeyTypes[] =;

#define PERFETTO_TP_META_VALUETYPE(_, __, type, ...)
constexpr Variadic::Type kValueTypes[] =;

}  // namespace metadata
}  // namespace trace_processor
}  // namespace perfetto

#endif  // SRC_TRACE_PROCESSOR_STORAGE_METADATA_H_