From 5bb9c9e90bf07690a54b49539e2a32d98625fc7b Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Mon, 10 Nov 2025 01:05:20 -0400 Subject: [PATCH] Dbg: Useful printfs for the raspi5 --- commonLibs/attachmentSupport/stimulusBuffer.cpp | 5 ++++- stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp | 11 +++++++++++ .../livoxGen1/openClCollatingAndMeshingEngine.cpp | 7 +++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/commonLibs/attachmentSupport/stimulusBuffer.cpp b/commonLibs/attachmentSupport/stimulusBuffer.cpp index 7f44ce4..2ebdfba 100644 --- a/commonLibs/attachmentSupport/stimulusBuffer.cpp +++ b/commonLibs/attachmentSupport/stimulusBuffer.cpp @@ -88,7 +88,10 @@ void StimulusBuffer::onTimeout(const boost::system::error_code& error) if (frameAssemblyRateLimiter.tryAcquire()) { nextWakeupDelayMs = CONFIG_STIMBUFF_FRAME_PERIOD_MS; } else - { nextWakeupDelayMs = CONFIG_STIMBUFF_FRAME_RETRY_DELAY_MS; } + { +std::cout << __func__ << ": Deferring frame production due to rate limit." << std::endl; + nextWakeupDelayMs = CONFIG_STIMBUFF_FRAME_RETRY_DELAY_MS; + } // Call the derived class's frame production handler stimFrameProductionTimesliceInd(); diff --git a/stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp b/stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp index 89175c2..1eacbdb 100644 --- a/stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp +++ b/stimBuffApis/livoxGen1/ioUringAssemblyEngine.cpp @@ -524,9 +524,20 @@ public: return; } + // Artificially create random dummy slots for testing + context->engine.randomDummySlotFiller(context->loop); + // Fill un-assembled slots with dummy datagrams context->engine.fillUnAssembledSlotsWithDummyDgrams(); + // Print first 4 bytes of each slot (whether assembled or not) + if (context->engine.frameAssemblyDesc) + { + for (size_t i = 0; i < context->engine.frameAssemblyDesc->numSlots; ++i) { + context->engine.printSlotBytes(i, 4); + } + } + if (context->loop.nSucceeded.load() >= context->loop.nTotal) { // Success: all or more slots succeeded diff --git a/stimBuffApis/livoxGen1/openClCollatingAndMeshingEngine.cpp b/stimBuffApis/livoxGen1/openClCollatingAndMeshingEngine.cpp index f7eb1c2..22d0007 100644 --- a/stimBuffApis/livoxGen1/openClCollatingAndMeshingEngine.cpp +++ b/stimBuffApis/livoxGen1/openClCollatingAndMeshingEngine.cpp @@ -648,7 +648,7 @@ public: cl_int compactStatus) { engine.stopCompactKernel(); - +std::cout << __func__ << ": Compact done, compact status: " << compactStatus << std::endl; // If compact failed, call callback directly with failure if (compactStatus != CL_SUCCESS) { @@ -683,6 +683,7 @@ public: callOriginalCallback(false); return; } +std::cout << __func__ << ": Started collate kernel" << std::endl; } void compactCollateAndMeshFrameReq4_collateDone_maybePosted( @@ -690,7 +691,7 @@ public: cl_int collateStatus) { engine.stopCollateKernel(); - +std::cout << __func__ << ": Collate done, collate status: " << collateStatus << std::endl; bool success = (collateStatus == CL_SUCCESS); callOriginalCallback(success); } @@ -718,6 +719,7 @@ void OpenClCollatingAndMeshingEngine::compactCollateAndMeshFrameReq( &CompactCollateAndMeshFrameReq ::compactCollateAndMeshFrameReq1_doCompact_posted, request.get(), request))); +std::cout << __func__ << ": Started compact kernel" << std::endl; } else { @@ -727,6 +729,7 @@ void OpenClCollatingAndMeshingEngine::compactCollateAndMeshFrameReq( &CompactCollateAndMeshFrameReq ::compactCollateAndMeshFrameReq3_doCollate_posted, request.get(), request))); +std::cout << __func__ << ": Skipped compaction, started collate kernel" << std::endl; } }