A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[trace] call functions that do the simix processes category registration directly
[simgrid.git]
/
src
/
instr
/
instr_msg_task.c
diff --git
a/src/instr/instr_msg_task.c
b/src/instr/instr_msg_task.c
index
0e978dd
..
af17a95
100644
(file)
--- a/
src/instr/instr_msg_task.c
+++ b/
src/instr/instr_msg_task.c
@@
-8,6
+8,8
@@
#ifdef HAVE_TRACING
#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,
static xbt_dict_t task_containers = NULL;
static char *TRACE_task_alias_container(m_task_t task, m_process_t process,
@@
-59,7
+61,7
@@
static void TRACE_task_location(m_task_t task)
char *val_one = NULL;
m_process_t process = NULL;
m_host_t host = NULL;
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);
return;
process = MSG_process_self();
host = MSG_process_get_host(process);
@@
-82,7
+84,7
@@
static void TRACE_task_location_present(m_task_t task)
char alias[200];
m_process_t process = NULL;
m_host_t host = NULL;
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();
return;
//updating presence state of this task location
process = MSG_process_self();
@@
-97,7
+99,7
@@
static void TRACE_task_location_not_present(m_task_t task)
char alias[200];
m_process_t process = NULL;
m_host_t host = NULL;
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();
return;
//updating presence state of this task location
process = MSG_process_self();
@@
-113,7
+115,7
@@
static void TRACE_task_location_not_present(m_task_t task)
void TRACE_msg_set_task_category(m_task_t task, const char *category)
{
char name[200];
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
return;
//set task category
@@
-126,9
+128,9
@@
void TRACE_msg_set_task_category(m_task_t task, const char *category)
TRACE_task_container(task, name, 200);
//create container of type "task" to indicate behavior
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);
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");
}
pajePushState(MSG_get_clock(), "task-state", name, "created");
}
@@
-144,24
+146,30
@@
void TRACE_msg_task_create(m_task_t task)
void TRACE_msg_task_execute_start(m_task_t task)
{
char name[200];
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);
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");
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];
}
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);
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());
pajePopState(MSG_get_clock(), "task-state", name);
TRACE_category_unset(SIMIX_process_self());
@@
-171,11
+179,14
@@
void TRACE_msg_task_execute_end(m_task_t task)
void TRACE_msg_task_destroy(m_task_t task)
{
char name[200];
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);
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
pajeDestroyContainer(MSG_get_clock(), "task", name);
//finish the location of this task
@@
-189,18
+200,21
@@
void TRACE_msg_task_destroy(m_task_t task)
/* MSG_task_get related functions */
void TRACE_msg_task_get_start(void)
{
/* 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];
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);
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);
pajePopState(MSG_get_clock(), "task-state", name);
TRACE_msg_volume_finish(task);
@@
-213,13
+227,16
@@
void TRACE_msg_task_get_end(double start_time, m_task_t task)
int TRACE_msg_task_put_start(m_task_t task)
{
char name[200];
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);
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);
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);
pajePushState(MSG_get_clock(), "task-state", name, "communicate");
TRACE_msg_volume_start(task);
@@
-228,13
+245,13
@@
int TRACE_msg_task_put_start(m_task_t task)
TRACE_task_location_not_present(task);
//set current category
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)
{
return 1;
}
void TRACE_msg_task_put_end(void)
{
- if (!
IS_TRACING
)
+ if (!
TRACE_is_active()
)
return;
TRACE_category_unset(SIMIX_process_self());
return;
TRACE_category_unset(SIMIX_process_self());