if (TRACE_msg_process_is_enabled()){
static long long int counter = 0;
- std::string key = std::to_string(counter++);
+ std::string key = std::to_string(counter);
+ counter++;
//start link
- container_t msg = simgrid::instr::Container::byName(instr_pid(process));
- simgrid::instr::LinkType* link =
- static_cast<simgrid::instr::LinkType*>(simgrid::instr::Type::getRootType()->byName("MSG_PROCESS_LINK"));
- link->startEvent(simgrid::instr::Container::getRootContainer(), msg, "M", key);
+ container_t msg = simgrid::instr::Container::byName(instr_pid(process));
+ simgrid::instr::LinkType* link = simgrid::instr::Container::getRoot()->getLink("MSG_PROCESS_LINK");
+ link->startEvent(msg, "M", key);
//destroy existing container of this process
TRACE_msg_process_destroy (MSG_process_get_name (process), MSG_process_get_PID (process));
//end link
msg = simgrid::instr::Container::byName(instr_pid(process));
- link->endEvent(simgrid::instr::Container::getRootContainer(), msg, "M", key);
+ link->endEvent(msg, "M", key);
}
}