Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
trace process creation before request for simix, assuming it won't fail
authorLucas Schnorr <Lucas.Schnorr@imag.fr>
Mon, 11 Apr 2011 07:59:16 +0000 (09:59 +0200)
committerLucas Schnorr <Lucas.Schnorr@imag.fr>
Mon, 11 Apr 2011 07:59:16 +0000 (09:59 +0200)
src/instr/instr_msg_process.c
src/instr/instr_private.h
src/msg/m_process.c

index 99a8e63..365651c 100644 (file)
@@ -20,7 +20,12 @@ void TRACE_msg_set_process_category(m_process_t process, const char *category, c
 
 char *instr_process_id (m_process_t proc, char *str, int len)
 {
-  snprintf (str, len, "%s-%d", MSG_process_get_name(proc), MSG_process_get_PID(proc));
+  return instr_process_id_2 (MSG_process_get_name(proc), MSG_process_get_PID(proc), str, len);
+}
+
+char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len)
+{
+  snprintf (str, len, "%s-%d", process_name, process_pid);
   return str;
 }
 
@@ -60,15 +65,14 @@ void TRACE_msg_process_change_host(m_process_t process, m_host_t old_host, m_hos
   }
 }
 
-void TRACE_msg_process_create (m_process_t process)
+void TRACE_msg_process_create (const char *process_name, int process_pid, m_host_t host)
 {
   if (TRACE_msg_process_is_enabled()){
     int len = INSTR_DEFAULT_STR_SIZE;
     char str[INSTR_DEFAULT_STR_SIZE];
 
-    m_host_t host = MSG_process_get_host(process);
     container_t host_container = getContainer(host->name);
-    container_t msg = newContainer(instr_process_id(process, str, len), INSTR_MSG_PROCESS, host_container);
+    container_t msg = newContainer(instr_process_id_2(process_name, process_pid, str, len), INSTR_MSG_PROCESS, host_container);
 
     type_t type = getType ("MSG_PROCESS_STATE", msg->type);
     val_t value = getValueByName ("executing", type);
index 8eefa97..2c6442b 100644 (file)
@@ -105,9 +105,10 @@ void TRACE_msg_task_put_end(void);
 
 /* declaration of instrumentation functions from msg_process_instr.c */
 char *instr_process_id (m_process_t proc, char *str, int len);
+char *instr_process_id_2 (const char *process_name, int process_pid, char *str, int len);
 void TRACE_msg_process_change_host(m_process_t process, m_host_t old_host,
                                    m_host_t new_host);
-void TRACE_msg_process_create (m_process_t process);
+void TRACE_msg_process_create (const char *process_name, int process_pid, m_host_t host);
 void TRACE_msg_process_kill(m_process_t process);
 void TRACE_msg_process_suspend(m_process_t process);
 void TRACE_msg_process_resume(m_process_t process);
index 177a20c..a7b18f8 100644 (file)
@@ -159,7 +159,7 @@ m_process_t MSG_process_create_with_environment(const char *name,
   }
 
 #ifdef HAVE_TRACING
-  TRACE_msg_process_create(process);
+  TRACE_msg_process_create(name, simdata->PID, simdata->m_host);
 #endif
 
   /* Let's create the process: SIMIX may decide to start it right now,