diff --git a/lglpy/timeline/data/raw_trace.py b/lglpy/timeline/data/raw_trace.py index b2ceab9..1d58a5c 100644 --- a/lglpy/timeline/data/raw_trace.py +++ b/lglpy/timeline/data/raw_trace.py @@ -200,10 +200,7 @@ def __init__(self, frame: int, metadata: JSONType): self.frame = frame self.tag_id = int(metadata['tid']) - self.label_stack = None - label_stack = metadata.get('label', None) - if label_stack: - self.label_stack = label_stack.split('|') + self.label_stack = metadata.get('label', None) def get_perfetto_tag_id(self) -> str: ''' @@ -310,9 +307,6 @@ class MetadataBufferTransfer(MetadataWorkload): Parsed GPU Timeline layer payload for a transfer that writes a buffer. Attributes: - frame: The frame index in the application. - tag_id: The unique workload tag ID to cross-reference with Perfetto. - label_stack: Debug label stack, or None if no user labels. subtype: Specific type of the transfer. byte_count: Number of bytes written, or -1 if unknown. ''' @@ -641,7 +635,6 @@ def load_perfetto_from_file( # Extract render stages events from Perfetto data for packet in protoc.packet: - # Clock sync packet so update clock drift information if packet.HasField('clock_snapshot'): config.add_clock_sync_data(packet) diff --git a/source_common/trackers/layer_command_stream.cpp b/source_common/trackers/layer_command_stream.cpp index 48a62ae..5e84e61 100644 --- a/source_common/trackers/layer_command_stream.cpp +++ b/source_common/trackers/layer_command_stream.cpp @@ -75,7 +75,7 @@ LCSRenderPass::LCSRenderPass( /* See header for details. */ std::string LCSRenderPass::getBeginMetadata( - const std::string* debugLabel) const + const std::vector* debugLabel) const { // Draw count for a multi-submit command buffer cannot be reliably // associated with a single tagID if restartable across command buffer @@ -140,7 +140,7 @@ std::string LCSRenderPass::getBeginMetadata( /* See header for details. */ std::string LCSRenderPass::getContinuationMetadata( - const std::string* debugLabel, + const std::vector* debugLabel, uint64_t tagIDContinuation) const { json metadata = { @@ -159,7 +159,7 @@ std::string LCSRenderPass::getContinuationMetadata( /* See header for details. */ std::string LCSRenderPass::getMetadata( - const std::string* debugLabel, + const std::vector* debugLabel, uint64_t tagIDContinuation) const { if (tagID) @@ -189,7 +189,7 @@ LCSDispatch::LCSDispatch( /* See header for details. */ std::string LCSDispatch::getMetadata( - const std::string* debugLabel, + const std::vector* debugLabel, uint64_t tagIDContinuation ) const { UNUSED(tagIDContinuation); @@ -227,7 +227,7 @@ LCSTraceRays::LCSTraceRays( /* See header for details. */ std::string LCSTraceRays::getMetadata( - const std::string* debugLabel, + const std::vector* debugLabel, uint64_t tagIDContinuation ) const { UNUSED(tagIDContinuation); @@ -263,9 +263,10 @@ LCSImageTransfer::LCSImageTransfer( /* See header for details. */ std::string LCSImageTransfer::getMetadata( - const std::string* debugLabel, + const std::vector* debugLabel, uint64_t tagIDContinuation -) const { +) const +{ UNUSED(tagIDContinuation); json metadata = { @@ -298,7 +299,7 @@ LCSBufferTransfer::LCSBufferTransfer( /* See header for details. */ std::string LCSBufferTransfer::getMetadata( - const std::string* debugLabel, + const std::vector* debugLabel, uint64_t tagIDContinuation ) const { UNUSED(tagIDContinuation); diff --git a/source_common/trackers/layer_command_stream.hpp b/source_common/trackers/layer_command_stream.hpp index ac9a331..651754f 100644 --- a/source_common/trackers/layer_command_stream.hpp +++ b/source_common/trackers/layer_command_stream.hpp @@ -87,11 +87,11 @@ class LCSWorkload /** * @brief Get the metadata for this workload * - * @param debugLabel The debug label state of the VkQueue at submit time. + * @param debugLabel The debug label stack for the VkQueue at submit time. * @param tagIDContinuation The ID of the workload if this is a continuation of it. */ virtual std::string getMetadata( - const std::string* debugLabel=nullptr, + const std::vector* debugLabel=nullptr, uint64_t tagIDContinuation=0) const = 0; /** @@ -180,26 +180,26 @@ class LCSRenderPass : public LCSWorkload /* See base class for documentation. */ virtual std::string getMetadata( - const std::string* debugLabel=nullptr, + const std::vector* debugLabel=nullptr, uint64_t tagIDContinuation=0) const; private: /** * @brief Get the metadata for this workload if beginning a new render pass. * - * @param debugLabel The debug label state of the VkQueue at submit time. + * @param debugLabel The debug label stack of the VkQueue at submit time. */ std::string getBeginMetadata( - const std::string* debugLabel=nullptr) const; + const std::vector* debugLabel=nullptr) const; /** * @brief Get the metadata for this workload if continuing an existing render pass. * - * @param debugLabel The debug label state of the VkQueue at submit time. + * @param debugLabel The debug label stack of the VkQueue at submit time. * @param tagIDContinuation The ID of the workload if this is a continuation of it. */ std::string getContinuationMetadata( - const std::string* debugLabel=nullptr, + const std::vector* debugLabel=nullptr, uint64_t tagIDContinuation=0) const; /** @@ -270,7 +270,7 @@ class LCSDispatch : public LCSWorkload /* See base class for documentation. */ virtual std::string getMetadata( - const std::string* debugLabel=nullptr, + const std::vector* debugLabel=nullptr, uint64_t tagIDContinuation=0) const; private: @@ -319,7 +319,7 @@ class LCSTraceRays : public LCSWorkload /* See base class for documentation. */ virtual std::string getMetadata( - const std::string* debugLabel=nullptr, + const std::vector* debugLabel=nullptr, uint64_t tagIDContinuation=0) const; private: @@ -366,7 +366,7 @@ class LCSImageTransfer : public LCSWorkload /* See base class for documentation. */ virtual std::string getMetadata( - const std::string* debugLabel=nullptr, + const std::vector* debugLabel=nullptr, uint64_t tagIDContinuation=0) const; private: @@ -409,7 +409,7 @@ class LCSBufferTransfer : public LCSWorkload /* See base class for documentation. */ virtual std::string getMetadata( - const std::string* debugLabel=nullptr, + const std::vector* debugLabel=nullptr, uint64_t tagIDContinuation=0) const; private: @@ -448,7 +448,7 @@ class LCSMarker : public LCSWorkload /* See base class for documentation. */ virtual std::string getMetadata( - const std::string* debugLabel=nullptr, + const std::vector* debugLabel=nullptr, uint64_t tagIDContinuation=0) const { UNUSED(debugLabel); diff --git a/source_common/trackers/queue.cpp b/source_common/trackers/queue.cpp index e9a57d2..c6a7ef7 100644 --- a/source_common/trackers/queue.cpp +++ b/source_common/trackers/queue.cpp @@ -61,14 +61,11 @@ void Queue::runSubmitCommandStream( auto* workload = dynamic_cast(opData); uint64_t tagID = workload->getTagID(); - // Build the debug info - std::string log = joinString(debugStack, "|"); - // Workload is a new render pass if (tagID > 0) { assert(lastRenderPassTagID == 0); - callback(workload->getMetadata(&log)); + callback(workload->getMetadata(&debugStack)); lastRenderPassTagID = 0; if (workload->isSuspending()) @@ -94,7 +91,7 @@ void Queue::runSubmitCommandStream( { uint64_t tagID = opData->getTagID(); std::string log = joinString(debugStack, "|"); - callback(opData->getMetadata(&log, tagID)); + callback(opData->getMetadata(&debugStack, tagID)); } } }