Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Add new tracing options to reduce the size of the traces
authorJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Mon, 15 Apr 2013 16:09:52 +0000 (18:09 +0200)
committerJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Mon, 15 Apr 2013 16:09:52 +0000 (18:09 +0200)
src/instr/instr_config.c
src/instr/instr_private.h
src/surf/instr_routing.c

index daf03e9..f41aad7 100644 (file)
@@ -32,6 +32,8 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_config, instr, "Configuration");
 #define OPT_TRACING_COMMENT_FILE  "tracing/comment_file"
 #define OPT_VIVA_UNCAT_CONF      "viva/uncategorized"
 #define OPT_VIVA_CAT_CONF        "viva/categorized"
+#define OPT_TRACING_DISABLE_LINK        "tracing/disable_link"
+#define OPT_TRACING_DISABLE_POWER       "tracing/disable_power"
 
 static int trace_enabled;
 static int trace_platform;
@@ -47,6 +49,8 @@ static int trace_buffer;
 static int trace_onelink_only;
 static int trace_disable_destroy;
 static int trace_basic;
+static int trace_disable_link;
+static int trace_disable_power;
 
 static int trace_configured = 0;
 static int trace_active = 0;
@@ -69,6 +73,8 @@ static void TRACE_getopts(void)
   trace_onelink_only = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_ONELINK_ONLY);
   trace_disable_destroy = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_DISABLE_DESTROY);
   trace_basic = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_BASIC);
+  trace_disable_link = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_DISABLE_LINK);
+  trace_disable_power = xbt_cfg_get_int(_sg_cfg_set, OPT_TRACING_DISABLE_POWER);
 }
 
 static xbt_dynar_t TRACE_start_functions = NULL;
@@ -240,6 +246,15 @@ int TRACE_msg_vm_is_enabled(void)
   return trace_msg_vm_enabled && TRACE_is_enabled();
 }
 
+int TRACE_disable_link(void)
+{
+  return trace_disable_link && TRACE_is_enabled();
+}
+
+int TRACE_disable_power(void)
+{
+  return trace_disable_power && TRACE_is_enabled();
+}
 
 int TRACE_buffer (void)
 {
@@ -365,6 +380,21 @@ void TRACE_global_init(int *argc, char **argv)
                    xbt_cfgelm_int, &default_tracing_msg_vm, 0, 1,
                    NULL, NULL);
 
+  /* disable tracing link */
+  int default_tracing_disable_link = 0;
+  xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_LINK,
+                   "Do not trace link bandwidth and latency.",
+                   xbt_cfgelm_int, &default_tracing_disable_link, 0, 1,
+                   NULL, NULL);
+
+  /* disable tracing link */
+  int default_tracing_disable_power = 0;
+  xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_DISABLE_POWER,
+                   "Do not trace host power.",
+                   xbt_cfgelm_int, &default_tracing_disable_power, 0, 1,
+                   NULL, NULL);
+
+
   /* tracing buffer */
   int default_buffer = 1;
   xbt_cfg_register(&_sg_cfg_set, OPT_TRACING_BUFFER,
index 88210b6..07f7dce 100644 (file)
@@ -142,6 +142,8 @@ int TRACE_uncategorized (void);
 int TRACE_msg_process_is_enabled(void);
 int TRACE_msg_vm_is_enabled(void);
 int TRACE_buffer (void);
+int TRACE_disable_link(void);
+int TRACE_disable_power(void);
 int TRACE_onelink_only (void);
 int TRACE_disable_destroy (void);
 int TRACE_basic (void);
index c0510fb..0b4cc07 100644 (file)
@@ -235,7 +235,7 @@ static void instr_routing_parse_start_link (sg_platf_link_cbarg_t link)
 
     container_t new = PJ_container_new (link_name, INSTR_LINK, father);
 
-    if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()){
+    if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_link())) {
       type_t bandwidth = PJ_type_get_or_null ("bandwidth", new->type);
       if (bandwidth == NULL){
         bandwidth = PJ_type_variable_new ("bandwidth", NULL, new->type);
@@ -263,7 +263,7 @@ static void instr_routing_parse_start_host (sg_platf_host_cbarg_t host)
   container_t father = *(container_t*)xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
   container_t new = PJ_container_new (host->id, INSTR_HOST, father);
 
-  if (TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) {
+  if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_power)) {
     type_t power = PJ_type_get_or_null ("power", new->type);
     if (power == NULL){
       power = PJ_type_variable_new ("power", NULL, new->type);