1#ifndef LLVM_PROFILEDATA_MEMPROFYAML_H_
2#define LLVM_PROFILEDATA_MEMPROFYAML_H_
28 std::vector<memprof::DataAccessProfRecord>
Records;
55 return "use a hexadecimal GUID or a function instead";
58 if (
Scalar.starts_with_insensitive(
"0x")) {
60 if (
Scalar.getAsInteger(0, Num))
61 return "invalid hex64 number";
89 static_assert(std::is_same_v<
decltype(
Function.value),
102 Io.
mapRequired(
"IsInlineFrame", Keys->IsInlineFrame);
107 const auto &[
Function, SymbolName, LineOffset, Column, IsInlineFrame] =
F;
110 static_assert(std::is_same_v<
remove_cvref_t<
decltype(SymbolName)>,
111 std::unique_ptr<std::string>>);
141#define MIBEntryDef(NameTag, Name, Type) \
142 if (KeyStr == #Name) { \
144 Io.mapRequired(KeyStr.str().c_str(), Value); \
145 MIB.Name = static_cast<Type>(Value); \
146 MIB.Schema.set(llvm::to_underlying(memprof::Meta::Name)); \
151 Io.
setError(
"Key is not a valid validation event");
156#define MIBEntryDef(NameTag, Name, Type) \
157 if (Schema.test(llvm::to_underlying(memprof::Meta::Name))) { \
158 uint64_t Value = MIB.Name; \
159 Io.mapRequired(#Name, Value); \
235 if (std::holds_alternative<std::string>(Rec.
SymHandle)) {
245 if (!SymName.empty()) {
270 if (!Io.
outputting() || !
Data.YamlifiedDataAccessProfiles.isEmpty())
271 Io.
mapOptional(
"DataAccessProfiles",
Data.YamlifiedDataAccessProfiles);
279 static memprof::GUIDHex64 &
281 if (Index >= Seq.
size())
for(const MachineOperand &MO :llvm::drop_begin(OldMI.operands(), Desc.getNumOperands()))
This file defines the SmallVector class.
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
Utility for declaring that a std::vector of a particular type should be considered a YAML sequence.
#define LLVM_YAML_STRONG_TYPEDEF(_base, _type)
YAML I/O does conversion based on types. But often native data types are just a typedef of built in i...
uint64_t GUID
Declare a type to represent a global unique identifier for a global value.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
This class implements an extremely fast bulk output stream that can only output to a stream.
void mapOptional(const char *Key, T &Val)
virtual bool outputting() const =0
void mapRequired(const char *Key, T &Val)
virtual void setError(const Twine &)=0
CallSiteInfoWithHex64Guids(IO &)
memprof::CallSiteInfo denormalize(IO &)
SmallVector< memprof::GUIDHex64 > CalleeGuids
decltype(memprof::CallSiteInfo::Frames) Frames
CallSiteInfoWithHex64Guids(IO &, const memprof::CallSiteInfo &CS)
decltype(memprof::Frame::LineOffset) LineOffset
decltype(memprof::Frame::IsInlineFrame) IsInlineFrame
memprof::GUIDHex64 Function
decltype(memprof::Frame::Column) Column
FrameWithHex64(IO &, const memprof::Frame &F)
memprof::Frame denormalize(IO &)
@ C
The default llvm calling convention, compatible with C.
LLVM_ABI GlobalValue::GUID getGUID(const StringRef FunctionName)
QuotingType
Describe which type of quotes should be used when quoting is necessary.
This is an optimization pass for GlobalISel generic memory operations.
bool all_of(R &&range, UnaryPredicate P)
Provide wrappers to std::all_of which take ranges instead of having to pass begin/end explicitly.
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
YamlDataAccessProfData YamlifiedDataAccessProfiles
std::vector< GUIDMemProfRecordPair > HeapProfileRecords
std::vector< Frame > CallStack
PortableMemInfoBlock Info
std::vector< Frame > Frames
SmallVector< GlobalValue::GUID, 1 > CalleeGuids
The data access profiles for a symbol.
SmallVector< SourceLocation > Locations
GlobalValue::GUID Function
llvm::SmallVector< CallSiteInfo > CallSites
llvm::SmallVector< AllocationInfo > AllocSites
std::bitset< llvm::to_underlying(Meta::Size)> getSchema() const
The location of data in the source code. Used by profile lookup API.
std::vector< memprof::DataAccessProfRecord > Records
std::vector< uint64_t > KnownColdStrHashes
std::vector< std::string > KnownColdSymbols
Serializable representation of CallSiteInfo.
static void inputOne(IO &Io, StringRef KeyStr, memprof::PortableMemInfoBlock &MIB)
static void output(IO &Io, memprof::PortableMemInfoBlock &MIB)
This class should be specialized by any type that needs to be converted to/from a YAML mapping in the...
static void mapping(IO &Io, memprof::AllMemProfData &Data)
static void mapping(IO &Io, memprof::AllocationInfo &AI)
static void mapping(IO &Io, memprof::CallSiteInfo &CS)
static void mapping(IO &Io, memprof::DataAccessProfRecord &Rec)
static void mapping(IO &Io, memprof::Frame &F)
static void mapping(IO &Io, memprof::GUIDMemProfRecordPair &Pair)
static void mapping(IO &Io, memprof::SourceLocation &Loc)
static void mapping(IO &Io, memprof::YamlDataAccessProfData &Data)
This class should be specialized by any type that needs to be converted to/from a YAML mapping.
static QuotingType mustQuote(StringRef)
static StringRef input(StringRef Scalar, void *, memprof::GUIDHex64 &Val)
static void output(const memprof::GUIDHex64 &Val, void *, raw_ostream &Out)
This class should be specialized by type that requires custom conversion to/from a yaml scalar.
static size_t size(IO &io, SmallVector< memprof::GUIDHex64 > &Seq)
static memprof::GUIDHex64 & element(IO &io, SmallVector< memprof::GUIDHex64 > &Seq, size_t Index)
This class should be specialized by any type that needs to be converted to/from a YAML sequence.