![]() |
|
Execution stats profiling event logger. More...
#include <executionStats.h>
Classes | |
| struct | Event |
| Execution Stats event. More... | |
| struct | ScopedEvent |
| Scoped event that automatically logs when created and destroyed. More... | |
| struct | ScopedMallocEvent |
| Scoped event that automatically pushes and pops malloc tags for the given VdfNode. More... | |
Public Types | |
| enum | EventType : uint8_t { NodeEvaluateEvent = 0x0 , NodePrepareEvent = 0x1 , NodeRequiredInputsEvent = 0x2 , NodeInputsTaskEvent = 0x3 , NodeDidComputeEvent = 0x10 , ElementsCopiedEvent = 0x11 , ElementsProcessedEvent = 0x12 , RequestedOutputInSpeculationsEvent = 0x13 , MaxEvent = 0x3F } |
| 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. More... | |
| typedef uint64_t | EventData |
Public Member Functions | |
| VDF_API | VdfExecutionStats (const VdfNetwork *network) |
| Constructor for parent execution stats that have no invoking node. | |
| VDF_API | ~VdfExecutionStats () |
| Destructor. | |
| void | LogData (EventType event, const VdfNode &node, EventData data) |
| Log event API. | |
| void | LogTimestamp (EventType event, const VdfNode &node) |
| Log timestamp API. | |
| void | LogBeginTimestamp (EventType event, const VdfNode &node) |
| Logs timestamped begin event. | |
| void | LogEndTimestamp (EventType event, const VdfNode &node) |
| Logs timestamped end event. | |
| VDF_API VdfExecutionStats * | AddSubStat (const VdfNetwork *network, const VdfNode *invokingNode) |
| Push execution stats onto the hierarchy queue. | |
| const std::optional< VdfId > & | GetInvokingNodeId () const |
| Returns the invoking node, if any. | |
Static Public Member Functions | |
| static VDF_API std::string | GetMallocTagName (const VdfId *invokingNodeId, const VdfNode &node) |
| Returns a unique name for the given node. | |
| static EventType | GetBaseEvent (EventType event) |
| Returns the base event (e.g. | |
| static bool | IsEndEvent (EventType event) |
| Returns true if the event is an end event (e.g. | |
| static bool | IsBeginEvent (EventType event) |
| Returns true if the event is a begin event. | |
Protected Member Functions | |
| VDF_API | VdfExecutionStats (const VdfNetwork *network, VdfId nodeId) |
| Sub stat constructor. | |
| void | _Log (EventType event, VdfId nodeId, EventData data) |
| Logs data. | |
| void | _LogTime (EventType event, const VdfNode &node) |
| Logs timestamp. | |
| VDF_API VdfExecutionStats * | _AddSubStat (const VdfNetwork *network, VdfId invokingNodeId) |
| Adds sub stat. | |
| EventType | _TagBegin (EventType event) |
| Tags the begin flag. | |
| EventType | _TagEnd (EventType event) |
| Tags the end flag. | |
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 EventData |
Definition at line 72 of file executionStats.h.
| enum 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.
Definition at line 55 of file executionStats.h.
|
explicit |
Constructor for parent execution stats that have no invoking node.
| VDF_API ~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 * 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.
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.
|
friend |
Definition at line 243 of file executionStats.h.