From 57588c3696134c233df4059f48b4188310805d83 Mon Sep 17 00:00:00 2001 From: Takishipp Date: Fri, 30 Jun 2017 12:18:49 +0200 Subject: [PATCH] get sg_instr_new_router through a signal --- src/instr/instr_paje_types.cpp | 1 + src/surf/instr_routing.cpp | 9 ++++++--- src/surf/sg_platf.cpp | 1 - src/surf/xml/platf_private.hpp | 2 -- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index acb89e3c47..d43f48a9da 100644 --- a/src/instr/instr_paje_types.cpp +++ b/src/instr/instr_paje_types.cpp @@ -19,6 +19,7 @@ void PJ_type_release () rootType = nullptr; } + type_t PJ_type_get_root () { return rootType; diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index ed350fe675..b14c04da59 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -8,6 +8,7 @@ #include "simgrid/s4u/Engine.hpp" #include "simgrid/s4u/Host.hpp" #include "src/kernel/routing/NetZoneImpl.hpp" +#include "src/kernel/routing/NetPoint.hpp" #include "src/surf/network_interface.hpp" #include "src/surf/xml/platf_private.hpp" #include "surf/surf.h" @@ -294,11 +295,13 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) } -void sg_instr_new_router(const char* name) +static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint) { + if (not netpoint->isRouter()) + return; if (TRACE_is_enabled() && TRACE_needs_platform()) { container_t father = currentContainer.back(); - PJ_container_new(name, INSTR_ROUTER, father); + PJ_container_new(netpoint->cname(), INSTR_ROUTER, father); } } @@ -327,8 +330,8 @@ void instr_routing_define_callbacks () } simgrid::s4u::NetZone::onCreation.connect(sg_instr_AS_begin); simgrid::s4u::NetZone::onSeal.connect(sg_instr_AS_end); + simgrid::kernel::routing::NetPoint::onCreation.connect(&sg_instr_new_router); } - /* * user categories support */ diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index d75966f784..288fef0573 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -119,7 +119,6 @@ simgrid::kernel::routing::NetPoint* sg_platf_new_router(const char* name, const if (coords && strcmp(coords, "")) new simgrid::kernel::routing::vivaldi::Coords(netpoint, coords); - sg_instr_new_router(name); return netpoint; } diff --git a/src/surf/xml/platf_private.hpp b/src/surf/xml/platf_private.hpp index 6939107fce..ca6daa0fce 100644 --- a/src/surf/xml/platf_private.hpp +++ b/src/surf/xml/platf_private.hpp @@ -244,8 +244,6 @@ XBT_PRIVATE void surfxml_bufferstack_pop(int _new); XBT_PUBLIC_DATA(int) surfxml_bufferstack_size; XBT_PUBLIC(void) routing_route_free(sg_platf_route_cbarg_t route); -/********** Instr. **********/ -XBT_PRIVATE void sg_instr_new_router(const char* name); SG_END_DECL() -- 2.20.1