From: mquinson Date: Mon, 22 Mar 2010 10:08:49 +0000 (+0000) Subject: tiny optimizations X-Git-Tag: SVN~455 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/985d8e345147b42e580f7135929d262257fb851e tiny optimizations git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7284 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/gras/Virtu/sg_process.c b/src/gras/Virtu/sg_process.c index bc39cf2c7a..d5c814c757 100644 --- a/src/gras/Virtu/sg_process.c +++ b/src/gras/Virtu/sg_process.c @@ -179,7 +179,7 @@ const char *xbt_procname(void) As a hack we check for maestro by looking to the assigned host, if it is NULL then we are sure is maestro */ - if (process != NULL && SIMIX_host_self()) + if (process != NULL && SIMIX_process_get_host(process)) return SIMIX_process_get_name(process); return ""; diff --git a/src/xbt/xbt_log_layout_simple.c b/src/xbt/xbt_log_layout_simple.c index 4165fc728e..4eb20d7e31 100644 --- a/src/xbt/xbt_log_layout_simple.c +++ b/src/xbt/xbt_log_layout_simple.c @@ -89,9 +89,10 @@ static void xbt_log_layout_simple_doit(xbt_log_layout_t l, check_overflow; /* Display the proc info if available */ - if (strlen(xbt_procname())) { + const char *procname=xbt_procname(); + if (strlen(procname)) { p += snprintf(p, XBT_LOG_BUFF_SIZE - (p - ev->buffer), "%s:%s:(%d) ", - gras_os_myname(), xbt_procname(), (*xbt_getpid) ()); + gras_os_myname(), procname, (*xbt_getpid) ()); check_overflow; }