![]() |
PEARL
Parallel Event Access and Replay Library
|
Representation of a calling context definition. More...
#include <pearl/CallingContext.h>
Public Types | |
typedef uint32_t | IdType |
Calling context definition identifier type. More... | |
Public Member Functions | |
Constructors & destructor | |
CallingContext (IdType id, const Region ®ion, const SourceLocation &scl, CallingContext *parent) | |
Constructor. More... | |
Access definition data | |
IdType | getId () const |
Get global identifier. More... | |
const Region & | getRegion () const |
Get current region. More... | |
const SourceLocation & | getSourceLocation () const |
Get source-code location. More... | |
CallingContext * | getParent () const |
Get parent context. More... | |
uint32_t | numChildren () const |
Get number of child contexts. More... | |
const CallingContext & | getChild (uint32_t index) const |
Get child context. More... | |
Static Public Attributes | |
static const IdType | NO_ID = (~static_cast<IdType>(0)) |
Numerical identifier used for undefined calling context definitions. More... | |
static const CallingContext | UNDEFINED |
Static instance of class CallingContext representing undefined calling context entries. More... | |
Related Functions | |
(Note that these are not member functions.) | |
Stream I/O functions | |
std::ostream & | operator<< (std::ostream &stream, const CallingContext &item) |
Stream output operator. More... | |
Comparison operators | |
bool | operator== (const CallingContext &lhs, const CallingContext &rhs) |
Equality operator. More... | |
bool | operator!= (const CallingContext &lhs, const CallingContext &rhs) |
Inequality operator. More... | |
Instances of the CallingContext class provide information about a node in the calling context tree. A calling context describes the sequence of call sites leading to a particular source-code location where a thread was interrupted by a CallingContextSample, CallingContextEnter, or CallingContextLeave event. Calling contexts are characterized by the associated source-code region, a specific source-code location, and a parent calling context. The numerical identifiers of the individual calling contexts are globally defined and continuously enumerated, i.e., the ID is element of [0,#callingContexts-1].
typedef uint32_t pearl::CallingContext::IdType |
pearl::CallingContext::CallingContext | ( | IdType | id, |
const Region & | region, | ||
const SourceLocation & | scl, | ||
CallingContext * | parent | ||
) |
Creates a new calling context definition instance and initializes it with the given values.
id | Global calling context identifier |
region | Associated region (Region::UNDEFINED if unknown) |
scl | Source-code location (SourceLocation::UNDEFINED if unknown) |
parent | Parent calling context (nullptr for root nodes) |
const CallingContext& pearl::CallingContext::getChild | ( | uint32_t | index | ) | const |
Returns the child calling context definition stored at the given index in the range of [0,#children-1].
index | Child index |
IdType pearl::CallingContext::getId | ( | ) | const |
Returns the global identifier of the calling context definition.
CallingContext* pearl::CallingContext::getParent | ( | ) | const |
Returns a pointer to the parent calling context.
nullptr
otherwise const Region& pearl::CallingContext::getRegion | ( | ) | const |
Returns the region definition associated to the calling context.
const SourceLocation& pearl::CallingContext::getSourceLocation | ( | ) | const |
Returns the source-code location definition associated to the calling context.
uint32_t pearl::CallingContext::numChildren | ( | ) | const |
Returns the number of calling contexts which were spawned from the current context during the application's execution.
|
related |
Compares two calling context definition objects lhs and rhs for inequality. Two calling context definitions are considered unequal if either their identifiers, associated regions, source-code locations, or their parent differ. Child contexts are not compared, i.e., this operator performs a "shallow" comparison.
lhs | Left-hand operand |
rhs | Right-hand operand |
|
related |
Prints the contents of the given calling context definition object item to an output stream in a human-readable form.
stream | Output stream |
item | Calling context definition object |
|
related |
Compares two calling context definition objects lhs and rhs for equality. Two calling context definitions are considered equal if their identifiers, associated regions and source-code locations, as well as their parents are identical. The child contexts are not compared, i.e., this operator performs a "shallow" comparison.
lhs | Left-hand operand |
rhs | Right-hand operand |
|
static |
![]() |
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 |