From: schnorr Date: Tue, 7 Dec 2010 09:56:14 +0000 (+0000) Subject: [trace] renaming system call to set any action tracing categories, make useful also... X-Git-Tag: v3.6_beta2~894 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/794c022b0b35e1379ce8e4e0a6b26f83ee07c95b [trace] renaming system call to set any action tracing categories, make useful also for network models git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9029 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/include/simix/simix.h b/include/simix/simix.h index 0c60ed11f9..8270b261b9 100644 --- a/include/simix/simix.h +++ b/include/simix/simix.h @@ -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); diff --git a/src/msg/gos.c b/src/msg/gos.c index ba361cc989..859bb082a9 100644 --- a/src/msg/gos.c +++ b/src/msg/gos.c @@ -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; diff --git a/src/simix/host_private.h b/src/simix/host_private.h index 65a48b6918..ad5332d9a3 100644 --- a/src/simix/host_private.h +++ b/src/simix/host_private.h @@ -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 diff --git a/src/simix/smurf_private.h b/src/simix/smurf_private.h index 7a80c3f82c..09050f9de5 100644 --- a/src/simix/smurf_private.h +++ b/src/simix/smurf_private.h @@ -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; diff --git a/src/simix/smx_host.c b/src/simix/smx_host.c index 48ef546185..8bcbf4705b 100644 --- a/src/simix/smx_host.c +++ b/src/simix/smx_host.c @@ -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 + diff --git a/src/simix/smx_smurf.c b/src/simix/smx_smurf.c index bed8cd05b1..55d6ba17b3 100644 --- a/src/simix/smx_smurf.c +++ b/src/simix/smx_smurf.c @@ -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); diff --git a/src/simix/smx_user.c b/src/simix/smx_user.c index dae8115567..abe1b0741e 100644 --- a/src/simix/smx_user.c +++ b/src/simix/smx_user.c @@ -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;