Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
xbt_os_procname and xbt_binary_name are the same -- keep only one of them
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 25 Nov 2012 14:07:45 +0000 (15:07 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 25 Nov 2012 14:07:45 +0000 (15:07 +0100)
include/xbt/module.h
include/xbt/virtu.h
src/surf/surf.c
src/xbt/backtrace_linux.c
src/xbt/ex.c
src/xbt/mmalloc/mm_diff.c
src/xbt/xbt_main.c
src/xbt/xbt_virtu.c

index f3f5a44..3fc85f9 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <xbt/misc.h>           /* XBT_PUBLIC */
 
-XBT_PUBLIC(char *)xbt_binary_name;
-
 XBT_PUBLIC(void) xbt_init(int *argc, char **argv);
 XBT_PUBLIC(void) xbt_exit(void);
 #endif                          /* _XBT_MODULE_H */
index c298083..006bdd8 100644 (file)
@@ -22,7 +22,7 @@ XBT_PUBLIC_DATA(int_f_void_t) xbt_getpid;
 XBT_PUBLIC(double) xbt_time(void);
 
     /* Get the name of the UNIX process englobing the world */
-    XBT_PUBLIC(const char*) xbt_os_procname(void);
+    XBT_PUBLIC_DATA(char*) xbt_binary_name;
 
     /**
      *
index df3087e..fc1e385 100644 (file)
@@ -413,13 +413,8 @@ void sg_version(int *ver_major,int *ver_minor,int *ver_patch) {
 
 xbt_dynar_t sg_cmdline = NULL;
 
-extern char *xbt_os_procname_data;
-
-
 void surf_init(int *argc, char **argv)
 {
-  xbt_os_procname_data = argv[0];
-
   XBT_DEBUG("Create all Libs");
   host_lib = xbt_lib_new();
   link_lib = xbt_lib_new();
index e9dbed5..898069a 100644 (file)
@@ -116,7 +116,7 @@ void xbt_ex_setup_backtrace(xbt_ex_t * e) //FIXME: This code could be greatly im
 
   e->bt_strings = NULL;
 
-  if (!xbt_binary_name) /* no binary name, nothing to do */
+  if (xbt_binary_name != NULL) /* no binary name, nothing to do */
     return;
 
   if (e->used <= 1)
index d853cf5..b90fc8d 100644 (file)
@@ -46,7 +46,6 @@
 #include "portable.h"           /* execinfo when available */
 #include "xbt/ex.h"
 #include "xbt/str.h"
-#include "xbt/module.h"         /* xbt_binary_name */
 #include "xbt_modinter.h"       /* backtrace initialization headers */
 
 #include "xbt/ex_interface.h"
@@ -140,7 +139,7 @@ void xbt_ex_display(xbt_ex_t * e)
           "** SimGrid: UNCAUGHT EXCEPTION received on %s(%d): category: %s; value: %d\n"
           "** %s\n"
           "** Thrown by %s()%s\n",
-          xbt_os_procname(), xbt_getpid(),
+          xbt_binary_name, xbt_getpid(),
           xbt_ex_catname(e->category), e->value, e->msg,
           e->procname, thrower ? thrower : " in this process");
   XBT_CRITICAL("%s", e->msg);
index f577979..9ffeac1 100644 (file)
@@ -13,8 +13,6 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mm_diff, xbt,
                                 "Logging specific to mm_diff in mmalloc");
 
-extern char *xbt_binary_name;
-
 xbt_dynar_t mc_heap_comparison_ignore;
 xbt_dynar_t stacks_areas;
 
index 79a0c7c..73e2daa 100644 (file)
@@ -26,7 +26,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module, xbt, "module handling");
 XBT_LOG_NEW_CATEGORY(smpi, "All SMPI categories"); /* lives here even if that's a bit odd to solve linking issues: this is used in xbt_log_file_appender to detect whether SMPI is used (and thus whether we should unbench the writing to disk) */
 
 
-char *xbt_binary_name = NULL;   /* Mandatory to retrieve neat backtraces */
+char *xbt_binary_name = NULL;   /* Name of the system process containing us (mandatory to retrieve neat backtraces) */
 int xbt_initialized = 0;
 
 int _surf_do_model_check = 0;
index efe333d..664d87b 100644 (file)
@@ -11,8 +11,6 @@
 #include "xbt/function_types.h"
 #include "simgrid/simix.h"
 
-char *xbt_os_procname_data = NULL;
-
 static int xbt_fake_pid(void)
 {
   return 0;
@@ -41,8 +39,3 @@ const char *xbt_procname(void)
 {
   return SIMIX_process_self_get_name();
 }
-
-const char *xbt_os_procname(void)
-{
-  return xbt_os_procname_data;
-}