Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] using parser callbacks to trace the platform hierarchy
[simgrid.git] / src / instr / instr_surf.c
index d7fe848..bfec1b8 100644 (file)
@@ -9,7 +9,7 @@
 
 #ifdef HAVE_TRACING
 
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(tracing_surf, tracing, "Tracing Surf");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(instr_surf, instr, "Tracing Surf");
 
 static xbt_dict_t created_links;
 static xbt_dict_t host_containers;
@@ -210,7 +210,7 @@ void TRACE_surf_host_vivaldi_parse(char *host, double x, double y,
                                    double h)
 {
   char valuestr[100];
-  if (!TRACE_is_active() || !IS_TRACING_PLATFORM)
+  if (!TRACE_is_active() || !TRACE_platform_is_enabled())
     return;
 
   snprintf(valuestr, 100, "%g", x);
@@ -265,12 +265,11 @@ void TRACE_surf_action(surf_action_t surf_action, const char *category)
 {
   if (!TRACE_is_active())
     return;
-  if (!IS_TRACING_PLATFORM)
+  if (!TRACE_platform_is_enabled())
     return;
   if (!category)
     return;
 
-  surf_action->category = xbt_new(char, strlen(category) + 1);
-  strncpy(surf_action->category, category, strlen(category) + 1);
+  surf_action->category = xbt_strdup(category);
 }
 #endif /* HAVE_TRACING */