Path: blob/main/contrib/llvm-project/llvm/lib/XRay/FDRRecords.cpp
35233 views
//===- FDRRecords.cpp - XRay Flight Data Recorder Mode Records -----------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// Define types and operations on these types that represent the different kinds9// of records we encounter in XRay flight data recorder mode traces.10//11//===----------------------------------------------------------------------===//12#include "llvm/XRay/FDRRecords.h"1314namespace llvm {15namespace xray {1617Error BufferExtents::apply(RecordVisitor &V) { return V.visit(*this); }18Error WallclockRecord::apply(RecordVisitor &V) { return V.visit(*this); }19Error NewCPUIDRecord::apply(RecordVisitor &V) { return V.visit(*this); }20Error TSCWrapRecord::apply(RecordVisitor &V) { return V.visit(*this); }21Error CustomEventRecord::apply(RecordVisitor &V) { return V.visit(*this); }22Error CallArgRecord::apply(RecordVisitor &V) { return V.visit(*this); }23Error PIDRecord::apply(RecordVisitor &V) { return V.visit(*this); }24Error NewBufferRecord::apply(RecordVisitor &V) { return V.visit(*this); }25Error EndBufferRecord::apply(RecordVisitor &V) { return V.visit(*this); }26Error FunctionRecord::apply(RecordVisitor &V) { return V.visit(*this); }27Error CustomEventRecordV5::apply(RecordVisitor &V) { return V.visit(*this); }28Error TypedEventRecord::apply(RecordVisitor &V) { return V.visit(*this); }2930StringRef Record::kindToString(RecordKind K) {31switch (K) {32case RecordKind::RK_Metadata:33return "Metadata";34case RecordKind::RK_Metadata_BufferExtents:35return "Metadata:BufferExtents";36case RecordKind::RK_Metadata_WallClockTime:37return "Metadata:WallClockTime";38case RecordKind::RK_Metadata_NewCPUId:39return "Metadata:NewCPUId";40case RecordKind::RK_Metadata_TSCWrap:41return "Metadata:TSCWrap";42case RecordKind::RK_Metadata_CustomEvent:43return "Metadata:CustomEvent";44case RecordKind::RK_Metadata_CustomEventV5:45return "Metadata:CustomEventV5";46case RecordKind::RK_Metadata_CallArg:47return "Metadata:CallArg";48case RecordKind::RK_Metadata_PIDEntry:49return "Metadata:PIDEntry";50case RecordKind::RK_Metadata_NewBuffer:51return "Metadata:NewBuffer";52case RecordKind::RK_Metadata_EndOfBuffer:53return "Metadata:EndOfBuffer";54case RecordKind::RK_Metadata_TypedEvent:55return "Metadata:TypedEvent";56case RecordKind::RK_Metadata_LastMetadata:57return "Metadata:LastMetadata";58case RecordKind::RK_Function:59return "Function";60}61return "Unknown";62}6364} // namespace xray65} // namespace llvm666768