mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
shm: Add size to UnmanagedRegion debug output
This commit is contained in:
parent
ad894c79cf
commit
4f9aeda8ec
|
@ -58,19 +58,22 @@ struct RegionInfo
|
||||||
: fPath("", alloc)
|
: fPath("", alloc)
|
||||||
, fCreationFlags(0)
|
, fCreationFlags(0)
|
||||||
, fUserFlags(0)
|
, fUserFlags(0)
|
||||||
|
, fSize(0)
|
||||||
, fDestroyed(false)
|
, fDestroyed(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
RegionInfo(const char* path, const int flags, const uint64_t userFlags, const VoidAlloc& alloc)
|
RegionInfo(const char* path, int flags, uint64_t userFlags, uint64_t size, const VoidAlloc& alloc)
|
||||||
: fPath(path, alloc)
|
: fPath(path, alloc)
|
||||||
, fCreationFlags(flags)
|
, fCreationFlags(flags)
|
||||||
, fUserFlags(userFlags)
|
, fUserFlags(userFlags)
|
||||||
|
, fSize(size)
|
||||||
, fDestroyed(false)
|
, fDestroyed(false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Str fPath;
|
Str fPath;
|
||||||
int fCreationFlags;
|
int fCreationFlags;
|
||||||
uint64_t fUserFlags;
|
uint64_t fUserFlags;
|
||||||
|
uint64_t fSize;
|
||||||
bool fDestroyed;
|
bool fDestroyed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -267,6 +267,7 @@ bool Monitor::PrintShm(const ShmId& shmId)
|
||||||
ss << "\n unmanaged regions:";
|
ss << "\n unmanaged regions:";
|
||||||
for (const auto& r : *shmRegions) {
|
for (const auto& r : *shmRegions) {
|
||||||
ss << "\n [" << r.first << "]: " << (r.second.fDestroyed ? "destroyed" : "alive");
|
ss << "\n [" << r.first << "]: " << (r.second.fDestroyed ? "destroyed" : "alive");
|
||||||
|
ss << ", size: " << r.second.fSize;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boost::interprocess::message_queue q(open_only, std::string("fmq_" + std::string(shmId) + "_rgq_" + to_string(r.first)).c_str());
|
boost::interprocess::message_queue q(open_only, std::string("fmq_" + std::string(shmId) + "_rgq_" + to_string(r.first)).c_str());
|
||||||
|
|
|
@ -119,7 +119,7 @@ struct UnmanagedRegion
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!remote) {
|
if (!remote) {
|
||||||
Register(shmId, cfg);
|
Register(shmId, cfg, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG(trace) << "shmem: initialized region: " << fName << " (" << (remote ? "remote" : "local") << ")";
|
LOG(trace) << "shmem: initialized region: " << fName << " (" << (remote ? "remote" : "local") << ")";
|
||||||
|
@ -223,7 +223,7 @@ struct UnmanagedRegion
|
||||||
return regionCfg;
|
return regionCfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Register(const std::string& shmId, RegionConfig& cfg)
|
static void Register(const std::string& shmId, RegionConfig& cfg, uint64_t size)
|
||||||
{
|
{
|
||||||
using namespace boost::interprocess;
|
using namespace boost::interprocess;
|
||||||
managed_shared_memory mngSegment(open_or_create, std::string("fmq_" + shmId + "_mng").c_str(), 6553600);
|
managed_shared_memory mngSegment(open_or_create, std::string("fmq_" + shmId + "_mng").c_str(), 6553600);
|
||||||
|
@ -236,7 +236,7 @@ struct UnmanagedRegion
|
||||||
eventCounter = mngSegment.construct<EventCounter>(unique_instance)(0);
|
eventCounter = mngSegment.construct<EventCounter>(unique_instance)(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool newShmRegionCreated = shmRegions->emplace(cfg.id.value(), RegionInfo(cfg.path.c_str(), cfg.creationFlags, cfg.userFlags, alloc)).second;
|
bool newShmRegionCreated = shmRegions->emplace(cfg.id.value(), RegionInfo(cfg.path.c_str(), cfg.creationFlags, cfg.userFlags, size, alloc)).second;
|
||||||
if (newShmRegionCreated) {
|
if (newShmRegionCreated) {
|
||||||
(eventCounter->fCount)++;
|
(eventCounter->fCount)++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user