From 0748addf6f2e71e61e6ae97e7da38fc82143e558 Mon Sep 17 00:00:00 2001 From: schnorr Date: Tue, 20 Apr 2010 12:37:06 +0000 Subject: [PATCH 1/1] renaming value of presence state to "presence" (to get a good time-slice value later on) details: - also a fix on the tracing to avoid two push states when a process is migrated to a host where it has never been git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7616 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/instr/msg_process_instr.c | 15 ++++++++++----- src/instr/private.h | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/instr/msg_process_instr.c b/src/instr/msg_process_instr.c index 03da8b2b69..2b3bfe14e8 100644 --- a/src/instr/msg_process_instr.c +++ b/src/instr/msg_process_instr.c @@ -21,7 +21,8 @@ void __TRACE_msg_process_init (void) process_containers = xbt_dict_new(); } -void __TRACE_msg_process_location (m_process_t process) +//return 1 if presence must be updated +int __TRACE_msg_process_location (m_process_t process) { char name[200], alias[200]; m_host_t host = MSG_process_get_host (process); @@ -31,8 +32,11 @@ void __TRACE_msg_process_location (m_process_t process) //check if process_alias container is already created if (!xbt_dict_get_or_null (process_containers, alias)){ if (IS_TRACING_PROCESSES) pajeCreateContainer (MSG_get_clock(), alias, "PROCESS", MSG_host_get_name(host), name); - if (IS_TRACING_PROCESSES) pajePushState (MSG_get_clock(), "presence", alias, "1"); + if (IS_TRACING_PROCESSES) pajePushState (MSG_get_clock(), "presence", alias, "presence"); xbt_dict_set (process_containers, xbt_strdup(alias), xbt_strdup("1"), xbt_free); + return 0; + }else{ + return 1; } } @@ -68,9 +72,10 @@ void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_ho TRACE_process_alias_container (process, old_host, alias, 200); if (IS_TRACING_PROCESSES) pajePopState (MSG_get_clock(), "presence", alias); - __TRACE_msg_process_location (process); - TRACE_process_alias_container (process, new_host, alias, 200); - if (IS_TRACING_PROCESSES) pajePushState (MSG_get_clock(), "presence", alias, "1"); + if (__TRACE_msg_process_location (process)) { + TRACE_process_alias_container (process, new_host, alias, 200); + if (IS_TRACING_PROCESSES) pajePushState (MSG_get_clock(), "presence", alias, "presence"); + } } void TRACE_msg_process_kill (m_process_t process) diff --git a/src/instr/private.h b/src/instr/private.h index 6c75cf3972..f37f03e75f 100644 --- a/src/instr/private.h +++ b/src/instr/private.h @@ -86,7 +86,7 @@ void TRACE_msg_task_put_end (void); /* declaration of instrumentation functions from msg_process_instr.c */ void __TRACE_msg_process_init (void); -void __TRACE_msg_process_location (m_process_t process); +int __TRACE_msg_process_location (m_process_t process); void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_host_t new_host); void TRACE_msg_process_kill (m_process_t process); void TRACE_msg_process_suspend (m_process_t process); -- 2.20.1