From b738bea68519ee23e8c3b12c1a290e576d879243 Mon Sep 17 00:00:00 2001 From: schnorr Date: Mon, 13 Dec 2010 16:45:30 +0000 Subject: [PATCH] [trace] set/push/pop states for tracing/msg/[task|process]:1 git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9216 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/instr/instr_msg_process.c | 23 +++++++++++++++-------- src/instr/instr_msg_task.c | 33 ++++++++++++++++++++------------- src/instr/instr_routing.c | 6 ++++-- 3 files changed, 39 insertions(+), 23 deletions(-) diff --git a/src/instr/instr_msg_process.c b/src/instr/instr_msg_process.c index b133f433aa..9ca7ff1283 100644 --- a/src/instr/instr_msg_process.c +++ b/src/instr/instr_msg_process.c @@ -47,6 +47,9 @@ void TRACE_msg_set_process_category(m_process_t process, const char *category, c type = newVariableType(category, TYPE_VARIABLE, color, msg->type); } pajeSetVariable(SIMIX_get_clock(), type->id, msg->id, "1"); + + type = getType ("MSG_PROCESS_STATE"); + pajeSetState (MSG_get_clock(), type->id, msg->id, "executing"); } /* @@ -83,8 +86,9 @@ void TRACE_msg_process_suspend(m_process_t process) TRACE_msg_process_is_enabled() && process->category)) return; - //FIXME - //pajeSetState(MSG_get_clock(), "process-state", name, "suspend"); + container_t process_container = getContainer (process->name); + type_t type = getType ("MSG_PROCESS_STATE"); + pajePushState (MSG_get_clock(), type->id, process_container->id, "suspend"); } void TRACE_msg_process_resume(m_process_t process) @@ -93,8 +97,9 @@ void TRACE_msg_process_resume(m_process_t process) TRACE_msg_process_is_enabled() && process->category)) return; - //FIXME - //pajeSetState(MSG_get_clock(), "process-state", name, "executing"); + container_t process_container = getContainer (process->name); + type_t type = getType ("MSG_PROCESS_STATE"); + pajePopState (MSG_get_clock(), type->id, process_container->id); } void TRACE_msg_process_sleep_in(m_process_t process) @@ -103,8 +108,9 @@ void TRACE_msg_process_sleep_in(m_process_t process) TRACE_msg_process_is_enabled() && process->category)) return; - //FIXME - //pajeSetState(MSG_get_clock(), "process-state", name, "sleep"); + container_t process_container = getContainer (process->name); + type_t type = getType ("MSG_PROCESS_STATE"); + pajePushState (MSG_get_clock(), type->id, process_container->id, "sleep"); } void TRACE_msg_process_sleep_out(m_process_t process) @@ -113,8 +119,9 @@ void TRACE_msg_process_sleep_out(m_process_t process) TRACE_msg_process_is_enabled() && process->category)) return; - //FIXME - //pajeSetState(MSG_get_clock(), "process-state", name, "executing"); + container_t process_container = getContainer (process->name); + type_t type = getType ("MSG_PROCESS_STATE"); + pajePopState (MSG_get_clock(), type->id, process_container->id); } void TRACE_msg_process_end(m_process_t process) diff --git a/src/instr/instr_msg_task.c b/src/instr/instr_msg_task.c index 8aabfcf2a1..59ca7c0223 100644 --- a/src/instr/instr_msg_task.c +++ b/src/instr/instr_msg_task.c @@ -58,8 +58,9 @@ void TRACE_msg_set_task_category(m_task_t task, const char *category) } pajeSetVariable(SIMIX_get_clock(), type->id, msg->id, "1"); - //FIXME - //pajePushState(MSG_get_clock(), "task-state", name, "created"); + type = getType ("MSG_TASK_STATE"); + pajePushState (MSG_get_clock(), type->id, msg->id, "created"); + xbt_dict_set (tasks_created, task->name, xbt_strdup("1"), xbt_free); } } @@ -82,8 +83,9 @@ void TRACE_msg_task_execute_start(m_task_t task) DEBUG3("EXEC,in %p, %lld, %s", task, task->counter, task->category); - //FIXME - //pajePushState(MSG_get_clock(), "task-state", name, "execute"); + container_t task_container = getContainer (task->name); + type_t type = getType ("MSG_TASK_STATE"); + pajePushState (MSG_get_clock(), type->id, task_container->id, "MSG_task_execute"); } void TRACE_msg_task_execute_end(m_task_t task) @@ -94,8 +96,9 @@ void TRACE_msg_task_execute_end(m_task_t task) DEBUG3("EXEC,out %p, %lld, %s", task, task->counter, task->category); - //FIXME - //pajePopState(MSG_get_clock(), "task-state", name); + container_t task_container = getContainer (task->name); + type_t type = getType ("MSG_TASK_STATE"); + pajePopState (MSG_get_clock(), type->id, task_container->id); } /* MSG_task_destroy related functions */ @@ -136,9 +139,6 @@ void TRACE_msg_task_get_end(double start_time, m_task_t task) DEBUG3("GET,out %p, %lld, %s", task, task->counter, task->category); - //FIXME - //pajePopState(MSG_get_clock(), "task-state", name); - //FIXME //if (TRACE_msg_volume_is_enabled()){ // TRACE_msg_volume_end(task); @@ -149,6 +149,11 @@ void TRACE_msg_task_get_end(double start_time, m_task_t task) container_t msg = newContainer(task->name, INSTR_MSG_TASK, host_container); type_t type = getType (task->category); pajeSetVariable(SIMIX_get_clock(), type->id, msg->id, "1"); + + type = getType ("MSG_TASK_STATE"); + pajePushState (MSG_get_clock(), type->id, msg->id, "created"); + + //FIXME: pajeEndLink } /* MSG_task_put related functions */ @@ -160,11 +165,13 @@ int TRACE_msg_task_put_start(m_task_t task) DEBUG3("PUT,in %p, %lld, %s", task, task->counter, task->category); - destroyContainer (getContainer(task->name)); + container_t msg = getContainer (task->name); + type_t type = getType ("MSG_TASK_STATE"); + pajePopState (MSG_get_clock(), type->id, msg->id); - //FIXME - //pajePopState(MSG_get_clock(), "task-state", name); - //pajePushState(MSG_get_clock(), "task-state", name, "communicate"); + //FIXME: pajeStartLink + + destroyContainer (msg); //FIXME //if (TRACE_msg_volume_is_enabled()){ diff --git a/src/instr/instr_routing.c b/src/instr/instr_routing.c index 06c2898d25..b617787eff 100644 --- a/src/instr/instr_routing.c +++ b/src/instr/instr_routing.c @@ -513,11 +513,13 @@ static void instr_routing_parse_start_host () } if (TRACE_msg_process_is_enabled()) { - getContainerType("MSG_PROCESS", new->type); + type_t msg_process = getContainerType("MSG_PROCESS", new->type); + getStateType ("MSG_PROCESS_STATE", msg_process); } if (TRACE_msg_task_is_enabled()) { - getContainerType ("MSG_TASK", new->type); + type_t msg_task = getContainerType ("MSG_TASK", new->type); + getStateType ("MSG_TASK_STATE", msg_task); } } -- 2.20.1