X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/45dc2797b3d31a19e3e8386f149798b7ab3566ed..e9c069dd94c45e768bbcc65e4232fdde688a7e37:/src/msg/msg_gos.c diff --git a/src/msg/msg_gos.c b/src/msg/msg_gos.c index cec273dd3b..7043c047d4 100644 --- a/src/msg/msg_gos.c +++ b/src/msg/msg_gos.c @@ -874,6 +874,45 @@ int MSG_task_listen_from(const char *alias) return MSG_process_get_PID(task->simdata->sender); } +/** \ingroup msg_gos_functions + * + * See \ref tracing_tracing for details on how to trace + * the (categorized) resource utilization. + * + * \brief Sets the tracing category of a task. + * + * \param task the task that is going to be categorized + * \param category the name of the category to be associated to the task + * + * \see MSG_task_get_category, TRACE_category, TRACE_category_with_color + */ +void MSG_task_set_category (m_task_t task, const char *category) +{ +#ifdef HAVE_TRACING + TRACE_msg_set_task_category (task, category); +#endif +} + + +/** \ingroup msg_gos_functions + * + * \brief Gets the current tracing category of a task. + * + * \param task the task to be considered + * + * \see MSG_task_set_category + * + * \return Returns the name of the tracing category of the given task, NULL otherwise + */ +const char *MSG_task_get_category (m_task_t task) +{ +#ifdef HAVE_TRACING + return task->category; +#else + return NULL; +#endif +} + #ifdef MSG_USE_DEPRECATED /** \ingroup msg_gos_functions *