llvm/llvm/include/llvm/ExecutionEngine/Orc/Shared/PerfSharedStructs.h

//===--- PerfSharedStructs.h --- RPC Structs for perf support ---*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Structs and serialization to share perf-related information
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_EXECUTIONENGINE_ORC_SHARED_PERFSHAREDSTRUCTS_H
#define LLVM_EXECUTIONENGINE_ORC_SHARED_PERFSHAREDSTRUCTS_H

#include "llvm/ExecutionEngine/Orc/Shared/SimplePackedSerialization.h"

namespace llvm {

namespace orc {

// The following are POD struct definitions from the perf jit specification

enum class PerfJITRecordType {};

struct PerfJITRecordPrefix {};
struct PerfJITCodeLoadRecord {};

struct PerfJITDebugEntry {};

struct PerfJITDebugInfoRecord {};

struct PerfJITCodeUnwindingInfoRecord {};

// Batch vehicle for minimizing RPC calls for perf jit records
struct PerfJITRecordBatch {};

// SPS traits for Records

namespace shared {

SPSPerfJITRecordPrefix;

template <>
class SPSSerializationTraits<SPSPerfJITRecordPrefix, PerfJITRecordPrefix> {};

SPSPerfJITCodeLoadRecord;

template <>
class SPSSerializationTraits<SPSPerfJITCodeLoadRecord, PerfJITCodeLoadRecord> {};

SPSPerfJITDebugEntry;

template <>
class SPSSerializationTraits<SPSPerfJITDebugEntry, PerfJITDebugEntry> {};

SPSPerfJITDebugInfoRecord;

template <>
class SPSSerializationTraits<SPSPerfJITDebugInfoRecord,
                             PerfJITDebugInfoRecord> {};

SPSPerfJITCodeUnwindingInfoRecord;
template <>
class SPSSerializationTraits<SPSPerfJITCodeUnwindingInfoRecord,
                             PerfJITCodeUnwindingInfoRecord> {};

SPSPerfJITRecordBatch;
template <>
class SPSSerializationTraits<SPSPerfJITRecordBatch, PerfJITRecordBatch> {};

} // namespace shared

} // namespace orc

} // namespace llvm

#endif