X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c871d5837bd9fefd1942daf48982e3c34c507abb..a4e7a60bca6c13451f237201eb5a7534e5da0838:/src/surf/instr_routing.cpp diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index ccb7013263..1a68583a5e 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -17,7 +17,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_routing, instr, "Tracing platform hierarchy"); static int platform_created = 0; /* indicate whether the platform file has been traced */ -static std::vector currentContainer; /* push and pop, used only in creation */ +static std::vector currentContainer; /* push and pop, used only in creation */ static const char *instr_node_name (xbt_node_t node) { @@ -106,8 +106,7 @@ static void linkContainers(container_t src, container_t dst, std::settype_->getOrCreateContainerType("MPI"); @@ -172,8 +170,8 @@ static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone) } if (TRACE_needs_platform()){ - container_t father = currentContainer.back(); - container_t container = new simgrid::instr::Container(id, simgrid::instr::INSTR_AS, father); + simgrid::instr::NetZoneContainer* container = + new simgrid::instr::NetZoneContainer(id, currentContainer.size(), currentContainer.back()); currentContainer.push_back(container); } } @@ -191,7 +189,7 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link) return; container_t father = currentContainer.back(); - container_t container = new simgrid::instr::Container(link.getName(), simgrid::instr::INSTR_LINK, father); + container_t container = new simgrid::instr::Container(link.getName(), "LINK", father); if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) { simgrid::instr::Type* bandwidth = container->type_->getOrCreateVariableType("bandwidth", ""); @@ -206,8 +204,7 @@ static void instr_routing_parse_start_link(simgrid::s4u::Link& link) static void sg_instr_new_host(simgrid::s4u::Host& host) { - container_t father = currentContainer.back(); - container_t container = new simgrid::instr::Container(host.getName(), simgrid::instr::INSTR_HOST, father); + container_t container = new simgrid::instr::HostContainer(host, currentContainer.back()); if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) { simgrid::instr::Type* speed = container->type_->getOrCreateVariableType("power", ""); @@ -247,10 +244,8 @@ static void sg_instr_new_host(simgrid::s4u::Host& host) static void sg_instr_new_router(simgrid::kernel::routing::NetPoint * netpoint) { - if (not netpoint->isRouter()) - return; - if (TRACE_is_enabled() && TRACE_needs_platform()) - new simgrid::instr::Container(netpoint->getCname(), simgrid::instr::INSTR_ROUTER, currentContainer.back()); + if (netpoint->isRouter() && TRACE_is_enabled() && TRACE_needs_platform()) + new simgrid::instr::RouterContainer(netpoint->getCname(), currentContainer.back()); } static void instr_routing_parse_end_platform () @@ -282,35 +277,35 @@ void instr_routing_define_callbacks () /* * user categories support */ -static void recursiveNewVariableType(std::string new_typename, const char* color, simgrid::instr::Type* root) +static void recursiveNewVariableType(std::string new_typename, std::string color, simgrid::instr::Type* root) { if (root->getName() == "HOST" || root->getName() == "MSG_VM") - root->getOrCreateVariableType(std::string("p") + new_typename, color == nullptr ? "" : color); + root->getOrCreateVariableType(std::string("p") + new_typename, color); if (root->getName() == "LINK") - root->getOrCreateVariableType(std::string("b") + new_typename, color == nullptr ? "" : color); + root->getOrCreateVariableType(std::string("b") + new_typename, color); for (auto elm : root->children_) { - recursiveNewVariableType(new_typename, color == nullptr ? "" : color, elm.second); + recursiveNewVariableType(new_typename, color, elm.second); } } -void instr_new_variable_type(std::string new_typename, const char* color) +void instr_new_variable_type(std::string new_typename, std::string color) { recursiveNewVariableType(new_typename, color, simgrid::instr::Type::getRootType()); } -static void recursiveNewUserVariableType(std::string father_type, std::string new_typename, const char* color, +static void recursiveNewUserVariableType(std::string father_type, std::string new_typename, std::string color, simgrid::instr::Type* root) { if (root->getName() == father_type) { - root->getOrCreateVariableType(new_typename, color == nullptr ? "" : color); + root->getOrCreateVariableType(new_typename, color); } for (auto elm : root->children_) recursiveNewUserVariableType(father_type, new_typename, color, elm.second); } -void instr_new_user_variable_type(std::string father_type, std::string new_typename, const char* color) +void instr_new_user_variable_type(std::string father_type, std::string new_typename, std::string color) { recursiveNewUserVariableType(father_type, new_typename, color, simgrid::instr::Type::getRootType()); } @@ -329,7 +324,7 @@ void instr_new_user_state_type(std::string father_type, std::string new_typename recursiveNewUserStateType(father_type, new_typename, simgrid::instr::Type::getRootType()); } -static void recursiveNewValueForUserStateType(std::string type_name, const char* val, const char* color, +static void recursiveNewValueForUserStateType(std::string type_name, const char* val, std::string color, simgrid::instr::Type* root) { if (root->getName() == type_name) @@ -339,7 +334,7 @@ static void recursiveNewValueForUserStateType(std::string type_name, const char* recursiveNewValueForUserStateType(type_name, val, color, elm.second); } -void instr_new_value_for_user_state_type(std::string type_name, const char* value, const char* color) +void instr_new_value_for_user_state_type(std::string type_name, const char* value, std::string color) { recursiveNewValueForUserStateType(type_name, value, color, simgrid::instr::Type::getRootType()); }