#ifdef HAVE_TRACING
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_msg, instr, "MSG");
+
static xbt_dict_t task_containers = NULL;
static char *TRACE_task_alias_container(m_task_t task, m_process_t process,
char *val_one = NULL;
m_process_t process = NULL;
m_host_t host = NULL;
- if (!IS_TRACING_TASKS)
+ if (!TRACE_msg_task_is_enabled())
return;
process = MSG_process_self();
host = MSG_process_get_host(process);
char alias[200];
m_process_t process = NULL;
m_host_t host = NULL;
- if (!IS_TRACING_TASKS)
+ if (!TRACE_msg_task_is_enabled())
return;
//updating presence state of this task location
process = MSG_process_self();
char alias[200];
m_process_t process = NULL;
m_host_t host = NULL;
- if (!IS_TRACING_TASKS)
+ if (!TRACE_msg_task_is_enabled())
return;
//updating presence state of this task location
process = MSG_process_self();
void TRACE_msg_set_task_category(m_task_t task, const char *category)
{
char name[200];
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
//set task category
TRACE_task_container(task, name, 200);
//create container of type "task" to indicate behavior
- if (IS_TRACING_TASKS)
+ if (TRACE_msg_task_is_enabled())
pajeCreateContainer(MSG_get_clock(), name, "task", category, name);
- if (IS_TRACING_TASKS)
+ if (TRACE_msg_task_is_enabled())
pajePushState(MSG_get_clock(), "task-state", name, "created");
}
void TRACE_msg_task_execute_start(m_task_t task)
{
char name[200];
- if (!IS_TRACING || !IS_TRACED(task))
+ if (!TRACE_is_active())
+ return;
+
+ if (!task->category)
return;
TRACE_task_container(task, name, 200);
- if (IS_TRACING_TASKS)
+ if (TRACE_msg_task_is_enabled())
pajePushState(MSG_get_clock(), "task-state", name, "execute");
- TRACE_msg_category_set(SIMIX_process_self(), task);
+ TRACE_category_set(SIMIX_process_self(), task->category);
}
void TRACE_msg_task_execute_end(m_task_t task)
{
char name[200];
- if (!IS_TRACING || !IS_TRACED(task))
+ if (!TRACE_is_active())
+ return;
+
+ if (!task->category)
return;
TRACE_task_container(task, name, 200);
- if (IS_TRACING_TASKS)
+ if (TRACE_msg_task_is_enabled())
pajePopState(MSG_get_clock(), "task-state", name);
TRACE_category_unset(SIMIX_process_self());
void TRACE_msg_task_destroy(m_task_t task)
{
char name[200];
- if (!IS_TRACING || !IS_TRACED(task))
+ if (!TRACE_is_active())
+ return;
+
+ if (!task->category)
return;
TRACE_task_container(task, name, 200);
- if (IS_TRACING_TASKS)
+ if (TRACE_msg_task_is_enabled())
pajeDestroyContainer(MSG_get_clock(), "task", name);
//finish the location of this task
/* MSG_task_get related functions */
void TRACE_msg_task_get_start(void)
{
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
}
void TRACE_msg_task_get_end(double start_time, m_task_t task)
{
char name[200];
- if (!IS_TRACING || !IS_TRACED(task))
+ if (!TRACE_is_active())
+ return;
+
+ if (!task->category)
return;
TRACE_task_container(task, name, 200);
- if (IS_TRACING_TASKS)
+ if (TRACE_msg_task_is_enabled())
pajePopState(MSG_get_clock(), "task-state", name);
TRACE_msg_volume_finish(task);
int TRACE_msg_task_put_start(m_task_t task)
{
char name[200];
- if (!IS_TRACING || !IS_TRACED(task))
+ if (!TRACE_is_active())
+ return 0;
+
+ if (!task->category)
return 0;
TRACE_task_container(task, name, 200);
- if (IS_TRACING_TASKS)
+ if (TRACE_msg_task_is_enabled())
pajePopState(MSG_get_clock(), "task-state", name);
- if (IS_TRACING_TASKS)
+ if (TRACE_msg_task_is_enabled())
pajePushState(MSG_get_clock(), "task-state", name, "communicate");
TRACE_msg_volume_start(task);
TRACE_task_location_not_present(task);
//set current category
- TRACE_msg_category_set(SIMIX_process_self(), task);
+ TRACE_category_set(SIMIX_process_self(), task->category);
return 1;
}
void TRACE_msg_task_put_end(void)
{
- if (!IS_TRACING)
+ if (!TRACE_is_active())
return;
TRACE_category_unset(SIMIX_process_self());