TraceAggregateNode Class Reference

A representation of a call tree. More...

+ Inheritance diagram for TraceAggregateNode:

Public Types

using This = TraceAggregateNode
 
using ThisPtr = TraceAggregateNodePtr
 
using ThisRefPtr = TraceAggregateNodeRefPtr
 
using TimeStamp = TraceEvent::TimeStamp
 
- Public Types inherited from TfRefBase
typedef void(* UniqueChangedFuncPtr) (TfRefBase const *, bool)
 

Public Member Functions

TRACE_API TraceAggregateNodeRefPtr Append (Id id, const TfToken &key, TimeStamp ts, int c=1, int xc=1)
 
TRACE_API void Append (TraceAggregateNodeRefPtr child)
 
TfToken GetKey ()
 Returns the node's key. More...
 
const Id & GetId ()
 Returns the node's id. More...
 
TRACE_API void CalculateInclusiveCounterValues ()
 Recursively calculates the inclusive counter values from the inclusive and exclusive counts of child nodes. More...
 
void SetExpanded (bool expanded)
 Sets whether or not this node is expanded in a gui. More...
 
bool IsExpanded ()
 Returns whether this node is expanded in a gui. More...
 
TRACE_API void AdjustForOverheadAndNoise (TimeStamp scopeOverhead, TimeStamp timerQuantum, uint64_t *numDescendantNodes=nullptr)
 Subtract scopeOverhead cost times the number of descendant nodes from the inclusive time of each node. More...
 
Profile Data Accessors
TimeStamp GetInclusiveTime ()
 Returns the total time of this node ands its children. More...
 
TRACE_API TimeStamp GetExclusiveTime (bool recursive=false)
 Returns the time spent in this node but not its children. More...
 
int GetCount (bool recursive=false) const
 Returns the call count of this node. More...
 
int GetExclusiveCount () const
 Returns the exclusive count. More...
 
Counter Value Accessors
TRACE_API void AppendInclusiveCounterValue (int index, double value)
 
TRACE_API double GetInclusiveCounterValue (int index) const
 
TRACE_API void AppendExclusiveCounterValue (int index, double value)
 
TRACE_API double GetExclusiveCounterValue (int index) const
 
Children Accessors
const TraceAggregateNodePtrVector GetChildren ()
 
const TraceAggregateNodeRefPtrVector & GetChildrenRef ()
 
TRACE_API TraceAggregateNodeRefPtr GetChild (const TfToken &key)
 
TraceAggregateNodeRefPtr GetChild (const std::string &key)
 
Recursion
TRACE_API void MarkRecursiveChildren ()
 Scans the tree for recursive calls and updates the recursive counts. More...
 
bool IsRecursionMarker () const
 Returns true if this node is simply a marker for a merged recursive subtree; otherwise returns false. More...
 
bool IsRecursionHead () const
 Returns true if this node is the head of a recursive call tree (i.e. More...
 
- Public Member Functions inherited from TfRefBase
size_t GetCurrentCount () const
 Return the current reference count of this object. More...
 
bool IsUnique () const
 Return true if only one TfRefPtr points to this object. More...
 
const TfRefCountGetRefCount () const
 
void SetShouldInvokeUniqueChangedListener (bool shouldCall)
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 

Static Public Member Functions

static ThisRefPtr New ()
 
static ThisRefPtr New (const Id &id, const TfToken &key, const TimeStamp ts, const int count=1, const int exclusiveCount=1)
 
- Static Public Member Functions inherited from TfRefBase
static TF_API void SetUniqueChangedListener (UniqueChangedListener listener)
 

Additional Inherited Members

- Protected Member Functions inherited from TfWeakBase
TfRefPtr< Tf_Remnant > _Register () const
 
template<class T >
TfRefPtr< Tf_Remnant > _Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Detailed Description

A representation of a call tree.

Each node represents one or more calls that occurred in the trace. Multiple calls to a child node are aggregated into one node.

Definition at line 57 of file aggregateNode.h.

Member Function Documentation

◆ AdjustForOverheadAndNoise()

TRACE_API void AdjustForOverheadAndNoise ( TimeStamp  scopeOverhead,
TimeStamp  timerQuantum,
uint64_t *  numDescendantNodes = nullptr 
)

Subtract scopeOverhead cost times the number of descendant nodes from the inclusive time of each node.

If numDescendantNodes is not null, add the number of nodes descendant to this node (not including this node) to *numDescendantNodes. Also for any nodes with descendants that are "noisy" wrt timerQuantum, do not subtract their times from the parent's exclusive time, but instead set their times to zero. This way we retain the sample count, but do not pollute the parent node's exclusive time with noise.

◆ CalculateInclusiveCounterValues()

TRACE_API void CalculateInclusiveCounterValues ( )

Recursively calculates the inclusive counter values from the inclusive and exclusive counts of child nodes.

◆ GetCount()

int GetCount ( bool  recursive = false) const
inline

Returns the call count of this node.

recursive determines if recursive calls are counted.

Definition at line 113 of file aggregateNode.h.

◆ GetExclusiveCount()

int GetExclusiveCount ( ) const
inline

Returns the exclusive count.

Definition at line 118 of file aggregateNode.h.

◆ GetExclusiveTime()

TRACE_API TimeStamp GetExclusiveTime ( bool  recursive = false)

Returns the time spent in this node but not its children.

◆ GetId()

const Id& GetId ( )
inline

Returns the node's id.

Definition at line 100 of file aggregateNode.h.

◆ GetInclusiveTime()

TimeStamp GetInclusiveTime ( )
inline

Returns the total time of this node ands its children.

Definition at line 106 of file aggregateNode.h.

◆ GetKey()

TfToken GetKey ( )
inline

Returns the node's key.

Definition at line 97 of file aggregateNode.h.

◆ IsExpanded()

bool IsExpanded ( )
inline

Returns whether this node is expanded in a gui.

Definition at line 166 of file aggregateNode.h.

◆ IsRecursionHead()

bool IsRecursionHead ( ) const
inline

Returns true if this node is the head of a recursive call tree (i.e.

the function has been called recursively).

This value is meaningless until this node or any of its ancestors have been marked with MarkRecursiveChildren().

Definition at line 204 of file aggregateNode.h.

◆ IsRecursionMarker()

bool IsRecursionMarker ( ) const
inline

Returns true if this node is simply a marker for a merged recursive subtree; otherwise returns false.

This value is meaningless until this node or any of its ancestors have been marked with MarkRecursiveChildren().

Definition at line 197 of file aggregateNode.h.

◆ MarkRecursiveChildren()

TRACE_API void MarkRecursiveChildren ( )

Scans the tree for recursive calls and updates the recursive counts.

This call leaves the tree topology intact, and only updates the recursion-related data in the node. Prior to this call, recursion data is invalid in the node.

◆ SetExpanded()

void SetExpanded ( bool  expanded)
inline

Sets whether or not this node is expanded in a gui.

Definition at line 161 of file aggregateNode.h.


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