|
HDK
|
#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 VdfExecutionStats * | AddSubStat (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 |
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.
| typedef uint64_t VdfExecutionStats::EventData |
Definition at line 72 of file executionStats.h.
| enum VdfExecutionStats::EventType : uint8_t |
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.
|
explicit |
Constructor for parent execution stats that have no invoking node.
| VDF_API VdfExecutionStats::~VdfExecutionStats | ( | ) |
Destructor
|
protected |
Sub stat constructor. Only called from _AddSubStat.
|
protected |
Adds sub stat.
Logs data.
Definition at line 211 of file executionStats.h.
Logs timestamp.
Definition at line 218 of file executionStats.h.
Tags the begin flag.
Definition at line 232 of file executionStats.h.
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.
Returns the base event (e.g. event type specified by the lower 6 bits).
Definition at line 186 of file executionStats.h.
|
inline |
Returns the invoking node, if any.
Definition at line 173 of file executionStats.h.
|
static |
Returns a unique name for the given node.
|
inlinestatic |
Returns true if the event is a begin event.
Definition at line 199 of file executionStats.h.
|
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.
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.
Log event API. Used to log a single event.
Definition at line 140 of file executionStats.h.
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.
Log timestamp API. Used to log a single timestamp.
Definition at line 146 of file executionStats.h.
|
friend |
Definition at line 243 of file executionStats.h.