Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] renaming system call to set any action tracing categories, make useful also...
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 09:56:14 +0000 (09:56 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 09:56:14 +0000 (09:56 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9029 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/simix/simix.h
src/msg/gos.c
src/simix/host_private.h
src/simix/smurf_private.h
src/simix/smx_host.c
src/simix/smx_smurf.c
src/simix/smx_user.c

index 0c60ed1..8270b26 100644 (file)
@@ -117,9 +117,6 @@ XBT_PUBLIC(void) SIMIX_req_host_execution_cancel(smx_action_t execution);
 XBT_PUBLIC(double) SIMIX_req_host_execution_get_remains(smx_action_t execution);
 XBT_PUBLIC(e_smx_state_t) SIMIX_req_host_execution_get_state(smx_action_t execution);
 XBT_PUBLIC(void) SIMIX_req_host_execution_set_priority(smx_action_t execution, double priority);
-#ifdef HAVE_TRACING
-XBT_PUBLIC(void) SIMIX_req_host_execution_set_category(smx_action_t execution, const char *category);
-#endif
 XBT_PUBLIC(void) SIMIX_req_host_execution_wait(smx_action_t execution);
 
 
@@ -201,6 +198,11 @@ XBT_PUBLIC(void) SIMIX_req_comm_copy_buffer_callback(smx_action_t comm, size_t b
 XBT_PUBLIC(int) SIMIX_req_comm_is_latency_bounded(smx_action_t comm);
 #endif
 
+#ifdef HAVE_TRACING
+/************************** Tracing handling **********************************/
+XBT_PUBLIC(void) SIMIX_req_set_category(smx_action_t action, const char *category);
+#endif
+
 /************************** Synchro handling **********************************/
 
 XBT_PUBLIC(smx_mutex_t) SIMIX_req_mutex_init(void);
index ba361cc..859bb08 100644 (file)
@@ -67,7 +67,7 @@ MSG_error_t MSG_task_execute(m_task_t task)
                            simdata->computation_amount);
   SIMIX_req_host_execution_set_priority(simdata->compute, simdata->priority);
 #ifdef HAVE_TRACING
-  SIMIX_req_host_execution_set_category(simdata->compute, task->category);
+  SIMIX_req_set_category(simdata->compute, task->category);
 #endif
 
   self->simdata->waiting_action = simdata->compute;
index 65a48b6..ad5332d 100644 (file)
@@ -37,9 +37,6 @@ void SIMIX_host_execution_cancel(smx_action_t action);
 double SIMIX_host_execution_get_remains(smx_action_t action);
 e_smx_state_t SIMIX_host_execution_get_state(smx_action_t action);
 void SIMIX_host_execution_set_priority(smx_action_t action, double priority);
-#ifdef HAVE_TRACING
-void SIMIX_host_execution_set_category(smx_action_t action, const char *category);
-#endif
 void SIMIX_pre_host_execution_wait(smx_req_t req);
 
 void SIMIX_host_execution_suspend(smx_action_t action);
@@ -47,5 +44,9 @@ void SIMIX_host_execution_resume(smx_action_t action);
 
 void SIMIX_post_host_execute(smx_action_t action);
 
+#ifdef HAVE_TRACING
+void SIMIX_set_category(smx_action_t action, const char *category);
+#endif
+
 #endif
 
index 7a80c3f..09050f9 100644 (file)
@@ -24,9 +24,6 @@ typedef enum {
   REQ_HOST_EXECUTION_GET_REMAINS,
   REQ_HOST_EXECUTION_GET_STATE,
   REQ_HOST_EXECUTION_SET_PRIORITY,
-#ifdef HAVE_TRACING
-  REQ_HOST_EXECUTION_SET_CATEGORY,
-#endif
   REQ_HOST_EXECUTION_WAIT,
   REQ_PROCESS_CREATE,
   REQ_PROCESS_KILL,
@@ -64,6 +61,9 @@ typedef enum {
   REQ_COMM_GET_DST_PROC,
 #ifdef HAVE_LATENCY_BOUND_TRACKING
   REQ_COMM_IS_LATENCY_BOUNDED,
+#endif
+#ifdef HAVE_TRACING
+  REQ_SET_CATEGORY,
 #endif
   REQ_MUTEX_INIT,
   REQ_MUTEX_DESTROY,
@@ -173,13 +173,6 @@ typedef struct s_smx_req {
       double priority;
     } host_execution_set_priority;
 
-#ifdef HAVE_TRACING
-    struct {
-      smx_action_t execution;
-      const char *category;
-    } host_execution_set_category;
-#endif
-
     struct {
       smx_action_t execution;
     } host_execution_wait;
@@ -369,6 +362,13 @@ typedef struct s_smx_req {
     } comm_is_latency_bounded;
 #endif
 
+#ifdef HAVE_TRACING
+    struct {
+      smx_action_t action;
+      const char *category;
+    } set_category;
+#endif
+
     struct {
       smx_mutex_t result;
     } mutex_init;
index 48ef546..8bcbf47 100644 (file)
@@ -297,13 +297,6 @@ void SIMIX_host_execution_set_priority(smx_action_t action, double priority)
   surf_workstation_model->set_priority(action->execution.surf_exec, priority);
 }
 
-#ifdef HAVE_TRACING
-void SIMIX_host_execution_set_category(smx_action_t action, const char *category)
-{
-  surf_workstation_model->set_category(action->execution.surf_exec, category);
-}
-#endif
-
 void SIMIX_pre_host_execution_wait(smx_req_t req)
 {
   smx_action_t action = req->host_execution_wait.execution;
@@ -398,3 +391,11 @@ void SIMIX_post_host_execute(smx_action_t action)
     SIMIX_execution_finish(action);
 }
 
+
+#ifdef HAVE_TRACING
+void SIMIX_set_category(smx_action_t action, const char *category)
+{
+  surf_workstation_model->set_category(action->execution.surf_exec, category);
+}
+#endif
+
index bed8cd0..55d6ba1 100644 (file)
@@ -193,15 +193,6 @@ void SIMIX_request_pre(smx_req_t req)
       SIMIX_request_answer(req);
       break;
 
-#ifdef HAVE_TRACING
-    case REQ_HOST_EXECUTION_SET_CATEGORY:
-      SIMIX_host_execution_set_category(
-          req->host_execution_set_category.execution,
-          req->host_execution_set_category.category);
-      SIMIX_request_answer(req);
-      break;
-#endif
-
     case REQ_HOST_EXECUTION_WAIT:
       SIMIX_pre_host_execution_wait(req);
       break;
@@ -416,6 +407,15 @@ void SIMIX_request_pre(smx_req_t req)
       break;
 #endif
 
+#ifdef HAVE_TRACING
+    case REQ_SET_CATEGORY:
+      SIMIX_set_category(
+          req->set_category.action,
+          req->set_category.category);
+      SIMIX_request_answer(req);
+      break;
+#endif
+
     case REQ_MUTEX_INIT:
       req->mutex_init.result = SIMIX_mutex_init();
       SIMIX_request_answer(req);
index dae8115..abe1b07 100644 (file)
@@ -268,25 +268,6 @@ void SIMIX_req_host_execution_set_priority(smx_action_t execution, double priori
   SIMIX_request_push(&req);
 }
 
-#ifdef HAVE_TRACING
-/**
- * \brief Set the category of an execution action.
- *
- * This functions changes the priority only. It calls a surf function.
- * \param execution The execution action
- * \param priority The new priority
- */
-void SIMIX_req_host_execution_set_category(smx_action_t execution, const char *category)
-{
-  s_smx_req_t req;
-
-  req.call = REQ_HOST_EXECUTION_SET_CATEGORY;
-  req.host_execution_set_category.execution = execution;
-  req.host_execution_set_category.category = xbt_strdup (category);
-  SIMIX_request_push(&req);
-}
-#endif
-
 /**
  * \brief Waits for the completion of an execution action.
  *
@@ -705,6 +686,26 @@ void SIMIX_req_comm_wait(smx_action_t comm, double timeout)
   SIMIX_request_push(&req);
 }
 
+#ifdef HAVE_TRACING
+/**
+ * \brief Set the category of an action.
+ *
+ * This functions changes the category only. It calls a surf function.
+ * \param execution The execution action
+ * \param category The tracing category
+ */
+void SIMIX_req_set_category(smx_action_t action, const char *category)
+{
+  s_smx_req_t req;
+
+  req.call = REQ_SET_CATEGORY;
+  req.set_category.action = action;
+  req.set_category.category = xbt_strdup (category);
+
+  SIMIX_request_push(&req);
+}
+#endif
+
 int SIMIX_req_comm_test(smx_action_t comm)
 {
   s_smx_req_t req;