IoUringEngn: add random dummy slot generator for debugging
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
#include <atomic>
|
||||
#include <random>
|
||||
#include <liburing.h>
|
||||
#include <boost/asio/io_service.hpp>
|
||||
#include <boost/asio/deadline_timer.hpp>
|
||||
@@ -46,6 +47,8 @@ public:
|
||||
static size_t computePointsPerDgram(int returnMode);
|
||||
static size_t computePointsPerFrame(int returnMode, size_t nDgramsPerFrame)
|
||||
{ return computePointsPerDgram(returnMode) * nDgramsPerFrame; }
|
||||
static bool compactionIsNeeded(uint32_t nSucceeded, uint32_t nTotal)
|
||||
{ return nSucceeded != 0 && nTotal != 0 && nSucceeded != nTotal; }
|
||||
|
||||
private:
|
||||
PcloudStimulusBuffer& parent;
|
||||
@@ -86,13 +89,20 @@ private:
|
||||
// Track which slots have been successfully assembled and maintain persistent iovecs
|
||||
std::vector<SlotAssemblyDesc> assembledSlotsTracker;
|
||||
|
||||
// Random number generation for dummy slot creation
|
||||
std::random_device randomDevice;
|
||||
std::mt19937 randomGenerator;
|
||||
|
||||
void fillUnAssembledSlotsWithDummyDgrams();
|
||||
void printSlotBytes(size_t slotIndex, size_t nBytes);
|
||||
void randomDummySlotFiller(AsynchronousLoop& loop);
|
||||
void onEventfdRead(
|
||||
const boost::system::error_code& error, std::size_t bytes_transferred);
|
||||
|
||||
class AssembleFrameReq;
|
||||
friend class AssembleFrameReq;
|
||||
|
||||
public:
|
||||
void printSlotBytes(size_t slotIndex, size_t nBytes);
|
||||
};
|
||||
|
||||
} // namespace stim_buff
|
||||
|
||||
Reference in New Issue
Block a user