Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
TRACE_start and TRACE_end should no longer be called by user-code
[simgrid.git] / examples / msg / tracing / procmig.c
index e72866f..2a22680 100644 (file)
@@ -17,23 +17,23 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_test,
 static int emigrant(int argc, char *argv[])
 {
   INFO0("Setting process category");
-  TRACE_msg_set_process_category (MSG_process_self(), "emigrant");
-  MSG_process_sleep (2);
+  TRACE_msg_set_process_category(MSG_process_self(), "emigrant");
+  MSG_process_sleep(2);
   INFO0("Migrating to Tremblay");
   MSG_process_change_host(MSG_get_host_by_name("Tremblay"));
-  MSG_process_sleep (2);
+  MSG_process_sleep(2);
   INFO0("Migrating to Jupiter");
   MSG_process_change_host(MSG_get_host_by_name("Jupiter"));
-  MSG_process_sleep (2);
+  MSG_process_sleep(2);
   INFO0("Migrating to Fafard");
   MSG_process_change_host(MSG_get_host_by_name("Fafard"));
-  MSG_process_sleep (2);
+  MSG_process_sleep(2);
   INFO0("Migrating to Ginette");
   MSG_process_change_host(MSG_get_host_by_name("Ginette"));
-  MSG_process_sleep (2);
+  MSG_process_sleep(2);
   INFO0("Migrating to Bourassa");
   MSG_process_change_host(MSG_get_host_by_name("Bourassa"));
-  MSG_process_sleep (2);
+  MSG_process_sleep(2);
   return 0;
 }
 
@@ -42,10 +42,6 @@ int main(int argc, char *argv[])
 {
   MSG_error_t res = MSG_OK;
 
-  //starting the simulation trace
-  TRACE_start_with_mask ("procmig.trace", TRACE_PROCESS);
-  TRACE_category ("emigrant");
-
   /* Argument checking */
   MSG_global_init(&argc, argv);
   if (argc < 3) {
@@ -54,6 +50,7 @@ int main(int argc, char *argv[])
               argv[0]);
     exit(1);
   }
+  TRACE_category("emigrant");
 
   /* Simulation setting */
   MSG_create_environment(argv[1]);
@@ -68,9 +65,6 @@ int main(int argc, char *argv[])
   if (res == MSG_OK)
     res = MSG_clean();
 
-  //ending the simulation trace
-  TRACE_end();
-
   if (res == MSG_OK)
     return 0;
   else