blob: ff315d35417d6c7fda5c0a5cccf86003180abdb2 [file] [log] [blame]
Dean Michael Berrisa6c63432018-08-30 07:22:21 +00001//===- FDRRecords.cpp - XRay Flight Data Recorder Mode Records -----------===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Dean Michael Berrisa6c63432018-08-30 07:22:21 +00006//
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
15namespace llvm {
16namespace xray {
17
18Error BufferExtents::apply(RecordVisitor &V) { return V.visit(*this); }
19Error WallclockRecord::apply(RecordVisitor &V) { return V.visit(*this); }
20Error NewCPUIDRecord::apply(RecordVisitor &V) { return V.visit(*this); }
21Error TSCWrapRecord::apply(RecordVisitor &V) { return V.visit(*this); }
22Error CustomEventRecord::apply(RecordVisitor &V) { return V.visit(*this); }
23Error CallArgRecord::apply(RecordVisitor &V) { return V.visit(*this); }
24Error PIDRecord::apply(RecordVisitor &V) { return V.visit(*this); }
25Error NewBufferRecord::apply(RecordVisitor &V) { return V.visit(*this); }
26Error EndBufferRecord::apply(RecordVisitor &V) { return V.visit(*this); }
27Error FunctionRecord::apply(RecordVisitor &V) { return V.visit(*this); }
Dean Michael Berris59439dd2018-11-07 04:37:42 +000028Error CustomEventRecordV5::apply(RecordVisitor &V) { return V.visit(*this); }
29Error TypedEventRecord::apply(RecordVisitor &V) { return V.visit(*this); }
Dean Michael Berrisa6c63432018-08-30 07:22:21 +000030
Dean Michael Berrisda375a62018-11-09 06:26:48 +000031StringRef Record::kindToString(RecordKind K) {
32 switch (K) {
33 case RecordKind::RK_Metadata:
34 return "Metadata";
35 case RecordKind::RK_Metadata_BufferExtents:
36 return "Metadata:BufferExtents";
37 case RecordKind::RK_Metadata_WallClockTime:
38 return "Metadata:WallClockTime";
39 case RecordKind::RK_Metadata_NewCPUId:
40 return "Metadata:NewCPUId";
41 case RecordKind::RK_Metadata_TSCWrap:
42 return "Metadata:TSCWrap";
43 case RecordKind::RK_Metadata_CustomEvent:
44 return "Metadata:CustomEvent";
45 case RecordKind::RK_Metadata_CustomEventV5:
46 return "Metadata:CustomEventV5";
47 case RecordKind::RK_Metadata_CallArg:
48 return "Metadata:CallArg";
49 case RecordKind::RK_Metadata_PIDEntry:
50 return "Metadata:PIDEntry";
51 case RecordKind::RK_Metadata_NewBuffer:
52 return "Metadata:NewBuffer";
53 case RecordKind::RK_Metadata_EndOfBuffer:
54 return "Metadata:EndOfBuffer";
55 case RecordKind::RK_Metadata_TypedEvent:
56 return "Metadata:TypedEvent";
57 case RecordKind::RK_Metadata_LastMetadata:
58 return "Metadata:LastMetadata";
59 case RecordKind::RK_Function:
60 return "Function";
61 }
62 return "Unknown";
63}
64
Dean Michael Berrisa6c63432018-08-30 07:22:21 +000065} // namespace xray
66} // namespace llvm