LLVM 20.0.0git
Public Types | Public Member Functions | Friends | List of all members
llvm::xray::Trace Class Reference

A Trace object represents the records that have been loaded from XRay log files generated by instrumented binaries. More...

#include "llvm/XRay/Trace.h"

Public Types

using size_type = RecordVector::size_type
 
using value_type = RecordVector::value_type
 
using const_iterator = RecordVector::const_iterator
 

Public Member Functions

const XRayFileHeadergetFileHeader () const
 Provides access to the loaded XRay trace file header.
 
const_iterator begin () const
 
const_iterator end () const
 
bool empty () const
 
size_type size () const
 

Friends

Expected< TraceloadTrace (const DataExtractor &, bool)
 This function will attempt to load XRay trace records from the provided DataExtractor.
 

Detailed Description

A Trace object represents the records that have been loaded from XRay log files generated by instrumented binaries.

We encapsulate the logic of reading the traces in factory functions that populate the Trace object appropriately.

Trace objects provide an accessor to an XRayFileHeader which says more about details of the file from which the XRay trace was loaded from.

Usage:

if (auto TraceOrErr = loadTraceFile("xray-log.something.xray")) { auto& T = *TraceOrErr; // T.getFileHeader() will provide information from the trace header. for (const XRayRecord &R : T) { // ... do something with R here. } } else { // Handle the error here. }

Definition at line 46 of file Trace.h.

Member Typedef Documentation

◆ const_iterator

using llvm::xray::Trace::const_iterator = RecordVector::const_iterator

Definition at line 58 of file Trace.h.

◆ size_type

using llvm::xray::Trace::size_type = RecordVector::size_type

Definition at line 56 of file Trace.h.

◆ value_type

using llvm::xray::Trace::value_type = RecordVector::value_type

Definition at line 57 of file Trace.h.

Member Function Documentation

◆ begin()

const_iterator llvm::xray::Trace::begin ( ) const
inline

Definition at line 63 of file Trace.h.

◆ empty()

bool llvm::xray::Trace::empty ( ) const
inline

Definition at line 65 of file Trace.h.

◆ end()

const_iterator llvm::xray::Trace::end ( ) const
inline

Definition at line 64 of file Trace.h.

◆ getFileHeader()

const XRayFileHeader & llvm::xray::Trace::getFileHeader ( ) const
inline

Provides access to the loaded XRay trace file header.

Definition at line 61 of file Trace.h.

◆ size()

size_type llvm::xray::Trace::size ( ) const
inline

Definition at line 66 of file Trace.h.

Friends And Related Function Documentation

◆ loadTrace

Expected< Trace > loadTrace ( const DataExtractor ,
bool   
)
friend

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


The documentation for this class was generated from the following file: