7 #ifndef PXR_EXEC_VDF_EXECUTION_STATS_H
8 #define PXR_EXEC_VDF_EXECUTION_STATS_H
20 #include <tbb/concurrent_queue.h>
21 #include <tbb/enumerable_thread_specific.h>
40 constexpr
static uint8_t _StartFlag = 0x80;
44 constexpr
static uint8_t _EndFlag = 0xC0;
86 nodeId(nodeId), data(data), event(event) {}
125 std::string _tagName;
174 return _invokingNodeId;
181 const VdfId *invokingNodeId,
194 return 0x40 &
static_cast<uint8_t
>(
event);
213 _events.local().events.push_back(
Event(event, nodeId, data));
228 VdfId invokingNodeId);
251 std::optional<VdfId> _invokingNodeId;
255 struct _PerThreadEvents {
256 _PerThreadEvents() : threadId(std::this_thread::get_id()) {}
262 typedef std::deque<Event> EventVector;
268 tbb::enumerable_thread_specific<_PerThreadEvents> _events;
274 tbb::concurrent_queue<VdfExecutionStats*> _subStats;
#define PXR_NAMESPACE_OPEN_SCOPE
void LogEndTimestamp(EventType event, const VdfNode &node)
uint64_t ArchGetTickTime()
VDF_API ~ScopedMallocEvent()
void _Log(EventType event, VdfId nodeId, EventData data)
void LogBeginTimestamp(EventType event, const VdfNode &node)
void _LogTime(EventType event, const VdfNode &node)
VDF_API ScopedEvent(VdfExecutionStats *stats, const VdfNode &node, EventType eventType)
static bool IsEndEvent(EventType event)
VDF_API VdfExecutionStats * _AddSubStat(const VdfNetwork *network, VdfId invokingNodeId)
void LogTimestamp(EventType event, const VdfNode &node)
VDF_API ScopedMallocEvent(VdfExecutionStats *stats, const VdfNode &node, EventType eventType)
static EventType GetBaseEvent(EventType event)
Event(EventType event, VdfId nodeId, EventData data)
EventType _TagEnd(EventType event)
VDF_API ~VdfExecutionStats()
void LogData(EventType event, const VdfNode &node, EventData data)
#define PXR_NAMESPACE_CLOSE_SCOPE
EventType _TagBegin(EventType event)
VDF_API VdfExecutionStats(const VdfNetwork *network)
VDF_API VdfExecutionStats * AddSubStat(const VdfNetwork *network, const VdfNode *invokingNode)
VdfExecutionStats * _stats
const std::optional< VdfId > & GetInvokingNodeId() const
static VDF_API std::string GetMallocTagName(const VdfId *invokingNodeId, const VdfNode &node)
static bool IsBeginEvent(EventType event)
uint64_t VdfId
The unique identifier type for Vdf objects.