From: schnorr Date: Fri, 23 Apr 2010 15:51:27 +0000 (+0000) Subject: splitting the code of one tracing function in two (preparation of upcoming commit) X-Git-Tag: SVN~103 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/e6465cc6a82fb2717d52f24645a2232f3b169a0f splitting the code of one tracing function in two (preparation of upcoming commit) git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7638 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/instr/msg_process_instr.c b/src/instr/msg_process_instr.c index 771003289a..bf67050a1d 100644 --- a/src/instr/msg_process_instr.c +++ b/src/instr/msg_process_instr.c @@ -21,9 +21,10 @@ void __TRACE_msg_process_init (void) process_containers = xbt_dict_new(); } -//return 1 if presence must be updated -int __TRACE_msg_process_location (m_process_t process) +void __TRACE_msg_process_location (m_process_t process) { + if (!IS_TRACING_PROCESSES) return; + char name[200], alias[200]; m_host_t host = MSG_process_get_host (process); TRACE_process_container (process, name, 200); @@ -31,16 +32,23 @@ int __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, "presence"); - if (IS_TRACING_PROCESSES) pajeSetState (MSG_get_clock(), "category", alias, process->category); + pajeCreateContainer (MSG_get_clock(), alias, "PROCESS", MSG_host_get_name(host), name); + pajeSetState (MSG_get_clock(), "category", alias, process->category); xbt_dict_set (process_containers, xbt_strdup(alias), xbt_strdup("1"), xbt_free); - return 0; - }else{ - return 1; } } +void __TRACE_msg_process_present (m_process_t process) +{ + if (!IS_TRACING_PROCESSES) return; + + //updating presence state of this process location + char alias[200]; + m_host_t host = MSG_process_get_host (process); + TRACE_process_alias_container (process, host, alias, 200); + pajePushState (MSG_get_clock(), "presence", alias, "presence"); +} + /* * TRACE_msg_set_process_category: tracing interface function */ @@ -54,6 +62,7 @@ void TRACE_msg_set_process_category (m_process_t process, const char *category) //create container of type "PROCESS" to indicate location __TRACE_msg_process_location (process); + __TRACE_msg_process_present (process); //create container of type "process" to indicate behavior char name[200]; @@ -69,14 +78,13 @@ void TRACE_msg_process_change_host (m_process_t process, m_host_t old_host, m_ho { if (!IS_TRACING_PROCESSES || !IS_TRACED(process)) return; + //disabling presence in old_host (__TRACE_msg_process_not_present) char alias[200]; TRACE_process_alias_container (process, old_host, alias, 200); if (IS_TRACING_PROCESSES) pajePopState (MSG_get_clock(), "presence", alias); - 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"); - } + __TRACE_msg_process_location (process); + __TRACE_msg_process_present (process); } void TRACE_msg_process_kill (m_process_t process) diff --git a/src/instr/private.h b/src/instr/private.h index 3bc538cb69..78605f79e5 100644 --- a/src/instr/private.h +++ b/src/instr/private.h @@ -88,7 +88,8 @@ void TRACE_msg_task_put_end (void); /* declaration of instrumentation functions from msg_process_instr.c */ void __TRACE_msg_process_init (void); -int __TRACE_msg_process_location (m_process_t process); +void __TRACE_msg_process_location (m_process_t process); +void __TRACE_msg_process_present (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);