mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
add printGraph method to MemoryManager
Signed-off-by: Niklas Eiling <niklas.eiling@eonerc.rwth-aachen.de>
This commit is contained in:
parent
4c03d948da
commit
dd29c96928
2 changed files with 21 additions and 0 deletions
|
@ -141,6 +141,7 @@ public:
|
|||
static MemoryManager &get();
|
||||
|
||||
MemoryGraph &getGraph() { return memoryGraph; }
|
||||
void printGraph();
|
||||
|
||||
AddressSpaceId getProcessAddressSpace() {
|
||||
return getOrCreateAddressSpace("process");
|
||||
|
|
|
@ -227,4 +227,24 @@ MemoryTranslation::operator+=(const MemoryTranslation &other) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
void MemoryManager::printGraph() {
|
||||
auto loggerStatic = logger;
|
||||
|
||||
loggerStatic->info("####### Vertices ########");
|
||||
|
||||
for (unsigned int i = 0; i < memoryGraph.getVertexCount(); i++) {
|
||||
auto vertex = memoryGraph.getVertex(i);
|
||||
loggerStatic->info(std::to_string(i) + ": " + vertex->name);
|
||||
}
|
||||
|
||||
loggerStatic->info("####### Edges ########");
|
||||
|
||||
for (unsigned int i = 0; i < memoryGraph.getEdgeCount(); i++) {
|
||||
auto mapping = memoryGraph.getEdge(i);
|
||||
loggerStatic->info("From: " + std::to_string(mapping->getVertexFrom()) +
|
||||
" To: " + std::to_string(mapping->getVertexTo()) +
|
||||
" ID: " + mapping->toString());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace villas
|
||||
|
|
Loading…
Add table
Reference in a new issue