From: Martin Quinson Date: Fri, 30 Jun 2017 20:38:10 +0000 (+0200) Subject: Merge pull request #193 from Takishipp/signals X-Git-Tag: v3_17~491^2 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/d5b29830df70e823202e384a7655e4371193ecd7?hp=d7d6455c7504278fee7eb60f643e9f3bf0fefe9c Merge pull request #193 from Takishipp/signals get sg_instr_new_router through a signal --- diff --git a/src/instr/instr_paje_types.cpp b/src/instr/instr_paje_types.cpp index 9fd1dfec5e..50df5282eb 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 75db20ec2e..79883f4f1b 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -120,7 +120,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 931f78a7bc..d6b4dd88d0 100644 --- a/src/surf/xml/platf_private.hpp +++ b/src/surf/xml/platf_private.hpp @@ -239,8 +239,6 @@ XBT_PUBLIC(void) surf_parse_set_debug(int bdebug); XBT_PUBLIC(int) surf_parse_lex_destroy(); 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()