Production: log durations and results for debugging
This commit is contained in:
@@ -29,6 +29,10 @@
|
|||||||
namespace smo {
|
namespace smo {
|
||||||
namespace stim_buff {
|
namespace stim_buff {
|
||||||
|
|
||||||
|
#ifndef SMO_PRINT_PCLOUD_ASSEMBLY_RESULTS
|
||||||
|
#define SMO_PRINT_PCLOUD_ASSEMBLY_RESULTS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
inline LivoxProto1DllState& getLivoxProto1State() { return livoxProto1; }
|
inline LivoxProto1DllState& getLivoxProto1State() { return livoxProto1; }
|
||||||
|
|
||||||
struct DummyLivoxEthHeader
|
struct DummyLivoxEthHeader
|
||||||
@@ -431,6 +435,29 @@ public:
|
|||||||
callOriginalCb(success, loop);
|
callOriginalCb(success, loop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void logAssemblyCycleResult(
|
||||||
|
const char *outcome, bool callbackSuccess) const
|
||||||
|
{
|
||||||
|
#if SMO_PRINT_PCLOUD_ASSEMBLY_RESULTS
|
||||||
|
size_t trackerAssembledCount = 0;
|
||||||
|
for (const auto &slotDesc : engine.assembledSlotsTracker)
|
||||||
|
{
|
||||||
|
if (slotDesc.assembled) {
|
||||||
|
++trackerAssembledCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::cout << "AssembleFrameReq: " << outcome
|
||||||
|
<< " callbackSuccess=" << callbackSuccess
|
||||||
|
<< " timerFired=" << (timerFired.load() ? "yes" : "no")
|
||||||
|
<< " nSucceeded=" << loop.nSucceeded.load()
|
||||||
|
<< " nFailed=" << loop.nFailed.load()
|
||||||
|
<< " nTotal=" << loop.nTotal
|
||||||
|
<< " trackerAssembled=" << trackerAssembledCount
|
||||||
|
<< std::endl;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void assembleFrameReq1_posted(
|
void assembleFrameReq1_posted(
|
||||||
std::shared_ptr<AssembleFrameReq> context)
|
std::shared_ptr<AssembleFrameReq> context)
|
||||||
@@ -497,6 +524,8 @@ public:
|
|||||||
{
|
{
|
||||||
context->engine.assemblyCycleComplete();
|
context->engine.assemblyCycleComplete();
|
||||||
context->loop.setRemainingIterationsToFailure();
|
context->loop.setRemainingIterationsToFailure();
|
||||||
|
context->logAssemblyCycleResult(
|
||||||
|
"engine_cancelled_on_timer", false);
|
||||||
context->callOriginalCallback(false, context->loop);
|
context->callOriginalCallback(false, context->loop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -516,6 +545,8 @@ public:
|
|||||||
{
|
{
|
||||||
context->engine.assemblyCycleComplete();
|
context->engine.assemblyCycleComplete();
|
||||||
context->loop.setRemainingIterationsToFailure();
|
context->loop.setRemainingIterationsToFailure();
|
||||||
|
context->logAssemblyCycleResult(
|
||||||
|
"engine_cancelled_on_cqe", false);
|
||||||
context->callOriginalCallback(false, context->loop);
|
context->callOriginalCallback(false, context->loop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -566,6 +597,7 @@ public:
|
|||||||
// Error: no slots succeeded - no data received successfully.
|
// Error: no slots succeeded - no data received successfully.
|
||||||
if (context->loop.nSucceeded.load() == 0)
|
if (context->loop.nSucceeded.load() == 0)
|
||||||
{
|
{
|
||||||
|
context->logAssemblyCycleResult("no_slots_succeeded", false);
|
||||||
context->callOriginalCallback(false, context->loop);
|
context->callOriginalCallback(false, context->loop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -598,6 +630,7 @@ public:
|
|||||||
<< ") > nTotal (" << context->loop.nTotal << ")\n";
|
<< ") > nTotal (" << context->loop.nTotal << ")\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context->logAssemblyCycleResult("all_slots_succeeded", true);
|
||||||
context->callOriginalCallback(true, context->loop);
|
context->callOriginalCallback(true, context->loop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -605,11 +638,12 @@ public:
|
|||||||
if (context->loop.nSucceeded.load() < context->loop.nTotal)
|
if (context->loop.nSucceeded.load() < context->loop.nTotal)
|
||||||
{
|
{
|
||||||
// Success: some slots succeeded (less than total)
|
// Success: some slots succeeded (less than total)
|
||||||
// Note: dummy fill for un-assembled slots will be implemented later
|
context->logAssemblyCycleResult("partial_slots_succeeded", true);
|
||||||
context->callOriginalCallback(true, context->loop);
|
context->callOriginalCallback(true, context->loop);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context->logAssemblyCycleResult("invalid_slot_count_state", false);
|
||||||
if (smoHooksPtr->OptionParser_getOptions().verbose)
|
if (smoHooksPtr->OptionParser_getOptions().verbose)
|
||||||
{
|
{
|
||||||
std::cerr << __func__ << ": Invalid state: nSucceeded ("
|
std::cerr << __func__ << ": Invalid state: nSucceeded ("
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ extern const smo::stim_buff::SmoCallbacks* smoHooksPtr;
|
|||||||
namespace smo {
|
namespace smo {
|
||||||
namespace stim_buff {
|
namespace stim_buff {
|
||||||
|
|
||||||
|
#ifndef SMO_PRINT_PCLOUD_COLLATE_RESULTS
|
||||||
|
#define SMO_PRINT_PCLOUD_COLLATE_RESULTS 1
|
||||||
|
#endif
|
||||||
|
|
||||||
OpenClCollatingAndMeshingEngine::OpenClCollatingAndMeshingEngine(
|
OpenClCollatingAndMeshingEngine::OpenClCollatingAndMeshingEngine(
|
||||||
PcloudStimulusProducer& parent_)
|
PcloudStimulusProducer& parent_)
|
||||||
: parent(parent_),
|
: parent(parent_),
|
||||||
@@ -1194,14 +1198,15 @@ OpenClCollatingAndMeshingEngine::compactCollateAndMeshFrameCReq(
|
|||||||
}
|
}
|
||||||
(void)highIntensityCount;
|
(void)highIntensityCount;
|
||||||
|
|
||||||
#if 0
|
#if SMO_PRINT_PCLOUD_COLLATE_RESULTS
|
||||||
std::cout << __func__ << ": intensityRingBufferIndex="
|
std::cout << __func__ << ": collate done intensityRingBufferIndex="
|
||||||
<< (intensityStimFrame.has_value() ?
|
<< (intensityStimFrame.has_value() ?
|
||||||
intensityStimFrame->get().ringBufferIndex : SIZE_MAX)
|
intensityStimFrame->get().ringBufferIndex : SIZE_MAX)
|
||||||
<< ", pointsPerDgram=" << pointsPerDgram
|
<< " pointsPerDgram=" << pointsPerDgram
|
||||||
<< ", nSucceeded=" << nSucceeded
|
<< " nSucceeded=" << nSucceeded
|
||||||
<< ", totalPoints=" << totalPoints
|
<< " totalPoints=" << totalPoints
|
||||||
<< ", highIntensityCount=" << highIntensityCount << std::endl;
|
<< " highIntensityCount=" << highIntensityCount
|
||||||
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
co_return success;
|
co_return success;
|
||||||
|
|||||||
Reference in New Issue
Block a user