LLVM 22.0.0git
llvm::xray Namespace Reference

Classes

class  BlockIndexer
class  BlockPrinter
class  BlockVerifier
class  BufferExtents
class  CallArgRecord
class  CustomEventRecord
class  CustomEventRecordV5
class  EndBufferRecord
class  FDRTraceWriter
 The FDRTraceWriter allows us to hand-craft an XRay Flight Data Recorder (FDR) mode log file. More...
class  FileBasedRecordProducer
class  FunctionRecord
class  Graph
 A Graph object represents a Directed Graph and is used in XRay to compute and store function call graphs and associated statistical information. More...
class  InstrumentationMap
 The InstrumentationMap represents the computed function id's and indicated function addresses from an object file (or a YAML file). More...
class  LogBuilder
 The LogBuilder class allows for creating ad-hoc collections of records through the add<...>(...) function. More...
class  LogBuilderConsumer
class  MetadataRecord
class  NewBufferRecord
class  NewCPUIDRecord
class  PIDRecord
class  PipelineConsumer
class  Profile
 Profile instances are thread-compatible. More...
class  Record
class  RecordConsumer
class  RecordInitializer
class  RecordPrinter
class  RecordProducer
class  RecordVisitor
struct  SledEntry
 Represents an XRay instrumentation sled entry from an object file. More...
class  Trace
 A Trace object represents the records that have been loaded from XRay log files generated by instrumented binaries. More...
class  TraceExpander
class  TSCWrapRecord
class  TypedEventRecord
class  WallclockRecord
struct  XRayFileHeader
 XRay traces all have a header providing some top-matter information useful to help tools determine how to interpret the information available in the trace. More...
struct  XRayRecord
 An XRayRecord is the denormalized view of data associated in a trace. More...
struct  YAMLXRayFileHeader
struct  YAMLXRayRecord
struct  YAMLXRaySledEntry
struct  YAMLXRayTrace

Enumerations

enum class  RecordTypes {
  ENTER , EXIT , TAIL_EXIT , ENTER_ARG ,
  CUSTOM_EVENT , TYPED_EVENT
}
 Determines the supported types of records that could be seen in XRay traces. More...

Functions

LLVM_ABI Expected< XRayFileHeaderreadBinaryFormatHeader (DataExtractor &HeaderExtractor, uint64_t &OffsetPtr)
 Convenience function for loading the file header given a data extractor at a specified offset.
LLVM_ABI Expected< InstrumentationMaploadInstrumentationMap (StringRef Filename)
 Loads the instrumentation map from |Filename|.
LLVM_ABI Expected< ProfileloadProfile (StringRef Filename)
 This function will attempt to load an XRay Profiling Mode profile from the provided |Filename|.
LLVM_ABI Profile mergeProfilesByThread (const Profile &L, const Profile &R)
 This algorithm will merge two Profile instances into a single Profile instance, aggregating blocks by Thread ID.
LLVM_ABI Profile mergeProfilesByStack (const Profile &L, const Profile &R)
 This algorithm will merge two Profile instances into a single Profile instance, aggregating blocks by function call stack.
LLVM_ABI Expected< ProfileprofileFromTrace (const Trace &T)
 This function takes a Trace and creates a Profile instance from it.
LLVM_ABI Expected< TraceloadTraceFile (StringRef Filename, bool Sort=false)
 This function will attempt to load XRay trace records from the provided |Filename|.
LLVM_ABI Expected< TraceloadTrace (const DataExtractor &Extractor, bool Sort=false)
 This function will attempt to load XRay trace records from the provided DataExtractor.

Enumeration Type Documentation

◆ RecordTypes

enum class llvm::xray::RecordTypes
strong

Determines the supported types of records that could be seen in XRay traces.

This may or may not correspond to actual record types in the raw trace (as the loader implementation may synthesize this information in the process of of loading).

Enumerator
ENTER 
EXIT 
TAIL_EXIT 
ENTER_ARG 
CUSTOM_EVENT 
TYPED_EVENT 

Definition at line 57 of file XRayRecord.h.

Function Documentation

◆ loadInstrumentationMap()

Expected< InstrumentationMap > llvm::xray::loadInstrumentationMap ( StringRef Filename)

Loads the instrumentation map from |Filename|.

This auto-deduces the type of the instrumentation map.

Definition at line 255 of file InstrumentationMap.cpp.

References llvm::consumeError(), llvm::object::ObjectFile::createObjectFile(), llvm::sys::fs::file_size(), loadObj(), loadYAML(), llvm::sys::fs::openNativeFileForRead(), and llvm::Expected< T >::takeError().

◆ loadProfile()

Expected< Profile > llvm::xray::loadProfile ( StringRef Filename)

This function will attempt to load an XRay Profiling Mode profile from the provided |Filename|.

For any errors encountered in the loading of the profile data from |Filename|, this function will return an Error condition appropriately.

Definition at line 261 of file Profile.cpp.

References llvm::sys::fs::closeFile(), llvm::Data, llvm::sys::fs::mapped_file_region::data(), E(), llvm::sys::fs::file_size(), llvm::make_error(), llvm::Offset, llvm::sys::fs::openNativeFileForRead(), P, llvm::sys::fs::mapped_file_region::readonly, llvm::sys::fs::mapped_file_region::size(), and llvm::Expected< T >::takeError().

◆ loadTrace()

Expected< Trace > llvm::xray::loadTrace ( const DataExtractor & Extractor,
bool Sort = false )

This function will attempt to load XRay trace records from the provided DataExtractor.

Definition at line 420 of file Trace.cpp.

References llvm::DataExtractor::getData(), llvm::DataExtractor::getU16(), llvm::DataExtractor::isLittleEndian(), llvm::make_error(), llvm::stable_sort(), T, and llvm::Version.

Referenced by loadTraceFile().

◆ loadTraceFile()

◆ mergeProfilesByStack()

Profile llvm::xray::mergeProfilesByStack ( const Profile & L,
const Profile & R )

This algorithm will merge two Profile instances into a single Profile instance, aggregating blocks by function call stack.

Definition at line 231 of file Profile.cpp.

References llvm::xray::Profile::addBlock(), llvm::Block, llvm::cantFail(), llvm::copy(), llvm::Data, llvm::xray::Profile::internPath(), P, and llvm::xray::Profile::Block::PathData.

◆ mergeProfilesByThread()

Profile llvm::xray::mergeProfilesByThread ( const Profile & L,
const Profile & R )

This algorithm will merge two Profile instances into a single Profile instance, aggregating blocks by Thread ID.

Definition at line 192 of file Profile.cpp.

References llvm::xray::Profile::addBlock(), llvm::Block, llvm::cantFail(), llvm::copy(), llvm::Data, llvm::xray::Profile::internPath(), P, and llvm::xray::Profile::Block::PathData.

◆ profileFromTrace()

Expected< Profile > llvm::xray::profileFromTrace ( const Trace & T)

This function takes a Trace and creates a Profile instance from it.

Definition at line 325 of file Profile.cpp.

References llvm::AbsoluteDifference(), CUSTOM_EVENT, E(), ENTER, ENTER_ARG, EXIT, P, profileFromTrace(), llvm::reverse(), T, TAIL_EXIT, llvm::transform(), and TYPED_EVENT.

Referenced by profileFromTrace().

◆ readBinaryFormatHeader()