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

The InstrumentationMap represents the computed function id's and indicated function addresses from an object file (or a YAML file). More...

#include "llvm/XRay/InstrumentationMap.h"

Public Types

using FunctionAddressMap = std::unordered_map< int32_t, uint64_t >
 
using FunctionAddressReverseMap = std::unordered_map< uint64_t, int32_t >
 
using SledContainer = std::vector< SledEntry >
 

Public Member Functions

const FunctionAddressMapgetFunctionAddresses ()
 Provides a raw accessor to the unordered map of function addresses.
 
std::optional< int32_t > getFunctionId (uint64_t Addr) const
 Returns an XRay computed function id, provided a function address.
 
std::optional< uint64_tgetFunctionAddr (int32_t FuncId) const
 Returns the function address for a function id.
 
const SledContainersleds () const
 Provide read-only access to the entries of the instrumentation map.
 

Friends

Expected< InstrumentationMaploadInstrumentationMap (StringRef)
 Loads the instrumentation map from |Filename|.
 

Detailed Description

The InstrumentationMap represents the computed function id's and indicated function addresses from an object file (or a YAML file).

This provides an interface to just the mapping between the function id, and the function address.

We also provide raw access to the actual instrumentation map entries we find associated with a particular object file.

Definition at line 75 of file InstrumentationMap.h.

Member Typedef Documentation

◆ FunctionAddressMap

using llvm::xray::InstrumentationMap::FunctionAddressMap = std::unordered_map<int32_t, uint64_t>

Definition at line 77 of file InstrumentationMap.h.

◆ FunctionAddressReverseMap

Definition at line 78 of file InstrumentationMap.h.

◆ SledContainer

Definition at line 79 of file InstrumentationMap.h.

Member Function Documentation

◆ getFunctionAddr()

std::optional< uint64_t > InstrumentationMap::getFunctionAddr ( int32_t  FuncId) const

Returns the function address for a function id.

Definition at line 44 of file InstrumentationMap.cpp.

References FuncId, and I.

◆ getFunctionAddresses()

const FunctionAddressMap & llvm::xray::InstrumentationMap::getFunctionAddresses ( )
inline

Provides a raw accessor to the unordered map of function addresses.

Definition at line 90 of file InstrumentationMap.h.

◆ getFunctionId()

std::optional< int32_t > InstrumentationMap::getFunctionId ( uint64_t  Addr) const

Returns an XRay computed function id, provided a function address.

Definition at line 36 of file InstrumentationMap.cpp.

References Addr, and I.

◆ sleds()

const SledContainer & llvm::xray::InstrumentationMap::sleds ( ) const
inline

Provide read-only access to the entries of the instrumentation map.

Definition at line 99 of file InstrumentationMap.h.

Friends And Related Function Documentation

◆ loadInstrumentationMap

Expected< InstrumentationMap > loadInstrumentationMap ( StringRef  )
friend

Loads the instrumentation map from |Filename|.

This auto-deduces the type of the instrumentation map.


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