HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VdfExecutionStats Class Reference

#include <executionStats.h>

Classes

struct  Event
 
struct  ScopedEvent
 
struct  ScopedMallocEvent
 

Public Types

enum  EventType : uint8_t {
  NodeEvaluateEvent = 0x0, NodePrepareEvent = 0x1, NodeRequiredInputsEvent = 0x2, NodeInputsTaskEvent = 0x3,
  NodeDidComputeEvent = 0x10, ElementsCopiedEvent = 0x11, ElementsProcessedEvent = 0x12, RequestedOutputInSpeculationsEvent = 0x13,
  MaxEvent = 0x3F
}
 
typedef uint64_t EventData
 

Public Member Functions

VDF_API VdfExecutionStats (const VdfNetwork *network)
 
VDF_API ~VdfExecutionStats ()
 
void LogData (EventType event, const VdfNode &node, EventData data)
 
void LogTimestamp (EventType event, const VdfNode &node)
 
void LogBeginTimestamp (EventType event, const VdfNode &node)
 
void LogEndTimestamp (EventType event, const VdfNode &node)
 
VDF_API VdfExecutionStatsAddSubStat (const VdfNetwork *network, const VdfNode *invokingNode)
 
const std::optional< VdfId > & GetInvokingNodeId () const
 

Static Public Member Functions

static VDF_API std::string GetMallocTagName (const VdfId *invokingNodeId, const VdfNode &node)
 
static EventType GetBaseEvent (EventType event)
 
static bool IsEndEvent (EventType event)
 
static bool IsBeginEvent (EventType event)
 

Protected Member Functions

VDF_API VdfExecutionStats (const VdfNetwork *network, VdfId nodeId)
 
void _Log (EventType event, VdfId nodeId, EventData data)
 
void _LogTime (EventType event, const VdfNode &node)
 
VDF_API VdfExecutionStats_AddSubStat (const VdfNetwork *network, VdfId invokingNodeId)
 
EventType _TagBegin (EventType event)
 
EventType _TagEnd (EventType event)
 

Friends

class VdfExecutionStatsProcessor
 

Detailed Description

Execution stats profiling event logger.

Clients must use a VdfExecutionStatsProcessor to interact with the results logged in the stats object.

Definition at line 36 of file executionStats.h.

Member Typedef Documentation

typedef uint64_t VdfExecutionStats::EventData

Definition at line 72 of file executionStats.h.

Member Enumeration Documentation

The upper 2 bits are reserved as a flag for the event type: Highest bit : time event flag 2nd high bit : time end event flag

The lower 6 bits are the base type of the event. Scoped events are automatically tagged as begin and end events.

Enumerator
NodeEvaluateEvent 
NodePrepareEvent 
NodeRequiredInputsEvent 
NodeInputsTaskEvent 
NodeDidComputeEvent 
ElementsCopiedEvent 
ElementsProcessedEvent 
RequestedOutputInSpeculationsEvent 
MaxEvent 

Definition at line 55 of file executionStats.h.

Constructor & Destructor Documentation

VDF_API VdfExecutionStats::VdfExecutionStats ( const VdfNetwork network)
explicit

Constructor for parent execution stats that have no invoking node.

VDF_API VdfExecutionStats::~VdfExecutionStats ( )

Destructor

VDF_API VdfExecutionStats::VdfExecutionStats ( const VdfNetwork network,
VdfId  nodeId 
)
protected

Sub stat constructor. Only called from _AddSubStat.

Member Function Documentation

VDF_API VdfExecutionStats* VdfExecutionStats::_AddSubStat ( const VdfNetwork network,
VdfId  invokingNodeId 
)
protected

Adds sub stat.

void VdfExecutionStats::_Log ( EventType  event,
VdfId  nodeId,
EventData  data 
)
inlineprotected

Logs data.

Definition at line 211 of file executionStats.h.

void VdfExecutionStats::_LogTime ( EventType  event,
const VdfNode node 
)
inlineprotected

Logs timestamp.

Definition at line 218 of file executionStats.h.

EventType VdfExecutionStats::_TagBegin ( EventType  event)
inlineprotected

Tags the begin flag.

Definition at line 232 of file executionStats.h.

EventType VdfExecutionStats::_TagEnd ( EventType  event)
inlineprotected

Tags the end flag.

Definition at line 238 of file executionStats.h.

VDF_API VdfExecutionStats* VdfExecutionStats::AddSubStat ( const VdfNetwork network,
const VdfNode invokingNode 
)

Push execution stats onto the hierarchy queue.

static EventType VdfExecutionStats::GetBaseEvent ( EventType  event)
inlinestatic

Returns the base event (e.g. event type specified by the lower 6 bits).

Definition at line 186 of file executionStats.h.

const std::optional<VdfId>& VdfExecutionStats::GetInvokingNodeId ( ) const
inline

Returns the invoking node, if any.

Definition at line 173 of file executionStats.h.

static VDF_API std::string VdfExecutionStats::GetMallocTagName ( const VdfId invokingNodeId,
const VdfNode node 
)
static

Returns a unique name for the given node.

static bool VdfExecutionStats::IsBeginEvent ( EventType  event)
inlinestatic

Returns true if the event is a begin event.

Definition at line 199 of file executionStats.h.

static bool VdfExecutionStats::IsEndEvent ( EventType  event)
inlinestatic

Returns true if the event is an end event (e.g. if the second highest bit is set).

Definition at line 193 of file executionStats.h.

void VdfExecutionStats::LogBeginTimestamp ( EventType  event,
const VdfNode node 
)
inline

Logs timestamped begin event. Automatically flags the event. NOTE : To get automatic begin and end logging on scope, use ScopedEvent.

Definition at line 153 of file executionStats.h.

void VdfExecutionStats::LogData ( EventType  event,
const VdfNode node,
EventData  data 
)
inline

Log event API. Used to log a single event.

Definition at line 140 of file executionStats.h.

void VdfExecutionStats::LogEndTimestamp ( EventType  event,
const VdfNode node 
)
inline

Logs timestamped end event. Automatically flags the event. NOTE : To get automatic begina dn end logging on scope, use ScopedEvent.

Definition at line 160 of file executionStats.h.

void VdfExecutionStats::LogTimestamp ( EventType  event,
const VdfNode node 
)
inline

Log timestamp API. Used to log a single timestamp.

Definition at line 146 of file executionStats.h.

Friends And Related Function Documentation

Definition at line 243 of file executionStats.h.


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