chromium/third_party/perfetto/src/trace_processor/importers/fuchsia/fuchsia_trace_tokenizer.cc

/*
 * 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.
 */

#include "src/trace_processor/importers/fuchsia/fuchsia_trace_tokenizer.h"

#include <cinttypes>
#include <limits>

#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/string_view.h"
#include "perfetto/trace_processor/trace_blob.h"
#include "src/trace_processor/importers/common/cpu_tracker.h"
#include "src/trace_processor/importers/common/process_tracker.h"
#include "src/trace_processor/importers/common/slice_tracker.h"
#include "src/trace_processor/importers/fuchsia/fuchsia_record.h"
#include "src/trace_processor/importers/fuchsia/fuchsia_trace_parser.h"
#include "src/trace_processor/importers/proto/proto_trace_reader.h"
#include "src/trace_processor/sorter/trace_sorter.h"
#include "src/trace_processor/types/task_state.h"
#include "src/trace_processor/types/trace_processor_context.h"

namespace perfetto {
namespace trace_processor {

namespace {

ArgValue;

// Record types
constexpr uint32_t kMetadata =;
constexpr uint32_t kInitialization =;
constexpr uint32_t kString =;
constexpr uint32_t kThread =;
constexpr uint32_t kEvent =;
constexpr uint32_t kBlob =;
constexpr uint32_t kKernelObject =;
constexpr uint32_t kSchedulerEvent =;

constexpr uint32_t kSchedulerEventLegacyContextSwitch =;
constexpr uint32_t kSchedulerEventContextSwitch =;
constexpr uint32_t kSchedulerEventThreadWakeup =;

// Metadata types
constexpr uint32_t kProviderInfo =;
constexpr uint32_t kProviderSection =;
constexpr uint32_t kProviderEvent =;

// Thread states
constexpr uint32_t kThreadNew =;
constexpr uint32_t kThreadRunning =;
constexpr uint32_t kThreadSuspended =;
constexpr uint32_t kThreadBlocked =;
constexpr uint32_t kThreadDying =;
constexpr uint32_t kThreadDead =;

// Zircon object types
constexpr uint32_t kZxObjTypeProcess =;
constexpr uint32_t kZxObjTypeThread =;

constexpr int32_t kIdleWeight =;

}  // namespace

FuchsiaTraceTokenizer::FuchsiaTraceTokenizer(TraceProcessorContext* context)
    :{}

FuchsiaTraceTokenizer::~FuchsiaTraceTokenizer() = default;

util::Status FuchsiaTraceTokenizer::Parse(TraceBlobView blob) {}

StringId FuchsiaTraceTokenizer::IdForOutgoingThreadState(uint32_t state) {}

void FuchsiaTraceTokenizer::SwitchFrom(Thread* thread,
                                       int64_t ts,
                                       uint32_t cpu,
                                       uint32_t thread_state) {}

void FuchsiaTraceTokenizer::SwitchTo(Thread* thread,
                                     int64_t ts,
                                     uint32_t cpu,
                                     int32_t weight) {}

void FuchsiaTraceTokenizer::Wake(Thread* thread, int64_t ts, uint32_t cpu) {}

// Most record types are read and recorded in |TraceStorage| here directly.
// Event records are sorted by timestamp before processing, so instead of
// recording them in |TraceStorage| they are given to |TraceSorter|. In order to
// facilitate the parsing after sorting, a small view of the provider's string
// and thread tables is passed alongside the record. See |FuchsiaProviderView|.
void FuchsiaTraceTokenizer::ParseRecord(TraceBlobView tbv) {}

void FuchsiaTraceTokenizer::RegisterProvider(uint32_t provider_id,
                                             std::string name) {}

base::Status FuchsiaTraceTokenizer::NotifyEndOfFile() {}

}  // namespace trace_processor
}  // namespace perfetto