Go to the documentation of this file.
14 #ifndef LLVM_XRAY_INSTRUMENTATIONMAP_H
15 #define LLVM_XRAY_INSTRUMENTATIONMAP_H
22 #include <unordered_map>
30 class InstrumentationMap;
106 template <>
struct ScalarEnumerationTraits<xray::SledEntry::FunctionKinds> {
111 IO.enumCase(
Kind,
"log-args-enter",
113 IO.enumCase(
Kind,
"custom-event",
120 IO.mapRequired(
"id", Entry.FuncId);
121 IO.mapRequired(
"address", Entry.Address);
122 IO.mapRequired(
"function", Entry.Function);
123 IO.mapRequired(
"kind", Entry.Kind);
124 IO.mapRequired(
"always-instrument", Entry.AlwaysInstrument);
125 IO.mapOptional(
"function-name", Entry.FunctionName);
126 IO.mapOptional(
"version", Entry.Version, 0);
129 static constexpr
bool flow =
true;
138 #endif // LLVM_XRAY_INSTRUMENTATIONMAP_H
This is an optimization pass for GlobalISel generic memory operations.
Optional< uint64_t > getFunctionAddr(int32_t FuncId) const
Returns the function address for a function id.
The InstrumentationMap represents the computed function id's and indicated function addresses from an...
static void mapping(IO &IO, xray::YAMLXRaySledEntry &Entry)
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
friend Expected< InstrumentationMap > loadInstrumentationMap(StringRef)
Loads the instrumentation map from |Filename|.
FunctionKinds Kind
The kind of sled.
FunctionKinds
Each entry here represents the kinds of supported instrumentation map entries.
Tagged union holding either a T or a Error.
Optional< int32_t > getFunctionId(uint64_t Addr) const
Returns an XRay computed function id, provided a function address.
Expected< InstrumentationMap > loadInstrumentationMap(StringRef Filename)
Loads the instrumentation map from |Filename|.
uint64_t Address
The address of the sled.
bool AlwaysInstrument
Whether the sled was annotated to always be instrumented.
std::vector< SledEntry > SledContainer
static void enumeration(IO &IO, xray::SledEntry::FunctionKinds &Kind)
const SledContainer & sleds() const
Provide read-only access to the entries of the instrumentation map.
StringRef - Represent a constant reference to a string, i.e.
SledEntry::FunctionKinds Kind
Represents an XRay instrumentation sled entry from an object file.
uint64_t Function
The address of the function.
const FunctionAddressMap & getFunctionAddresses()
Provides a raw accessor to the unordered map of function addresses.
std::unordered_map< int32_t, uint64_t > FunctionAddressMap
std::unordered_map< uint64_t, int32_t > FunctionAddressReverseMap