LLVM 22.0.0git
llvm::InstrProfCorrelator Class Referenceabstract

InstrProfCorrelator - A base class used to create raw instrumentation data to their functions. More...

#include "llvm/ProfileData/InstrProfCorrelator.h"

Inheritance diagram for llvm::InstrProfCorrelator:
[legend]

Classes

struct  Context
struct  CorrelationData
struct  Probe

Public Types

enum  ProfCorrelatorKind { NONE , DEBUG_INFO , BINARY }
 Indicate if we should use the debug info or profile metadata sections to correlate. More...
enum  InstrProfCorrelatorKind { CK_32Bit , CK_64Bit }

Public Member Functions

virtual Error correlateProfileData (int MaxWarnings)=0
 Construct a ProfileData vector used to correlate raw instrumentation data to their functions.
virtual Error dumpYaml (int MaxWarnings, raw_ostream &OS)=0
 Process debug info and dump the correlation data.
LLVM_ABI std::optional< size_t > getDataSize () const
 Return the number of ProfileData elements.
const chargetNamesPointer () const
 Return a pointer to the names string that this class constructs.
size_t getNamesSize () const
 Return the number of bytes in the names string.
uint64_t getCountersSectionSize () const
 Return the size of the counters section in bytes.
InstrProfCorrelatorKind getKind () const
virtual ~InstrProfCorrelator ()=default

Static Public Member Functions

static LLVM_ABI llvm::Expected< std::unique_ptr< InstrProfCorrelator > > get (StringRef Filename, ProfCorrelatorKind FileKind, const object::BuildIDFetcher *BIDFetcher=nullptr, const ArrayRef< llvm::object::BuildID > BIs={})

Static Public Attributes

static LLVM_ABI const charFunctionNameAttributeName = "Function Name"
static LLVM_ABI const charCFGHashAttributeName = "CFG Hash"
static LLVM_ABI const charNumCountersAttributeName = "Num Counters"

Protected Member Functions

 InstrProfCorrelator (InstrProfCorrelatorKind K, std::unique_ptr< Context > Ctx)

Protected Attributes

const std::unique_ptr< ContextCtx
std::string Names
std::vector< std::string > NamesVec

Friends

struct yaml::MappingTraits< Probe >
struct yaml::SequenceElementTraits< Probe >
struct yaml::MappingTraits< CorrelationData >

Detailed Description

InstrProfCorrelator - A base class used to create raw instrumentation data to their functions.

Definition at line 35 of file InstrProfCorrelator.h.

Member Enumeration Documentation

◆ InstrProfCorrelatorKind

Enumerator
CK_32Bit 
CK_64Bit 

Definition at line 73 of file InstrProfCorrelator.h.

◆ ProfCorrelatorKind

Indicate if we should use the debug info or profile metadata sections to correlate.

Enumerator
NONE 
DEBUG_INFO 
BINARY 

Definition at line 39 of file InstrProfCorrelator.h.

Constructor & Destructor Documentation

◆ ~InstrProfCorrelator()

virtual llvm::InstrProfCorrelator::~InstrProfCorrelator ( )
virtualdefault

◆ InstrProfCorrelator()

llvm::InstrProfCorrelator::InstrProfCorrelator ( InstrProfCorrelatorKind K,
std::unique_ptr< Context > Ctx )
inlineprotected

Definition at line 97 of file InstrProfCorrelator.h.

References Ctx, and llvm::move().

Referenced by llvm::InstrProfCorrelatorImpl< IntPtrT >::classof().

Member Function Documentation

◆ correlateProfileData()

virtual Error llvm::InstrProfCorrelator::correlateProfileData ( int MaxWarnings)
pure virtual

Construct a ProfileData vector used to correlate raw instrumentation data to their functions.

Parameters
MaxWarningsthe maximum number of warnings to emit (0 = no limit)

Implemented in llvm::InstrProfCorrelatorImpl< IntPtrT >.

◆ dumpYaml()

virtual Error llvm::InstrProfCorrelator::dumpYaml ( int MaxWarnings,
raw_ostream & OS )
pure virtual

Process debug info and dump the correlation data.

Parameters
MaxWarningsthe maximum number of warnings to emit (0 = no limit)

Implemented in llvm::InstrProfCorrelatorImpl< IntPtrT >.

References LLVM_ABI.

◆ get()

◆ getCountersSectionSize()

uint64_t llvm::InstrProfCorrelator::getCountersSectionSize ( ) const
inline

Return the size of the counters section in bytes.

Definition at line 65 of file InstrProfCorrelator.h.

References Ctx.

◆ getDataSize()

std::optional< size_t > InstrProfCorrelator::getDataSize ( ) const

Return the number of ProfileData elements.

Definition at line 175 of file InstrProfCorrelator.cpp.

References llvm::CallingConv::C, and llvm::dyn_cast().

◆ getKind()

InstrProfCorrelatorKind llvm::InstrProfCorrelator::getKind ( ) const
inline

Definition at line 74 of file InstrProfCorrelator.h.

◆ getNamesPointer()

const char * llvm::InstrProfCorrelator::getNamesPointer ( ) const
inline

Return a pointer to the names string that this class constructs.

Definition at line 59 of file InstrProfCorrelator.h.

References Names.

◆ getNamesSize()

size_t llvm::InstrProfCorrelator::getNamesSize ( ) const
inline

Return the number of bytes in the names string.

Definition at line 62 of file InstrProfCorrelator.h.

References Names.

◆ yaml::MappingTraits< CorrelationData >

friend struct yaml::MappingTraits< CorrelationData >
friend

Definition at line 101 of file InstrProfCorrelator.h.

◆ yaml::MappingTraits< Probe >

friend struct yaml::MappingTraits< Probe >
friend

Definition at line 101 of file InstrProfCorrelator.h.

◆ yaml::SequenceElementTraits< Probe >

friend struct yaml::SequenceElementTraits< Probe >
friend

Definition at line 101 of file InstrProfCorrelator.h.

Member Data Documentation

◆ CFGHashAttributeName

const char * InstrProfCorrelator::CFGHashAttributeName = "CFG Hash"
static

Definition at line 70 of file InstrProfCorrelator.h.

◆ Ctx

◆ FunctionNameAttributeName

const char * InstrProfCorrelator::FunctionNameAttributeName = "Function Name"
static

Definition at line 69 of file InstrProfCorrelator.h.

◆ Names

std::string llvm::InstrProfCorrelator::Names
protected

◆ NamesVec

std::vector<std::string> llvm::InstrProfCorrelator::NamesVec
protected

◆ NumCountersAttributeName

const char * InstrProfCorrelator::NumCountersAttributeName = "Num Counters"
static

Definition at line 71 of file InstrProfCorrelator.h.


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