LLVM
22.0.0git
include
llvm
XRay
FDRTraceWriter.h
Go to the documentation of this file.
1
//===- FDRTraceWriter.h - XRay FDR Trace Writer -----------------*- C++ -*-===//
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
// Test a utility that can write out XRay FDR Mode formatted trace files.
10
//
11
//===----------------------------------------------------------------------===//
12
#ifndef LLVM_XRAY_FDRTRACEWRITER_H
13
#define LLVM_XRAY_FDRTRACEWRITER_H
14
15
#include "
llvm/Support/Compiler.h
"
16
#include "
llvm/Support/EndianStream.h
"
17
#include "
llvm/Support/raw_ostream.h
"
18
#include "
llvm/XRay/FDRRecords.h
"
19
#include "
llvm/XRay/XRayRecord.h
"
20
21
namespace
llvm::xray
{
22
23
/// The FDRTraceWriter allows us to hand-craft an XRay Flight Data Recorder
24
/// (FDR) mode log file. This is used primarily for testing, generating
25
/// sequences of FDR records that can be read/processed. It can also be used to
26
/// generate various kinds of execution traces without using the XRay runtime.
27
/// Note that this writer does not do any validation, but uses the types of
28
/// records defined in the FDRRecords.h file.
29
class
LLVM_ABI
FDRTraceWriter
:
public
RecordVisitor
{
30
public
:
31
// Construct an FDRTraceWriter associated with an output stream.
32
explicit
FDRTraceWriter
(
raw_ostream
&O,
const
XRayFileHeader
&
H
);
33
~FDRTraceWriter
()
override
;
34
35
Error
visit
(
BufferExtents
&)
override
;
36
Error
visit
(
WallclockRecord
&)
override
;
37
Error
visit
(
NewCPUIDRecord
&)
override
;
38
Error
visit
(
TSCWrapRecord
&)
override
;
39
Error
visit
(
CustomEventRecord
&)
override
;
40
Error
visit
(
CallArgRecord
&)
override
;
41
Error
visit
(
PIDRecord
&)
override
;
42
Error
visit
(
NewBufferRecord
&)
override
;
43
Error
visit
(
EndBufferRecord
&)
override
;
44
Error
visit
(
FunctionRecord
&)
override
;
45
Error
visit
(
CustomEventRecordV5
&)
override
;
46
Error
visit
(
TypedEventRecord
&)
override
;
47
48
private
:
49
support::endian::Writer
OS;
50
};
51
52
}
// namespace llvm::xray
53
54
#endif
// LLVM_XRAY_FDRTRACEWRITER_H
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
EndianStream.h
FDRRecords.h
H
#define H(x, y, z)
Definition
MD5.cpp:57
visit
void visit(MachineFunction &MF, MachineBasicBlock &Start, std::function< void(MachineBasicBlock *)> op)
Definition
SPIRVPostLegalizer.cpp:125
XRayRecord.h
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition
Error.h:159
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition
raw_ostream.h:53
llvm::xray::BufferExtents
Definition
FDRRecords.h:110
llvm::xray::CallArgRecord
Definition
FDRRecords.h:291
llvm::xray::CustomEventRecordV5
Definition
FDRRecords.h:235
llvm::xray::CustomEventRecord
Definition
FDRRecords.h:206
llvm::xray::EndBufferRecord
Definition
FDRRecords.h:359
llvm::xray::FDRTraceWriter::FDRTraceWriter
FDRTraceWriter(raw_ostream &O, const XRayFileHeader &H)
Definition
FDRTraceWriter.cpp:58
llvm::xray::FDRTraceWriter::~FDRTraceWriter
~FDRTraceWriter() override
llvm::xray::FunctionRecord
Definition
FDRRecords.h:372
llvm::xray::NewBufferRecord
Definition
FDRRecords.h:336
llvm::xray::NewCPUIDRecord
Definition
FDRRecords.h:158
llvm::xray::PIDRecord
Definition
FDRRecords.h:313
llvm::xray::RecordVisitor
Definition
FDRRecords.h:399
llvm::xray::TSCWrapRecord
Definition
FDRRecords.h:184
llvm::xray::TypedEventRecord
Definition
FDRRecords.h:262
llvm::xray::WallclockRecord
Definition
FDRRecords.h:133
llvm::xray
Definition
BlockIndexer.h:22
raw_ostream.h
llvm::support::endian::Writer
Adapter to write values to a stream in a particular byte order.
Definition
EndianStream.h:67
llvm::xray::XRayFileHeader
XRay traces all have a header providing some top-matter information useful to help tools determine ho...
Definition
XRayRecord.h:26
Generated on
for LLVM by
1.14.0