chromium/third_party/perfetto/src/trace_processor/util/trace_type.cc

/*
 * Copyright (C) 2024 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.
 */

#include "src/trace_processor/util/trace_type.h"

#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <string>

#include "perfetto/base/logging.h"
#include "perfetto/ext/base/string_utils.h"
#include "perfetto/ext/base/string_view.h"
#include "src/trace_processor/importers/android_bugreport/android_log_event.h"

#include "protos/perfetto/trace/trace.pbzero.h"
#include "protos/perfetto/trace/trace_packet.pbzero.h"

namespace perfetto::trace_processor {
namespace {
// Fuchsia traces have a magic number as documented here:
// https://fuchsia.googlesource.com/fuchsia/+/HEAD/docs/development/tracing/trace-format/README.md#magic-number-record-trace-info-type-0
constexpr char kFuchsiaMagic[] =;
constexpr char kPerfMagic[] =;

constexpr char kZipMagic[] =;

constexpr char kGzipMagic[] =;

constexpr uint8_t kTracePacketTag =;
constexpr uint16_t kModuleSymbolsTag =;

inline bool isspace(unsigned char c) {}

std::string RemoveWhitespace(std::string str) {}

template <size_t N>
bool MatchesMagic(const uint8_t* data, size_t size, const char (&magic)[N]) {}

bool IsProtoTraceWithSymbols(const uint8_t* ptr, size_t size) {}

}  // namespace

const char* TraceTypeToString(TraceType trace_type) {}

TraceType GuessTraceType(const uint8_t* data, size_t size) {}

}  // namespace perfetto::trace_processor