chromium/third_party/perfetto/src/trace_processor/importers/perf/record_parser.cc

/*
 * Copyright (C) 2023 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/perf/record_parser.h"

#include <cinttypes>
#include <cstdint>
#include <optional>
#include <string>
#include <utility>
#include <vector>

#include "perfetto/base/logging.h"
#include "perfetto/base/status.h"
#include "perfetto/ext/base/string_view.h"
#include "perfetto/public/compiler.h"
#include "perfetto/trace_processor/ref_counted.h"
#include "src/trace_processor/importers/common/address_range.h"
#include "src/trace_processor/importers/common/create_mapping_params.h"
#include "src/trace_processor/importers/common/mapping_tracker.h"
#include "src/trace_processor/importers/common/process_tracker.h"
#include "src/trace_processor/importers/common/stack_profile_tracker.h"
#include "src/trace_processor/importers/common/virtual_memory_mapping.h"
#include "src/trace_processor/importers/perf/mmap_record.h"
#include "src/trace_processor/importers/perf/perf_counter.h"
#include "src/trace_processor/importers/perf/perf_event.h"
#include "src/trace_processor/importers/perf/perf_event_attr.h"
#include "src/trace_processor/importers/perf/reader.h"
#include "src/trace_processor/importers/perf/record.h"
#include "src/trace_processor/importers/perf/sample.h"
#include "src/trace_processor/importers/proto/perf_sample_tracker.h"
#include "src/trace_processor/importers/proto/profile_packet_utils.h"
#include "src/trace_processor/storage/stats.h"
#include "src/trace_processor/storage/trace_storage.h"
#include "src/trace_processor/tables/metadata_tables_py.h"
#include "src/trace_processor/tables/profiler_tables_py.h"
#include "src/trace_processor/util/build_id.h"
#include "src/trace_processor/util/status_macros.h"

#include "protos/perfetto/trace/profiling/profile_packet.pbzero.h"

namespace perfetto::trace_processor::perf_importer {
namespace {

CreateMappingParams BuildCreateMappingParams(
    const CommonMmapRecordFields& fields,
    std::string filename,
    std::optional<BuildId> build_id) {}

bool IsInKernel(protos::pbzero::Profiling::CpuMode cpu_mode) {}

}  // namespace

FramesTable;
CallsitesTable;

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

RecordParser::~RecordParser() = default;

void RecordParser::ParsePerfRecord(int64_t ts, Record record) {}

base::Status RecordParser::ParseRecord(int64_t ts, Record record) {}

base::Status RecordParser::ParseSample(int64_t ts, Record record) {}

base::Status RecordParser::InternSample(Sample sample) {}

std::optional<CallsiteId> RecordParser::InternCallchain(
    UniquePid upid,
    const std::vector<Sample::Frame>& callchain,
    bool adjust_pc) {}

base::Status RecordParser::ParseComm(Record record) {}

base::Status RecordParser::ParseMmap(Record record) {}

base::Status RecordParser::ParseMmap2(Record record) {}

UniquePid RecordParser::GetUpid(const CommonMmapRecordFields& fields) const {}

base::Status RecordParser::UpdateCounters(const Sample& sample) {}

base::Status RecordParser::UpdateCountersInReadGroups(const Sample& sample) {}

DummyMemoryMapping* RecordParser::GetDummyMapping(UniquePid upid) {}

}  // namespace perfetto::trace_processor::perf_importer