14#ifndef LLVM_TELEMETRY_TELEMETRY_H
15#define LLVM_TELEMETRY_TELEMETRY_H
49 template <
typename T,
typename =
typename T::mapped_type>
51 static_assert(std::is_convertible_v<typename T::key_type, StringRef>,
52 "KeyType must be convertible to string");
54 for (
const auto &KeyVal : Map)
55 write(KeyVal.first, KeyVal.second);
81 virtual std::optional<std::string>
makeSessionId() {
return std::nullopt; }
119 virtual void serialize(
Serializer &serializer)
const;
124 return T->getKind() == EntryKind::Base;
160 void addDestination(std::unique_ptr<Destination>
Destination);
168 std::vector<std::unique_ptr<Destination>> Destinations;
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This file defines the DenseMap class.
Lightweight error class with error context and mandatory checking.
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
This class presents a data sink to which the Telemetry framework sends data.
virtual Error receiveEntry(const TelemetryInfo *Entry)=0
virtual StringLiteral name() const =0
virtual ~Destination()=default
This class is the main interaction point between any LLVM tool and this framework.
Manager & operator=(Manager const &)=delete
virtual ~Manager()=default
Manager(Manager const &)=delete
virtual void write(StringRef KeyName, unsigned long Value)=0
virtual ~Serializer()=default
virtual void write(StringRef KeyName, unsigned int Value)=0
virtual void write(StringRef KeyName, bool Value)=0
virtual void write(StringRef KeyName, long long Value)=0
virtual Error finalize()=0
virtual void write(StringRef KeyName, int Value)=0
virtual void write(StringRef KeyName, long Value)=0
virtual void beginObject(StringRef KeyName)=0
virtual void write(StringRef KeyName, StringRef Value)=0
virtual void write(StringRef KeyName, unsigned long long Value)=0
void write(StringRef KeyName, const T &Map)
virtual void endObject()=0
unsigned KindType
For isa, dyn_cast, etc operations on TelemetryInfo.
This is an optimization pass for GlobalISel generic memory operations.
Configuration for the Manager class.
static constexpr bool BuildTimeEnableTelemetry
const bool EnableTelemetry
virtual ~Config()=default
virtual std::optional< std::string > makeSessionId()
This struct is used by TelemetryInfo to support isa<>, dyn_cast<> operations.
static const KindType Base
TelemetryInfo is the data courier, used to move instrumented data from the tool being monitored to th...
virtual KindType getKind() const
static bool classof(const TelemetryInfo *T)
virtual ~TelemetryInfo()=default