LLVM  14.0.0git
FDRRecords.cpp
Go to the documentation of this file.
1 //===- FDRRecords.cpp - XRay Flight Data Recorder Mode Records -----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // Define types and operations on these types that represent the different kinds
10 // of records we encounter in XRay flight data recorder mode traces.
11 //
12 //===----------------------------------------------------------------------===//
13 #include "llvm/XRay/FDRRecords.h"
14 
15 namespace llvm {
16 namespace xray {
17 
24 Error PIDRecord::apply(RecordVisitor &V) { return V.visit(*this); }
30 
32  switch (K) {
34  return "Metadata";
36  return "Metadata:BufferExtents";
38  return "Metadata:WallClockTime";
40  return "Metadata:NewCPUId";
42  return "Metadata:TSCWrap";
44  return "Metadata:CustomEvent";
46  return "Metadata:CustomEventV5";
48  return "Metadata:CallArg";
50  return "Metadata:PIDEntry";
52  return "Metadata:NewBuffer";
54  return "Metadata:EndOfBuffer";
56  return "Metadata:TypedEvent";
58  return "Metadata:LastMetadata";
60  return "Function";
61  }
62  return "Unknown";
63 }
64 
65 } // namespace xray
66 } // namespace llvm
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
llvm::xray::Record::RecordKind
RecordKind
Definition: FDRRecords.h:33
llvm::xray::RecordVisitor
Definition: FDRRecords.h:399
llvm::xray::Record::RecordKind::RK_Metadata_NewBuffer
@ RK_Metadata_NewBuffer
llvm::xray::Record::RecordKind::RK_Metadata
@ RK_Metadata
llvm::xray::Record::RecordKind::RK_Metadata_LastMetadata
@ RK_Metadata_LastMetadata
llvm::xray::TSCWrapRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:21
llvm::xray::Record::RecordKind::RK_Metadata_CustomEvent
@ RK_Metadata_CustomEvent
llvm::xray::Record::RecordKind::RK_Metadata_TypedEvent
@ RK_Metadata_TypedEvent
llvm::xray::CustomEventRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:22
llvm::xray::WallclockRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:19
llvm::xray::NewBufferRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:25
llvm::xray::Record::RecordKind::RK_Metadata_WallClockTime
@ RK_Metadata_WallClockTime
llvm::xray::Record::RecordKind::RK_Metadata_BufferExtents
@ RK_Metadata_BufferExtents
llvm::xray::Record::RecordKind::RK_Function
@ RK_Function
llvm::xray::Record::RecordKind::RK_Metadata_EndOfBuffer
@ RK_Metadata_EndOfBuffer
llvm::xray::PIDRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:24
llvm::xray::RecordVisitor::visit
virtual Error visit(BufferExtents &)=0
llvm::xray::CallArgRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:23
llvm::xray::Record::RecordKind::RK_Metadata_PIDEntry
@ RK_Metadata_PIDEntry
llvm::xray::NewCPUIDRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:20
llvm::xray::Record::kindToString
static StringRef kindToString(RecordKind K)
Definition: FDRRecords.cpp:31
llvm::xray::TypedEventRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:29
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::xray::Record::RecordKind::RK_Metadata_NewCPUId
@ RK_Metadata_NewCPUId
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
llvm::xray::Record::RecordKind::RK_Metadata_TSCWrap
@ RK_Metadata_TSCWrap
llvm::xray::BufferExtents::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:18
llvm::xray::Record::RecordKind::RK_Metadata_CustomEventV5
@ RK_Metadata_CustomEventV5
llvm::xray::CustomEventRecordV5::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:28
llvm::xray::FunctionRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:27
llvm::xray::Record::RecordKind::RK_Metadata_CallArg
@ RK_Metadata_CallArg
FDRRecords.h
llvm::xray::EndBufferRecord::apply
Error apply(RecordVisitor &V) override
Definition: FDRRecords.cpp:26