X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/673a25c682fbdedbdefbc513160b2710a5b545fb..a889c5815b75beb11f858bab68b2314c8dc724c2:/src/instr/instr_resource_utilization.c diff --git a/src/instr/instr_resource_utilization.c b/src/instr/instr_resource_utilization.c index d68cb878b3..9e0921cf2a 100644 --- a/src/instr/instr_resource_utilization.c +++ b/src/instr/instr_resource_utilization.c @@ -8,6 +8,8 @@ #ifdef HAVE_TRACING +XBT_LOG_NEW_DEFAULT_SUBCATEGORY (instr_resource, instr, "tracing (un)-categorized resource utilization"); + //to check if variables were previously set to 0, otherwise paje won't simulate them static xbt_dict_t platform_variables; /* host or link name -> array of categories */ @@ -37,7 +39,7 @@ static void __TRACE_surf_check_variable_set_to_zero(double now, xbt_dynar_t array = xbt_dynar_new(sizeof(char *), xbt_free); char *var_cpy = xbt_strdup(variable); xbt_dynar_push(array, &var_cpy); - if (IS_TRACING_PLATFORM) + if (TRACE_platform_is_enabled()) pajeSetVariable(now, variable, resource, "0"); xbt_dict_set(platform_variables, resource, array, xbt_dynar_free_voidp); @@ -54,7 +56,7 @@ static void __TRACE_surf_check_variable_set_to_zero(double now, if (flag == 0) { char *var_cpy = xbt_strdup(variable); xbt_dynar_push(array, &var_cpy); - if (IS_TRACING_PLATFORM) + if (TRACE_platform_is_enabled()) pajeSetVariable(now, variable, resource, "0"); } } @@ -79,9 +81,6 @@ static void __TRACE_A_event(smx_action_t action, double now, double delta, const char *variable, const char *resource, double value) { - if (!IS_TRACING_PLATFORM) - return; - char valuestr[100]; snprintf(valuestr, 100, "%f", value); @@ -104,9 +103,6 @@ static void __TRACE_B_alloc(void) static void __TRACE_B_release(void) { - if (!IS_TRACING_PLATFORM) - return; - char *key, *time; xbt_dict_cursor_t cursor = NULL; xbt_dict_foreach(method_b_dict, cursor, key, time) { @@ -132,9 +128,6 @@ static void __TRACE_B_event(smx_action_t action, double now, double delta, const char *variable, const char *resource, double value) { - if (!IS_TRACING_PLATFORM) - return; - char key_time[INSTR_DEFAULT_STR_SIZE]; char key_value[INSTR_DEFAULT_STR_SIZE]; char nowstr[INSTR_DEFAULT_STR_SIZE]; @@ -294,15 +287,17 @@ void TRACE_surf_link_set_utilization(void *link, smx_action_t smx_action, //trace uncategorized link utilization if (TRACE_uncategorized()){ + DEBUG4("UNCAT LINK [%f - %f] %s bandwidth_used %f", now, now+delta, resource, value); TRACE_surf_resource_utilization_event(smx_action, now, delta, "bandwidth_used", resource, value); } //trace categorized utilization - if (!IS_TRACED(surf_action)) + if (!surf_action->category) return; char type[100]; snprintf(type, 100, "b%s", surf_action->category); + DEBUG5("CAT LINK [%f - %f] %s %s %f", now, now+delta, resource, type, value); TRACE_surf_resource_utilization_event(smx_action, now, delta, type, resource, value); return; @@ -324,15 +319,17 @@ void TRACE_surf_host_set_utilization(const char *name, //trace uncategorized host utilization if (TRACE_uncategorized()){ + DEBUG4("UNCAT HOST [%f - %f] %s power_used %f", now, now+delta, name, value); TRACE_surf_resource_utilization_event(smx_action, now, delta, "power_used", name, value); } //trace categorized utilization - if (!IS_TRACED(surf_action)) + if (!surf_action->category) return; char type[100]; snprintf(type, 100, "p%s", surf_action->category); + DEBUG5("CAT HOST [%f - %f] %s %s %f", now, now+delta, name, type, value); TRACE_surf_resource_utilization_event(smx_action, now, delta, type, name, value); return; @@ -345,6 +342,7 @@ void TRACE_surf_resource_utilization_start(smx_action_t action) { if (!TRACE_is_active()) return; + DEBUG1("START %p", action); TRACE_method_start(action); } @@ -356,6 +354,7 @@ void TRACE_surf_resource_utilization_event(smx_action_t action, double now, { if (!TRACE_is_active()) return; + DEBUG6("EVENT %p [%f - %f] %s %s %f", action, now, now+delta, resource, variable, value); TRACE_method_event(action, now, delta, variable, resource, value); } @@ -364,6 +363,7 @@ void TRACE_surf_resource_utilization_end(smx_action_t action) if (!TRACE_is_active()) return; TRACE_method_end(action); + DEBUG1("END %p", action); } void TRACE_surf_resource_utilization_release()