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