LLVM
22.0.0git
include
llvm
XRay
FDRRecordProducer.h
Go to the documentation of this file.
1
//===- FDRRecordProducer.h - XRay FDR Mode Record Producer ----------------===//
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
#ifndef LLVM_XRAY_FDRRECORDPRODUCER_H
9
#define LLVM_XRAY_FDRRECORDPRODUCER_H
10
11
#include "
llvm/Support/Compiler.h
"
12
#include "
llvm/Support/Error.h
"
13
#include "
llvm/XRay/FDRRecords.h
"
14
#include "
llvm/XRay/XRayRecord.h
"
15
#include <memory>
16
17
namespace
llvm
{
18
namespace
xray
{
19
20
class
RecordProducer
{
21
public
:
22
/// All producer implementations must yield either an Error or a non-nullptr
23
/// unique_ptr<Record>.
24
virtual
Expected<std::unique_ptr<Record>
>
produce
() = 0;
25
virtual
~RecordProducer
() =
default
;
26
};
27
28
class
LLVM_ABI
FileBasedRecordProducer
:
public
RecordProducer
{
29
const
XRayFileHeader
&Header;
30
DataExtractor
&E;
31
uint64_t
&OffsetPtr;
32
uint32_t
CurrentBufferBytes = 0;
33
34
// Helper function which gets the next record by speculatively reading through
35
// the log, finding a buffer extents record.
36
Expected<std::unique_ptr<Record>
> findNextBufferExtent();
37
38
public
:
39
FileBasedRecordProducer
(
const
XRayFileHeader
&FH,
DataExtractor
&DE,
40
uint64_t
&
OP
)
41
: Header(FH), E(DE), OffsetPtr(
OP
) {}
42
43
/// This producer encapsulates the logic for loading a File-backed
44
/// RecordProducer hidden behind a DataExtractor.
45
Expected<std::unique_ptr<Record>
> produce()
override
;
46
};
47
48
}
// namespace xray
49
}
// namespace llvm
50
51
#endif
// LLVM_XRAY_FDRRECORDPRODUCER_H
Compiler.h
LLVM_ABI
#define LLVM_ABI
Definition
Compiler.h:213
FDRRecords.h
OP
#define OP(OPC)
Definition
Instruction.h:46
XRayRecord.h
llvm::DataExtractor
Definition
DataExtractor.h:42
llvm::Expected
Tagged union holding either a T or a Error.
Definition
Error.h:485
llvm::xray::FileBasedRecordProducer::FileBasedRecordProducer
FileBasedRecordProducer(const XRayFileHeader &FH, DataExtractor &DE, uint64_t &OP)
Definition
FDRRecordProducer.h:39
llvm::xray::RecordProducer
Definition
FDRRecordProducer.h:20
llvm::xray::RecordProducer::produce
virtual Expected< std::unique_ptr< Record > > produce()=0
All producer implementations must yield either an Error or a non-nullptr unique_ptr<Record>.
llvm::xray::RecordProducer::~RecordProducer
virtual ~RecordProducer()=default
uint32_t
uint64_t
Error.h
llvm::xray
Definition
BlockIndexer.h:23
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
llvm::xray::XRayFileHeader
XRay traces all have a header providing some top-matter information useful to help tools determine ho...
Definition
XRayRecord.h:27
Generated on
for LLVM by
1.14.0