PEARL
Parallel Event Access and Replay Library
Public Types | Static Public Attributes | Friends | List of all members
pearl::Callpath Class Reference

Representation of a callpath definition. More...

#include <pearl/Callpath.h>

Public Types

typedef uint32_t IdType
 Callpath definition identifier type. More...
 

Public Member Functions

Constructors & destructor
 Callpath (IdType id, const Region &region, const Callsite &callsite, Callpath *parent)
 Constructor. More...
 
Access definition data
IdType getId () const
 Get global identifier. More...
 
const RegiongetRegion () const
 Get associated region. More...
 
const CallsitegetCallsite () const
 Get associated callsite. More...
 
CallpathgetParent () const
 Get parent callpath. More...
 
uint32_t numChildren () const
 Get number of child callpaths. More...
 
const CallpathgetChild (uint32_t index) const
 Get child callpath. More...
 

Static Public Attributes

static const IdType NO_ID = (~static_cast<IdType>(0))
 Numerical identifier used for undefined callpath definitions. More...
 
static const Callpath UNDEFINED
 Static instance of class Callpath representing undefined callpath entries in other definitions. More...
 

Friends

class detail::CallTree
 

Related Functions

(Note that these are not member functions.)

Stream I/O functions
std::ostream & operator<< (std::ostream &stream, const Callpath &item)
 Stream output operator. More...
 
Comparison operators
bool operator== (const Callpath &lhs, const Callpath &rhs)
 Equality operator. More...
 
bool operator!= (const Callpath &lhs, const Callpath &rhs)
 Inequality operator. More...
 

Detailed Description

Instances of the Callpath class provide information about individual callpaths of the application execution. Callpaths are characterized by the associated source-code region, the parent callpath, and optionally a callsite. The numerical identifiers of the individual callpaths are globally defined and continuously enumerated, i.e., the ID is element of [0,#callpaths-1].

Member Typedef Documentation

◆ IdType

typedef uint32_t pearl::Callpath::IdType

Constructor & Destructor Documentation

◆ Callpath()

pearl::Callpath::Callpath ( IdType  id,
const Region region,
const Callsite callsite,
Callpath parent 
)

Creates a new callpath definition instance and initializes it with the given values.

Parameters
idGlobal callpath identifier
regionAssociated source-code region
callsiteAssociated callsite (if applicable, Callsite::UNDEFINED otherwise)
parentParent callpath (NULL for root nodes)

Member Function Documentation

◆ getCallsite()

const Callsite& pearl::Callpath::getCallsite ( ) const

Returns the callsite definition object related to the callsite triggering the execution of the associated region. If this information is not available, Callsite::UNDEFINED is returned.

Returns
Callsite

◆ getChild()

const Callpath& pearl::Callpath::getChild ( uint32_t  index) const

Returns the child callpath definition stored at the given index in the range of [0,#children-1].

Parameters
indexChild index
Returns
Child callpath

◆ getId()

IdType pearl::Callpath::getId ( ) const

Returns the global identifier of the callpath definition.

Returns
Global identifier

◆ getParent()

Callpath* pearl::Callpath::getParent ( ) const

Returns a pointer to the parent callpath if applicable and NULL otherwise (i.e., for call tree root nodes).

Returns
Parent callpath

◆ getRegion()

const Region& pearl::Callpath::getRegion ( ) const

Returns the region definition object related to the source-code region executed in this callpath.

Returns
Executed region

◆ numChildren()

uint32_t pearl::Callpath::numChildren ( ) const

Returns the number of callpaths which were called from the current callpath during the application's execution.

Returns
Number of child callpaths

Friends And Related Function Documentation

◆ detail::CallTree

friend class detail::CallTree
friend

◆ operator!=()

bool operator!= ( const Callpath lhs,
const Callpath rhs 
)
related

Compares two callpath definition objects lhs and rhs for inequality. Two callpath definitions are considered unequal if either their IDs, their associated regions, callsites, or their parents differ. Child callpaths are not compared, i.e., this operator performs a "shallow" comparison.

Parameters
lhsLeft-hand operand
rhsRight-hand operand
Returns
True if the callpath definitions differ, false otherwise.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  stream,
const Callpath item 
)
related

Prints the contents of the given callpath definition object item to an output stream in a human-readable form.

Parameters
streamOutput stream
itemCallpath definition object
Returns
Output stream

◆ operator==()

bool operator== ( const Callpath lhs,
const Callpath rhs 
)
related

Compares two callpath definition objects lhs and rhs for equality. Two callpath definitions are considered equal if their identifiers, associated regions and callsites, as well as their parents are identical. The child callpaths are not compared, i.e., this operator performs a "shallow" comparison.

Parameters
lhsLeft-hand operand
rhsRight-hand operand
Returns
True if the callpath definitions are equal, false otherwise.

Member Data Documentation

◆ NO_ID

const IdType pearl::Callpath::NO_ID = (~static_cast<IdType>(0))
static

◆ UNDEFINED

const Callpath pearl::Callpath::UNDEFINED
static

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

Scalasca    Copyright © 1998–2019 Forschungszentrum Jülich GmbH, Jülich Supercomputing Centre
Copyright © 2009–2015 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming