LLVM
22.0.0git
include
llvm
XRay
FDRTraceExpander.h
Go to the documentation of this file.
1
//===- FDRTraceExpander.h - XRay FDR Mode Log Expander --------------------===//
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
// We define an FDR record visitor which can re-constitute XRayRecord instances
10
// from a sequence of FDR mode records in arrival order into a collection.
11
//
12
//===----------------------------------------------------------------------===//
13
#ifndef LLVM_XRAY_FDRTRACEEXPANDER_H
14
#define LLVM_XRAY_FDRTRACEEXPANDER_H
15
16
#include "
llvm/ADT/STLExtras.h
"
17
#include "
llvm/XRay/FDRRecords.h
"
18
#include "
llvm/XRay/XRayRecord.h
"
19
20
namespace
llvm::xray
{
21
22
class
TraceExpander
:
public
RecordVisitor
{
23
// Type-erased callback for handling individual XRayRecord instances.
24
function_ref
<void(
const
XRayRecord
&)> C;
25
int32_t PID = 0;
26
int32_t TID = 0;
27
uint64_t
BaseTSC = 0;
28
XRayRecord
CurrentRecord{0, 0,
RecordTypes::ENTER
, 0, 0, 0, 0, {}, {}};
29
uint16_t
CPUId = 0;
30
uint16_t
LogVersion = 0;
31
bool
BuildingRecord =
false
;
32
bool
IgnoringRecords =
false
;
33
34
void
resetCurrentRecord();
35
36
public
:
37
explicit
TraceExpander
(
function_ref
<
void
(
const
XRayRecord
&)>
F
,
uint16_t
L)
38
: C(
std
::
move
(
F
)), LogVersion(L) {}
39
40
Error
visit
(
BufferExtents
&)
override
;
41
Error
visit
(
WallclockRecord
&)
override
;
42
Error
visit
(
NewCPUIDRecord
&)
override
;
43
Error
visit
(
TSCWrapRecord
&)
override
;
44
Error
visit
(
CustomEventRecord
&)
override
;
45
Error
visit
(
CallArgRecord
&)
override
;
46
Error
visit
(
PIDRecord
&)
override
;
47
Error
visit
(
NewBufferRecord
&)
override
;
48
Error
visit
(
EndBufferRecord
&)
override
;
49
Error
visit
(
FunctionRecord
&)
override
;
50
Error
visit
(
CustomEventRecordV5
&)
override
;
51
Error
visit
(
TypedEventRecord
&)
override
;
52
53
// Must be called after all the records have been processed, to handle the
54
// most recent record generated.
55
Error
flush
();
56
};
57
58
}
// namespace llvm::xray
59
60
#endif
// LLVM_XRAY_FDRTRACEEXPANDER_H
FDRRecords.h
F
#define F(x, y, z)
Definition
MD5.cpp:55
STLExtras.h
This file contains some templates that are useful if you are working with the STL at all.
XRayRecord.h
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition
Error.h:159
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition
STLFunctionalExtras.h:37
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::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::TraceExpander::flush
Error flush()
Definition
FDRTraceExpander.cpp:125
llvm::xray::TraceExpander::visit
Error visit(BufferExtents &) override
Definition
FDRTraceExpander.cpp:21
llvm::xray::TraceExpander::TraceExpander
TraceExpander(function_ref< void(const XRayRecord &)> F, uint16_t L)
Definition
FDRTraceExpander.h:37
llvm::xray::TypedEventRecord
Definition
FDRRecords.h:262
llvm::xray::WallclockRecord
Definition
FDRRecords.h:133
uint16_t
uint64_t
llvm::xray
Definition
BlockIndexer.h:22
llvm::xray::RecordTypes::ENTER
@ ENTER
Definition
XRayRecord.h:57
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition
STLExtras.h:1867
std
Implement std::hash so that hash_code can be used in STL containers.
Definition
BitVector.h:867
llvm::xray::XRayRecord
An XRayRecord is the denormalized view of data associated in a trace.
Definition
XRayRecord.h:68
Generated on
for LLVM by
1.14.0