From e9a0e9bc5955dc35cdce96dfdee9ab09fcb0d25e Mon Sep 17 00:00:00 2001 From: Jonathan Rouzaud-Cornabas Date: Mon, 15 Apr 2013 18:09:52 +0200 Subject: [PATCH] Add new tracing options to reduce the size of the traces --- src/instr/instr_config.c | 30 ++++++++++++++++++++++++++++++ src/instr/instr_private.h | 2 ++ src/surf/instr_routing.c | 4 ++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/instr/instr_config.c b/src/instr/instr_config.c index daf03e961d..f41aad75ca 100644 --- a/src/instr/instr_config.c +++ b/src/instr/instr_config.c @@ -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, diff --git a/src/instr/instr_private.h b/src/instr/instr_private.h index 88210b634b..07f7dce75d 100644 --- a/src/instr/instr_private.h +++ b/src/instr/instr_private.h @@ -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); diff --git a/src/surf/instr_routing.c b/src/surf/instr_routing.c index c0510fb849..0b4cc078d0 100644 --- a/src/surf/instr_routing.c +++ b/src/surf/instr_routing.c @@ -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); -- 2.20.1