LLVM: include/llvm/XRay/InstrumentationMap.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef LLVM_XRAY_INSTRUMENTATIONMAP_H
15#define LLVM_XRAY_INSTRUMENTATIONMAP_H
16
21#include
22#include
23#include <unordered_map>
24#include
25
27
28
30
31
32
33LLVM_ABI Expected
35
36
38
39
41
42
44
45
47
48
50
51
53
55};
56
66
67
68
69
70
71
72
73
74
76public:
80
81private:
85
88
89public:
90
92
93
95
96
98
99
101};
102
103}
104
105namespace llvm {
106template <>
118
129
130 static constexpr bool flow = true;
131};
132}
133
135
136#endif
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
Utility for declaring that a std::vector of a particular type should be considered a YAML sequence.
Tagged union holding either a T or a Error.
StringRef - Represent a constant reference to a string, i.e.
The InstrumentationMap represents the computed function id's and indicated function addresses from an...
Definition InstrumentationMap.h:75
std::unordered_map< int32_t, uint64_t > FunctionAddressMap
Definition InstrumentationMap.h:77
std::unordered_map< uint64_t, int32_t > FunctionAddressReverseMap
Definition InstrumentationMap.h:78
LLVM_ABI friend Expected< InstrumentationMap > loadInstrumentationMap(StringRef)
Loads the instrumentation map from |Filename|.
const SledContainer & sleds() const
Provide read-only access to the entries of the instrumentation map.
Definition InstrumentationMap.h:100
std::vector< SledEntry > SledContainer
Definition InstrumentationMap.h:79
LLVM_ABI std::optional< int32_t > getFunctionId(uint64_t Addr) const
Returns an XRay computed function id, provided a function address.
const FunctionAddressMap & getFunctionAddresses()
Provides a raw accessor to the unordered map of function addresses.
Definition InstrumentationMap.h:91
LLVM_ABI std::optional< uint64_t > getFunctionAddr(int32_t FuncId) const
Returns the function address for a function id.
void enumCase(T &Val, StringRef Str, const T ConstVal)
void mapOptional(StringRef Key, T &Val)
void mapRequired(StringRef Key, T &Val)
LLVM_ABI Expected< InstrumentationMap > loadInstrumentationMap(StringRef Filename)
Loads the instrumentation map from |Filename|.
This is an optimization pass for GlobalISel generic memory operations.
Represents an XRay instrumentation sled entry from an object file.
Definition InstrumentationMap.h:37
uint64_t Address
The address of the sled.
Definition InstrumentationMap.h:43
uint64_t Function
The address of the function.
Definition InstrumentationMap.h:46
FunctionKinds
Each entry here represents the kinds of supported instrumentation map entries.
Definition InstrumentationMap.h:40
@ TAIL
Definition InstrumentationMap.h:40
@ LOG_ARGS_ENTER
Definition InstrumentationMap.h:40
@ ENTRY
Definition InstrumentationMap.h:40
@ CUSTOM_EVENT
Definition InstrumentationMap.h:40
@ EXIT
Definition InstrumentationMap.h:40
unsigned char Version
Definition InstrumentationMap.h:54
bool AlwaysInstrument
Whether the sled was annotated to always be instrumented.
Definition InstrumentationMap.h:52
FunctionKinds Kind
The kind of sled.
Definition InstrumentationMap.h:49
Definition InstrumentationMap.h:57
bool AlwaysInstrument
Definition InstrumentationMap.h:62
SledEntry::FunctionKinds Kind
Definition InstrumentationMap.h:61
std::string FunctionName
Definition InstrumentationMap.h:63
int32_t FuncId
Definition InstrumentationMap.h:58
yaml::Hex64 Address
Definition InstrumentationMap.h:59
yaml::Hex64 Function
Definition InstrumentationMap.h:60
unsigned char Version
Definition InstrumentationMap.h:64
static void mapping(IO &IO, xray::YAMLXRaySledEntry &Entry)
Definition InstrumentationMap.h:120
static constexpr bool flow
Definition InstrumentationMap.h:130
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
static void enumeration(IO &IO, xray::SledEntry::FunctionKinds &Kind)
Definition InstrumentationMap.h:108
This class should be specialized by any integral type that converts to/from a YAML scalar where there...