LLVM 22.0.0git
llvm::xray::Profile Class Reference

Profile instances are thread-compatible. More...

#include "llvm/XRay/Profile.h"

Classes

struct  Block
struct  Data

Public Types

using ThreadID = uint64_t
using PathID = unsigned
using FuncID = int32_t
using const_iterator = BlockList::const_iterator

Public Member Functions

LLVM_ABI Expected< std::vector< FuncID > > expandPath (PathID P) const
 Provides a sequence of function IDs from a previously interned PathID.
LLVM_ABI PathID internPath (ArrayRef< FuncID > P)
 The stack represented in |P| must be in stack order (leaf to root).
LLVM_ABI Error addBlock (Block &&B)
 Appends a fully-formed Block instance into the Profile.
 Profile ()=default
 ~Profile ()=default
 Profile (Profile &&O) noexcept
Profileoperator= (Profile &&O) noexcept
LLVM_ABI Profile (const Profile &)
LLVM_ABI Profileoperator= (const Profile &)
const_iterator begin () const
const_iterator end () const
bool empty () const

Friends

void swap (Profile &L, Profile &R)

Detailed Description

Profile instances are thread-compatible.

Definition at line 52 of file Profile.h.

Member Typedef Documentation

◆ const_iterator

using llvm::xray::Profile::const_iterator = BlockList::const_iterator

Definition at line 141 of file Profile.h.

◆ FuncID

using llvm::xray::Profile::FuncID = int32_t

Definition at line 56 of file Profile.h.

◆ PathID

Definition at line 55 of file Profile.h.

◆ ThreadID

Definition at line 54 of file Profile.h.

Constructor & Destructor Documentation

◆ Profile() [1/3]

llvm::xray::Profile::Profile ( )
default

◆ ~Profile()

llvm::xray::Profile::~Profile ( )
default

◆ Profile() [2/3]

llvm::xray::Profile::Profile ( Profile && O)
inlinenoexcept

Definition at line 89 of file Profile.h.

References Profile().

◆ Profile() [3/3]

llvm::xray::Profile::Profile ( const Profile & O)

Member Function Documentation

◆ addBlock()

Error llvm::xray::Profile::addBlock ( Block && B)

Appends a fully-formed Block instance into the Profile.

Returns an error condition in the following cases:

  • The PathData component of the Block is empty

Definition at line 120 of file Profile.cpp.

References B(), llvm::make_error(), and llvm::Error::success().

Referenced by llvm::xray::mergeProfilesByStack(), and llvm::xray::mergeProfilesByThread().

◆ begin()

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

Definition at line 142 of file Profile.h.

◆ empty()

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

Definition at line 144 of file Profile.h.

◆ end()

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

Definition at line 143 of file Profile.h.

◆ expandPath()

Expected< std::vector< Profile::FuncID > > llvm::xray::Profile::expandPath ( PathID P) const

Provides a sequence of function IDs from a previously interned PathID.

Returns an error if |P| had not been interned before into the Profile.

Definition at line 130 of file Profile.cpp.

References llvm::make_error(), and P.

◆ internPath()

Profile::PathID llvm::xray::Profile::internPath ( ArrayRef< FuncID > P)

The stack represented in |P| must be in stack order (leaf to root).

This will always return the same PathID for |P| that has the same sequence.

Definition at line 142 of file Profile.cpp.

References assert(), llvm::find_if(), N, P, and llvm::reverse().

Referenced by llvm::xray::mergeProfilesByStack(), llvm::xray::mergeProfilesByThread(), and Profile().

◆ operator=() [1/2]

Profile & llvm::xray::Profile::operator= ( const Profile & O)

Definition at line 36 of file Profile.cpp.

References P, and Profile().

◆ operator=() [2/2]

Profile & llvm::xray::Profile::operator= ( Profile && O)
inlinenoexcept

Definition at line 94 of file Profile.h.

References Profile().

◆ swap

void swap ( Profile & L,
Profile & R )
friend

Definition at line 106 of file Profile.h.

References Profile(), swap, and std::swap().

Referenced by swap.


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