Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
snake_case in instr
[simgrid.git] / src / msg / instr_msg_process.cpp
1 /* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "src/instr/instr_private.hpp"
7 #include "src/msg/msg_private.hpp"
8 #include "src/simix/ActorImpl.hpp"
9 #include <simgrid/actor.h>
10
11 XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg_process, instr, "MSG process");
12
13 std::string instr_pid(msg_process_t proc)
14 {
15   return std::string(proc->get_cname()) + "-" + std::to_string(proc->get_pid());
16 }
17
18 void TRACE_msg_process_kill(smx_process_exit_status_t status, msg_process_t process)
19 {
20   if (TRACE_actor_is_enabled() && status == SMX_EXIT_FAILURE) {
21     //kill means that this process no longer exists, let's destroy it
22     simgrid::instr::Container::by_name(instr_pid(process))->remove_from_parent();
23   }
24 }